Skip to content

Commit

Permalink
Revert "shared: move worldobject to shared"
Browse files Browse the repository at this point in the history
This reverts commit 043d6db.
  • Loading branch information
C0kkie committed Sep 18, 2023
1 parent 175bedf commit cde6816
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
32 changes: 24 additions & 8 deletions client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -852,7 +868,7 @@ declare module "alt-client" {
public setMeta<V extends any, K extends string = string>(key: K, value: shared.InterfaceValueByKey<ICustomCheckpointMeta, K, V>): void;
}

export class Entity extends shared.WorldObject {
export class Entity extends WorldObject {
/**
* Array with all entities.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

/**
Expand Down Expand Up @@ -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);

/**
Expand Down
24 changes: 19 additions & 5 deletions server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,20 @@ declare module "alt-server" {
public setSyncedMeta<V extends any, K extends string = string>(key: K, value: shared.InterfaceValueByKey<shared.ICustomBaseObjectSyncedMeta, K, V>): 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 */
Expand All @@ -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<string, any>);

Expand Down Expand Up @@ -785,7 +799,7 @@ declare module "alt-server" {
public deleteStreamSyncedMeta<K extends shared.ExtractStringKeys<shared.ICustomVirtualEntityStreamSyncedMeta>>(key: K): void;
}

export class Entity extends shared.WorldObject {
export class Entity extends WorldObject {
/**
* Array with all entities.
*
Expand Down Expand Up @@ -2561,7 +2575,7 @@ declare module "alt-server" {
public hasStreamSyncedMeta<K extends shared.ExtractStringKeys<shared.ICustomVehicleStreamSyncedMeta>>(key: K): boolean;
}

export class Blip extends shared.WorldObject {
export class Blip extends WorldObject {
/**
* Array with all blips.
*
Expand Down Expand Up @@ -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[];

Expand Down Expand Up @@ -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);

/**
Expand Down
14 changes: 0 additions & 14 deletions shared/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit cde6816

Please sign in to comment.