Skip to content

Commit

Permalink
chore: Bump version (#340)
Browse files Browse the repository at this point in the history
* 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

* chore(webview, client): Bump version

* fix(webview): Formatting

* 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

* chore: improve getClosestEntities description (#310)

* 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)

* chore: Bump version

* feat(client): Add reloadVehiclePhysics

* chore(client)!: Deprecate setWatermarkPosition and it's enum

* chore: Bump version

* chore(server): add some descriptions of voice channel properties (#318)

* 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

* chore: Bump version

* chore: update math snippet (#320)

* chore: remove outdated workers article (#323)

* feat: add multiple metadata setters (#322)

* chore(shared): fix angleTo return type of vector2 (#324)

* 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 (#327)

* feat(server): Vehicle wheel API (#336)

* feat(client): new WebView API (#335)

* feat(client): new WebView API

* fix(client): new WebView API

* feat(client|server): various new APIs (#337)

* chore: Bump version

* feat(server): add sourceEntity to weaponDamage event (#334)

---------

Co-authored-by: xLuxy <[email protected]>
Co-authored-by: WelaurS <[email protected]>
Co-authored-by: DevPanda <[email protected]>
Co-authored-by: Dav-Renz <[email protected]>
Co-authored-by: S0P4 <[email protected]>
  • Loading branch information
6 people authored Jan 29, 2025
1 parent ad33040 commit 76b1e5a
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 6 deletions.
61 changes: 58 additions & 3 deletions client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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<string, string>;
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).
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<K extends shared.ExtractStringKeys<ICustomWebViewMeta>>(key: K): void;
Expand Down
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.1.14",
"version": "16.1.15",
"description": "This package contains types definitions for alt:V client-side module.",
"types": "index.d.ts",
"files": [
Expand Down
109 changes: 108 additions & 1 deletion server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -491,6 +502,7 @@ declare module "alt-server" {
readonly skillAbove50MaxAmmoMp: number;
readonly maxSkillMaxAmmoMp: number;
readonly bonusMaxAmmoMp: number;
readonly damageType: string;
}

export interface IAmmoFlags {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
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.1.8",
"version": "16.1.9",
"description": "This package contains types definitions for alt:V server-side module.",
"types": "index.d.ts",
"files": [
Expand Down

0 comments on commit 76b1e5a

Please sign in to comment.