Skip to content

Commit

Permalink
refactor(server/vehicle): create interface for CreateVehicleData
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Sep 23, 2024
1 parent d2b6b24 commit b8c125a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
10 changes: 2 additions & 8 deletions lib/server/vehicle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { OxVehicle as _OxVehicle } from 'server/vehicle/class';
import type { VehicleProperties } from '@overextended/ox_lib';
import type { CreateVehicleData } from 'server/vehicle';

class VehicleInterface {
constructor(
Expand Down Expand Up @@ -77,13 +77,7 @@ export function GetVehicleFromVin(vin: string) {
}

export async function CreateVehicle(
data: {
model: string;
owner?: number;
group?: string;
stored?: number;
properties?: VehicleProperties;
},
data: CreateVehicleData,
coords?: number | number[] | { x: number; y: number; z: number },
heading?: number
) {
Expand Down
18 changes: 9 additions & 9 deletions server/vehicle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ if (DEBUG) import('./parser');

type Vec3 = number[] | { x: number; y: number; z: number } | { buffer: any };

export interface CreateVehicleData {
model: string;
owner?: number;
group?: string;
stored?: string;
properties?: VehicleProperties;
}

export async function CreateVehicle(
data:
| string
| (Partial<VehicleRow> & {
model: string;
owner?: number;
group?: string;
stored?: string;
properties?: VehicleProperties;
}),
data: string | CreateVehicleData & Partial<VehicleRow>,
coords?: Vec3,
heading?: number,
invokingScript = GetInvokingResource()
Expand Down

0 comments on commit b8c125a

Please sign in to comment.