@altv/types-client
Advanced tools
Comparing version 1.1.1 to 1.2.1
250
index.d.ts
declare module "alt-client" { | ||
type StatName = "stamina" | "strength" | "lung_capacity" | "wheelie_ability" | "flying_ability" | "shooting_ability" | "stealth_ability"; | ||
export const enum Locale { | ||
Arabic = "ar", | ||
Belarusian = "by", | ||
Czech = "cz", | ||
German = "de", | ||
English = "en", | ||
Spanish = "es", | ||
Farsi = "fa", | ||
French = "fr", | ||
Hebrew = "he", | ||
Hungarian = "hu", | ||
Indonesian = "id", | ||
Hindi = "in_hd", // Wrong tag (hi_in) | ||
Malayalam = "in_ml", // Wrong tag (ml_in) | ||
Telugu = "in_tl", // Wrong tag (te_in) | ||
Tamil = "in_tm", // Wrong tag (ta_in) | ||
Italian = "it", | ||
Lithuanian = "lt", | ||
Latvian = "lv", | ||
NorwegianBokmal = "nb_no", | ||
NorwegianNynorsk = "nn_no", | ||
Polish = "pl", | ||
Portugese = "pt", | ||
BrazilianPortuguese = "pt_br", | ||
Romanian = "ro", | ||
Serbian = "rs", // Wrong tag (sr) | ||
Russian = "ru", | ||
Slovak = "sk", | ||
Thai = "th", | ||
Turkish = "tr", | ||
Ukrainian = "ua", // Wrong tag (uk) | ||
ChineseSimplified = "zh_cn", | ||
ChineseTraditional = "zh_tw" | ||
} | ||
export const enum StatName { | ||
Stamina = "stamina", | ||
Strength = "strength", | ||
LungCapacity = "lung_capacity", | ||
Wheelie = "wheelie_ability", | ||
Flying = "flying_ability", | ||
Shooting = "shooting_ability", | ||
Stealth = "stealth_ability" | ||
} | ||
export const enum FileEncoding { | ||
Utf8 = "utf-8", | ||
Utf16 = "utf-16", | ||
Binary = "binary" | ||
} | ||
export const enum BaseObjectType { | ||
Player, | ||
Vehicle, | ||
Blip, | ||
WebView, | ||
VoiceChannel, | ||
Colshape, | ||
Checkpoint | ||
} | ||
export interface IClientEvent { | ||
anyResourceError: (resourceName: string) => void; | ||
anyResourceStart: (resourceName: string) => void; | ||
anyResourceStop: (resourceName: string) => void; | ||
connectionComplete: () => void; | ||
consoleCommand: (name: string, ...args: string[]) => void; | ||
disconnect: () => void; | ||
gameEntityCreate: (entity: Entity) => void; | ||
gameEntityDestroy: (entity: Entity) => void; | ||
keyDown: (key: number) => void; | ||
keyUp: (key: number) => void; | ||
removeEntity: (object: BaseObject) => void; | ||
resourceStart: (errored: boolean) => void; | ||
resourceStop: () => void; | ||
syncedMetaChange: (entity: Entity, key: string, value: any, oldValue: any) => void; | ||
streamSyncedMetaChange: (entity: Entity, key: string, value: any, oldValue: any) => void; | ||
globalMetaChange: (key: string, value: any, oldValue: any) => void; | ||
globalSyncedMetaChange: (key: string, value: any, oldValue: any) => void; | ||
/** | ||
* No particular usage for now, stick to {@link everyTick} instead. | ||
*/ | ||
render: () => void; | ||
} | ||
export interface IDiscordOAuth2Token { | ||
@@ -68,3 +151,3 @@ readonly token: string | ||
*/ | ||
public readonly type: number; | ||
public readonly type: BaseObjectType; | ||
@@ -375,3 +458,3 @@ /** | ||
public brakeBiasRear: number; | ||
public breakForce: number; | ||
public brakeForce: number; | ||
public camberStiffnesss: number; | ||
@@ -437,3 +520,3 @@ public centreOfMassOffset: Vector3; | ||
public static getForModel(handlingHash: number): HandlingData; | ||
public static getForHandlingName(handlingHash: number): HandlingData; | ||
} | ||
@@ -521,3 +604,3 @@ | ||
*/ | ||
public static read(filename: string, encoding?: "utf-8" | "utf-16"): string; | ||
public static read(filename: string, encoding?: FileEncoding.Utf8 | FileEncoding.Utf16): string; | ||
@@ -530,3 +613,3 @@ /** | ||
*/ | ||
public static read(filename: string, encoding: "binary"): ArrayBuffer; | ||
public static read(filename: string, encoding: FileEncoding.Binary): ArrayBuffer; | ||
} | ||
@@ -678,3 +761,3 @@ | ||
/** | ||
* Sandbox mode | ||
* Sandbox mode. | ||
* | ||
@@ -686,2 +769,9 @@ * @returns True when alt:V client is launched in sandbox mode. | ||
/** | ||
* Streamer mode. | ||
* | ||
* @returns True when alt:V client is launched in streamer mode. | ||
*/ | ||
export function isInStreamerMode(): boolean; | ||
/** | ||
* Returns state of user interface and console window. | ||
@@ -696,3 +786,3 @@ * | ||
/** | ||
* @ignore Should not be used until fixed | ||
* @ignore Should not be used until fixed. | ||
*/ | ||
@@ -702,3 +792,3 @@ export function loadModel(modelHash: number): void; | ||
/** | ||
* @ignore Should not be used until fixed | ||
* @ignore Should not be used until fixed. | ||
*/ | ||
@@ -745,3 +835,3 @@ export function loadModelAsync(modelHash: number): void; | ||
*/ | ||
export function on(eventName: string, listener: (...args: any[]) => void): void; | ||
export function on<K extends keyof IClientEvent>(eventName: K, listener: IClientEvent[K]): void; | ||
@@ -754,3 +844,3 @@ /** | ||
*/ | ||
export function on(eventName: "anyResourceError", listener: (resourceName: string) => void): void; | ||
export function on<S extends string>(event: Exclude<S, keyof IClientEvent>, listener: (...args: any[]) => void): void; | ||
@@ -763,130 +853,2 @@ /** | ||
*/ | ||
export function on(eventName: "anyResourceStart", listener: (resourceName: string) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "anyResourceStop", listener: (resourceName: string) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "connectionComplete", listener: () => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "consoleCommand", listener: (name: string, ...args: string[]) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "disconnect", listener: () => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "gameEntityCreate", listener: (entity: Entity) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "gameEntityDestroy", listener: (entity: Entity) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "keydown", listener: (key: number) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "keyup", listener: (key: number) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "removeEntity", listener: (object: BaseObject) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "resourceStart", listener: (errored: boolean) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "resourceStop", listener: () => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "syncedMetaChange", listener: (entity: Entity, key: string, value: any, oldValue: any) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "streamSyncedMetaChange", listener: (entity: Entity, key: string, value: any, oldValue: any) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "globalMetaChange", listener: (key: string, value: any, oldValue: any) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function on(eventName: "globalSyncedMetaChange", listener: (key: string, value: any, oldValue: any) => void): void; | ||
/** | ||
* Subscribes to client event handler with specified listener. | ||
* | ||
* @param eventName Name of the event. | ||
* @param listener Listener that should be added. | ||
*/ | ||
export function onServer(eventName: string, listener: (...args: any[]) => void): void; | ||
@@ -903,9 +865,15 @@ | ||
* | ||
* @remarks Only available in sandbox mode. | ||
* @param stem Filename without extension. | ||
* @return Return is dependent on the success of the operation. | ||
*/ | ||
export function saveScreenshot(stem: string): boolean; | ||
export function takeScreenshot(stem: string): Promise<boolean>; | ||
/** | ||
* Output is returned as string. | ||
* | ||
* @return Return is dependent on the success of the operation. | ||
*/ | ||
export function takeScreenshotBase64(): Promise<string>; | ||
/** | ||
* Resets a statistic to its default value. | ||
@@ -912,0 +880,0 @@ * |
{ | ||
"name": "@altv/types-client", | ||
"version": "1.1.1", | ||
"version": "1.2.1", | ||
"description": "This package contains types definitions for alt:V client-side module.", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27355
765