From cde6816cba4a26e9e0ada8e94a60b3ebcc358bea Mon Sep 17 00:00:00 2001 From: Blue Date: Mon, 18 Sep 2023 22:00:05 +0200 Subject: [PATCH] Revert "shared: move worldobject to shared" This reverts commit 043d6db8b21a6c287395876bcb475ed2f37d627c. --- client/index.d.ts | 32 ++++++++++++++++++++++++-------- server/index.d.ts | 24 +++++++++++++++++++----- shared/index.d.ts | 14 -------------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/client/index.d.ts b/client/index.d.ts index 211e4aa2..95d7d3fc 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -614,7 +614,7 @@ declare module "alt-client" { } /** @beta */ - export class VirtualEntity extends shared.WorldObject { + export class VirtualEntity extends WorldObject { /** Creates a new Virtual Entity */ public constructor(group: VirtualEntityGroup, position: shared.Vector3, streamingDistance: number, data?: Record); @@ -784,7 +784,23 @@ declare module "alt-client" { public entity: WorldObject; } - export class Checkpoint extends shared.WorldObject { + export class WorldObject extends BaseObject { + /** + * Object position + */ + public pos: shared.Vector3; + + /** + * Object dimension. + * + * @remarks Check https://docs.altv.mp/articles/dimensions.html to understand how it works. + * + * @beta + */ + public dimension: number; + } + + export class Checkpoint extends WorldObject { public checkpointType: shared.CheckpointType; public nextPos: shared.Vector3; public radius: number; @@ -852,7 +868,7 @@ declare module "alt-client" { public setMeta(key: K, value: shared.InterfaceValueByKey): void; } - export class Entity extends shared.WorldObject { + export class Entity extends WorldObject { /** * Array with all entities. * @@ -2233,7 +2249,7 @@ declare module "alt-client" { public off(eventName: string, listener: (...args: any[]) => void): void; } - export class Blip extends shared.WorldObject { + export class Blip extends WorldObject { /** * Array with all blips. * @@ -4121,7 +4137,7 @@ declare module "alt-client" { } /** @beta */ - export class Marker extends shared.WorldObject { + export class Marker extends WorldObject { public constructor(type: shared.MarkerType, position: shared.Vector3, color: shared.RGBA, useStreaming?: boolean, streamingDistance?: number); /** @@ -4162,7 +4178,7 @@ declare module "alt-client" { } /** @beta */ - export class Colshape extends shared.WorldObject { + export class Colshape extends WorldObject { public static readonly all: readonly Colshape[]; public readonly colshapeType: shared.ColShapeType; @@ -4241,7 +4257,7 @@ declare module "alt-client" { } /** @beta */ - export class TextLabel extends shared.WorldObject { + export class TextLabel extends WorldObject { public constructor(text: string, fontName: string, fontSize: number, scale: number, pos: shared.IVector3, rot: shared.IVector3, color: shared.RGBA, outlineWidth: number, outlineColor: shared.RGBA, useStreaming?: boolean, streamingDistance?: number); /** @@ -4274,7 +4290,7 @@ declare module "alt-client" { } /** @beta */ - export class LocalVehicle extends shared.WorldObject { + export class LocalVehicle extends WorldObject { public constructor(model: string | number, dimension: number, pos: shared.IVector3, rot: shared.IVector3, useStreaming?: boolean, streamingDistance?: number); /** diff --git a/server/index.d.ts b/server/index.d.ts index 6257901f..853dc8f9 100644 --- a/server/index.d.ts +++ b/server/index.d.ts @@ -713,6 +713,20 @@ declare module "alt-server" { public setSyncedMeta(key: K, value: shared.InterfaceValueByKey): void; } + export class WorldObject extends BaseObject { + /** + * Object dimension. + * + * @remarks Check https://docs.altv.mp/articles/dimensions.html to understand how it works. + */ + public dimension: number; + + /** + * Object position. + */ + public pos: shared.Vector3; + } + /** @beta */ export class VirtualEntityGroup extends BaseObject { /** Creates a new Virtual Entity Group */ @@ -726,7 +740,7 @@ declare module "alt-server" { } /** @beta */ - export class VirtualEntity extends shared.shared.WorldObject { + export class VirtualEntity extends WorldObject { /** Creates a new Virtual Entity */ public constructor(group: VirtualEntityGroup, position: shared.Vector3, streamingDistance: number, data?: Record); @@ -785,7 +799,7 @@ declare module "alt-server" { public deleteStreamSyncedMeta>(key: K): void; } - export class Entity extends shared.WorldObject { + export class Entity extends WorldObject { /** * Array with all entities. * @@ -2561,7 +2575,7 @@ declare module "alt-server" { public hasStreamSyncedMeta>(key: K): boolean; } - export class Blip extends shared.WorldObject { + export class Blip extends WorldObject { /** * Array with all blips. * @@ -2717,7 +2731,7 @@ declare module "alt-server" { constructor(entity: Entity, global: boolean); } - export class Colshape extends shared.WorldObject { + export class Colshape extends WorldObject { /** @beta */ public static readonly all: readonly Colshape[]; @@ -3343,7 +3357,7 @@ declare module "alt-server" { } /** @beta */ - export class Marker extends shared.WorldObject { + export class Marker extends WorldObject { public constructor(type: shared.MarkerType, position: shared.Vector3, color: shared.RGBA); /** diff --git a/shared/index.d.ts b/shared/index.d.ts index a44606f1..55e21aef 100644 --- a/shared/index.d.ts +++ b/shared/index.d.ts @@ -2608,20 +2608,6 @@ declare module "alt-shared" { public readonly refCount: number; } - export class WorldObject extends BaseObject { - /** - * Object dimension. - * - * @remarks Check https://docs.altv.mp/articles/dimensions.html to understand how it works. - */ - public dimension: number; - - /** - * Object position. - */ - public pos: Vector3; - } - /** * Resource name of the executing resource. */