diff --git a/client/index.d.ts b/client/index.d.ts index 60e9ebc5..02ef553f 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -120,6 +120,18 @@ declare module "alt-client" { Justify, } + export enum CookieSameSite { + NoRestriction = "NO_RESTRICTION", + LaxMode = "LAX_MODE", + StrictMode = "STRICT_MODE", + } + + export enum CookiePriority { + Low = "LOW", + Medium = "MEDIUM", + High = "HIGH", + } + export interface IClientEvent { anyResourceError: (resourceName: string) => void; anyResourceStart: (resourceName: string) => void; @@ -207,6 +219,15 @@ declare module "alt-client" { playerStartTalking: (target: Player) => void; playerStopTalking: (target: Player) => void; + + /** + * @remarks This event is only triggered for local player. + */ + playerDimensionChange: (player: Player, oldDimension: number, newDimension: number) => void; + /** + * @remarks This event is only triggered for local player. + */ + playerInteriorChange: (player: Player, oldInterior: number, newInterior: number) => void; } export interface IDiscordUser { @@ -574,6 +595,33 @@ declare module "alt-client" { max: number; } + export interface IWebViewParams { + url: string; + pos?: shared.IVector2; + size?: shared.IVector2; + isOverlay?: boolean; + drawableHash?: number; + targetTexture?: string; + headers?: Record; + cookies?: ICookie[]; + } + + export interface ICookie { + /** + * Cookie name must always start with "__altv_" + */ + name: `__altv_${string}`; + url: string; + value: unknown; + httpOnly?: boolean; + secure?: boolean; + domain?: string; + path?: string; + sameSite?: CookieSameSite; + priority: CookiePriority; + expires: number; + } + export class BaseObject extends shared.BaseObject { /** * Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true). @@ -1918,10 +1966,16 @@ declare module "alt-client" { * Creates a WebView rendered on game object. * * @param url URL of the html file. - * @param propHash Hash of object to render on. - * @param targetTexture Name of object's texture to replace. + * @param drawableHash Hash of drawable to render on. + * @param targetTexture Name of texture to replace. + */ + constructor(url: string, drawableHash: number, targetTexture: string); + + /** + * Creates a WebView depending on params. + * */ - constructor(url: string, propHash: number, targetTexture: string); + constructor(params: IWebViewParams); /** * Emits specified event across particular WebView. @@ -2002,6 +2056,7 @@ declare module "alt-client" { public removeOutput(output: AudioOutput): void; public getOutputs(): readonly (AudioOutput | number)[]; public reload(ignoreCache?: boolean): void; + public setCookie(cookie: ICookie): void; public deleteMeta(key: string): void; public deleteMeta>(key: K): void; diff --git a/client/package.json b/client/package.json index 3679742c..c446c5ba 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@altv/types-client", - "version": "16.1.14", + "version": "16.1.15", "description": "This package contains types definitions for alt:V client-side module.", "types": "index.d.ts", "files": [ diff --git a/server/index.d.ts b/server/index.d.ts index 1662406d..e2af4c41 100644 --- a/server/index.d.ts +++ b/server/index.d.ts @@ -260,7 +260,18 @@ declare module "alt-server" { readonly cloudAuthResult: CloudAuthResult; readonly id: number; readonly isAccepted: boolean; + readonly hwid3: string; + /** + * Set text for (potential) player in queue. + * + * @example + * ```js + * alt.on("connectionQueueAdd", (connection) => { + * connection.text = "Your position in queue: 3"; + * }) + * ``` + */ text: string; /** @@ -327,7 +338,7 @@ declare module "alt-server" { vehicleAttach: (vehicle: Vehicle, attachedVehicle: Vehicle) => void; vehicleDestroy: (vehicle: Vehicle) => void; vehicleDetach: (vehicle: Vehicle, detachedVehicle: Vehicle) => void; - weaponDamage: (source: Player, target: Entity, weaponHash: number, damage: number, offset: shared.Vector3, bodyPart: shared.BodyPart) => number | boolean | void; + weaponDamage: (source: Player, target: Entity, weaponHash: number, damage: number, offset: shared.Vector3, bodyPart: shared.BodyPart, sourceEntity: Entity) => number | boolean | void; startFire: (player: Player, fires: IFireInfo[]) => boolean | void; startProjectile: (player: Player, pos: shared.Vector3, dir: shared.Vector3, ammoHash: number, weaponHash: number) => boolean | void; playerWeaponChange: (player: Player, oldWeapon: number, weapon: number) => void; @@ -491,6 +502,7 @@ declare module "alt-server" { readonly skillAbove50MaxAmmoMp: number; readonly maxSkillMaxAmmoMp: number; readonly bonusMaxAmmoMp: number; + readonly damageType: string; } export interface IAmmoFlags { @@ -1060,6 +1072,8 @@ declare module "alt-server" { public readonly isInMelee: boolean; public readonly isInCover: boolean; public readonly isParachuting: boolean; + public readonly isOnVehicle: boolean; + public readonly isInWater: boolean; /** * Position the player is currently aiming at. @@ -1091,6 +1105,7 @@ declare module "alt-server" { public readonly isSpawned: boolean; public readonly socialID: string; public readonly socialClubName: string; + public readonly hwid3: string; public readonly hwidHash: string; public readonly hwidExHash: string; public readonly authToken: string; @@ -2319,6 +2334,98 @@ declare module "alt-server" { * @param wheelId The variation id of the wheel. */ public setWheels(wheelType: number, wheelId: number): void; + + /** + * Gets the camber angle of the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelCamber(wheelIndex: number): number; + + /** + * Sets the camber angle of the specified wheel. + * + * @remarks A positive camber angle means that the top of the wheel is farther out than the bottom. A negative camber angle means that the bottom of the wheel is farther out than the top. + * + * @param wheelIndex The index of the wheel. + * @param camber The value the of camber angle. + */ + public setWheelCamber(wheelIndex: number, camber: number): void; + + /** + * Gets the track width of the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelTrackWidth(wheelIndex: number): number; + + /** + * Sets the track width of the specified wheel. + * + * @param wheelIndex The index of the wheel. + * @param width The value of the track width. + */ + public setWheelTrackWidth(wheelIndex: number, width: number): void; + + /** + * Gets the height of the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelHeight(wheelIndex: number): number; + + /** + * Sets the height of the specified wheel. + * + * @param wheelIndex The index of the wheel. + * @param height The value of the wheel height. + */ + public setWheelHeight(wheelIndex: number, height: number): void; + + /** + * Gets the tyre radius of the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelTyreRadius(wheelIndex: number): number; + + /** + * @remarks Applies only physical effects to the wheel. + * + * @param wheelIndex The index of the wheel. + * @param radius The value of the tyre radius. + */ + public setWheelTyreRadius(wheelIndex: number, radius: number): void; + + /** + * Gets the rim radius of the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelRimRadius(wheelIndex: number): number; + + /** + * @remarks Does not show any visible effect. + * + * @param wheelIndex The index of the wheel. + * @param radius The index of the rim radius. + */ + public setWheelRimRadius(wheelIndex: number, radius: number): void; + + /** + * Gets the tyre width the specified wheel. + * + * @param wheelIndex The index of the wheel. + */ + public getWheelTyreWidth(wheelIndex: number): number; + + /** + * @remarks Does not show any visible effect. + * + * @param wheelIndex The index of the wheel. + * @param width The value of the tyre width. + */ + public setWheelTyreWidth(wheelIndex: number, width: number): void; /** * Sets if a specific window is damaged. * diff --git a/server/package.json b/server/package.json index a24cc31c..403d5034 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@altv/types-server", - "version": "16.1.8", + "version": "16.1.9", "description": "This package contains types definitions for alt:V server-side module.", "types": "index.d.ts", "files": [