Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update master branch #332

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ declare module "alt-client" {
* Useful when damage in weapon meta is set to 0, and is calculated manually by script in event.
*/
ForceVehicleTyreBurst = "FORCE_VEHICLE_TYRE_BURST",
/**
* Prevents head props from being hidden when getting into the vehicle.
* Equivalent to calling `setPedResetFlag` native with flag 337 in every tick.
*/
SwapAllowHeadPropInVehicleFlag = "SWAP_ALLOW_HEAD_PROP_IN_VEHICLE_FLAG",
}

/** @deprecated This method will be removed in the next major release. (v17) */
Expand Down Expand Up @@ -561,6 +566,14 @@ declare module "alt-client" {
readonly propertyUpdateTicks: number[][];
}

/**
* Axis-Aligned Bounding Box.
*/
export interface IAABB {
min: number;
max: number;
}

export class BaseObject extends shared.BaseObject {
/**
* Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true).
Expand Down Expand Up @@ -4564,5 +4577,84 @@ declare module "alt-client" {
public static register(path: string): Font;
}

export class Interior {
protected constructor();

/**
* Create interior instance by id. Throws if id is invalid (for example, when it's 0).
*
* @example
* ```js
* // Get the interior where our local player is currently in
* const interiorId = natives.getInteriorFromEntity(alt.Player.local);
* if (interiorId !== 0) {
* const interior = alt.Interior.getForInteriorID(interiorId);
*
* // Output room count of it
* alt.log({
* roomCount: interior.roomCount
* });
* } else {
* alt.logError("Interior id is 0, seems like player is outside");
* }
* ```
*/
public static getForInteriorID(id: number): Interior;

public readonly id: number;
public readonly pos: shared.Vector3;
public readonly rot: shared.Vector3;
public readonly roomCount: number;
public readonly portalCount: number;
public readonly entitiesExtents: IAABB;

/**
* Get room by it's hash. Throws if room hash is invalid.
*/
public getRoomByHash(hash: number): InteriorRoom;

/**
* Get room by it's index: from 0 to {@link roomCount}, for example if `roomCount = 2`, room indexes will be 0 and 1.
* Throws if room index is invalid.
*/
public getRoomByIndex(index: number): InteriorRoom;

/**
* Get portal by it's index: from 0 to {@link portalCount}, for example if `portalCount = 2`, portal indexes will be 0 and 1.
* Throws if portal index is invalid.
*/
public getPortalByIndex(index: number): InteriorPortal;
}

export class InteriorRoom {
protected constructor();

public readonly index: number;
public readonly name: string;
public readonly nameHash: number;
public flag: number;
public timecycle: number;
public extents: IAABB;
}

export class InteriorPortal {
protected constructor();

public readonly index: number;
public readonly cornerCount: number;
public readonly entityCount: number;
public roomFrom: number;
public roomTo: number;
public flag: number;

public getCornerPos(cornerIndex: number): shared.Vector3;
public setCornerPos(cornerIndex: number, value: shared.Vector3): void;
public getEntityArchetype(entityIndex: number): number;
public getEntityFlag(entityIndex: number): number;
public setEntityFlag(entityIndex: number, flag: number): void;
public getEntityPos(entityIndex: number): shared.Vector3;
public getEntityRot(entityIndex: number): shared.Vector3;
}

export * from "alt-shared";
}
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@altv/types-client",
"version": "16.0.17",
"version": "16.0.19",
"description": "This package contains types definitions for alt:V client-side module.",
"types": "index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@altv/types-server",
"version": "16.0.11",
"version": "16.0.12",
"description": "This package contains types definitions for alt:V server-side module.",
"types": "index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@altv/types-shared",
"version": "16.0.3",
"version": "16.0.4",
"description": "This package contains types definitions for alt:V JS module shared types.",
"types": "index.d.ts",
"files": [
Expand Down
Loading