From c2c639d5562475135ee2388cf37646fc34ffd670 Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:59:20 +0300 Subject: [PATCH] chore: Bump version (#331) * feat(client): type safety for useStreaming (#298) adds second overload for constructors with `useStreaming` and `streamingDistance` so it is impossible to use `useStreaming` alone (leading to unwanted behavior) * fix(client): typos (#297) * feat(client): type safety for useStreaming (#298) adds second overload for constructors with `useStreaming` and `streamingDistance` so it is impossible to use `useStreaming` alone (leading to unwanted behavior) * fix(client): typos (#297) * feat(webview): Add getPermissionState typing * feat(webview): Add getPermissionState typing * chore(webview, client): Bump version * chore(webview, client): Bump version * fix(webview): Formatting * fix(webview): Formatting * chore(webview, client): Bump version * chore(webview, client): Bump version * fix(shared): Added required first argument to alt.log methods (#299) * ci(shared): Bump version * fix(server): virtual entity description (#306) * chore: update imports in examples (#303) * chore: remove outdated event beforePlayerConnect (#304) * chore: add package.json to first resource article (#302) * feat: add server debugging article (#309) * chore: add more descriptions for virtual entity API (#307) * chore: edit text labels to avoid confusion with 15.0 text labels (#305) * feat(client): add alt.Object.streamedIn (#312) * chore(client): Bump version * feat(client): add alt.Object.streamedIn (#312) * chore(client): Bump version * chore: improve getClosestEntities description (#310) * chore: improve getClosestEntities description (#310) * chore(server): Bump version * chore(server): Bump version * fix(client): add missing Ped.getByRemoteID (#314) * fix(client, server): fix and improve RPC docs (#315) * Update requirements list (#317) * Fixed wrong name in event docs (#316) * fix(client): add missing Ped.getByRemoteID (#314) * fix(client, server): fix and improve RPC docs (#315) * Update requirements list (#317) * Fixed wrong name in event docs (#316) * chore: Bump version * feat(client): Add reloadVehiclePhysics * chore(client)!: Deprecate setWatermarkPosition and it's enum * chore(client)!: Deprecate setWatermarkPosition and it's enum * chore: Bump version * chore: Bump version * chore(server): add some descriptions of voice channel properties (#318) * chore(server): add some descriptions of voice channel properties (#318) * chore: Bump version * chore: Bump version * fix(natives): Fix nullable string parameters * fix(natives): Fix nullable string return type * chore: Bump version * fix(natives): Fix nullable string parameters * fix(natives): Fix nullable string return type * chore: Bump version * feat(client, server, shared): switch to normal enums (#319) * chore: Bump version * feat(client): Add new methods * feat(client): Add new methods * chore: Bump version * chore: Bump version * chore: Bump version * chore: update math snippet (#320) * feat(client, server, shared): switch to normal enums (#319) * chore: Bump version * Merge 'dev' into 'rc' * chore: Bump version * chore: remove outdated workers article (#323) * feat: add multiple metadata setters (#322) * chore(shared): fix angleTo return type of vector2 (#324) * chore: remove outdated workers article (#323) * feat: add multiple metadata setters (#322) * chore(shared): fix angleTo return type of vector2 (#324) * chore: Bump version * chore: Bump version * feat(client): Interior API (#325) * feat(client): Interior API * chore(client): add description for getForInteriorID * chore(client): add example * fix(client): typo * fix(client): InteriorRoom and InteriorPortal don't have public constructors (#326) * feat(client): add config flag SWAP_ALLOW_HEAD_PROP_IN_VEHICLE_FLAG (#333) * chore: Bump version --------- Co-authored-by: xLuxy <67131061+xLuxy@users.noreply.github.com> Co-authored-by: WelaurS Co-authored-by: DevPanda <49129501+devpanda0@users.noreply.github.com> Co-authored-by: Dav-Renz <62567929+Dav-Renz@users.noreply.github.com> Co-authored-by: S0P4 --- client/index.d.ts | 92 +++++++++++++++++++++++++++++++++++++++++++++ client/package.json | 2 +- 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/client/index.d.ts b/client/index.d.ts index 9f877e55..60e9ebc5 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -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) */ @@ -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). @@ -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"; } diff --git a/client/package.json b/client/package.json index 0c142642..20660d67 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@altv/types-client", - "version": "16.2.7", + "version": "16.2.8", "description": "This package contains types definitions for alt:V client-side module.", "types": "index.d.ts", "files": [