@gta5urban/types-server 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +68 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1893,6 +1893,67 @@ declare interface SyncMp {
|
|
|
1893
1893
|
rate: number;
|
|
1894
1894
|
}
|
|
1895
1895
|
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* CommandsMp interfaces
|
|
1899
|
+
*/
|
|
1900
|
+
|
|
1901
|
+
declare interface CommandsMpInterface {
|
|
1902
|
+
name: string;
|
|
1903
|
+
aliases?: string[];
|
|
1904
|
+
args?: CommandsMpArgs[];
|
|
1905
|
+
adminLevel?: number;
|
|
1906
|
+
cooldown?: number;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
declare type CommandsMpArgType = {
|
|
1910
|
+
string: string;
|
|
1911
|
+
number: number;
|
|
1912
|
+
player: PlayerMp;
|
|
1913
|
+
};
|
|
1914
|
+
|
|
1915
|
+
declare interface CommandsMpArgDefinition<K extends keyof CommandsMpArgType = keyof CommandsMpArgType> {
|
|
1916
|
+
name: string;
|
|
1917
|
+
type: K;
|
|
1918
|
+
optional?: boolean;
|
|
1919
|
+
rest?: boolean;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
declare interface CommandsMpOptions<
|
|
1923
|
+
T extends readonly CommandsMpArgDefinition[] = readonly CommandsMpArgDefinition[]
|
|
1924
|
+
> {
|
|
1925
|
+
name: string;
|
|
1926
|
+
aliases?: string[];
|
|
1927
|
+
args?: T;
|
|
1928
|
+
adminLevel?: number;
|
|
1929
|
+
cooldown?: number;
|
|
1930
|
+
|
|
1931
|
+
execute: (
|
|
1932
|
+
player: PlayerMp,
|
|
1933
|
+
args: {
|
|
1934
|
+
[P in T[number] as P["name"]]: CommandsMpArgType[P["type"]];
|
|
1935
|
+
}
|
|
1936
|
+
) => void;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
declare interface CommandsMpArgs<K extends keyof CommandsMpArgType = keyof CommandsMpArgType> {
|
|
1940
|
+
name: string;
|
|
1941
|
+
type: K;
|
|
1942
|
+
optional?: boolean;
|
|
1943
|
+
rest?: boolean;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
declare interface CommandsMpInternal<T extends CommandsMpArgs[] = CommandsMpArgs[]> extends CommandsMpOptions<T> {
|
|
1947
|
+
lastUse: Map<number, number>;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
declare interface CommandsMp {
|
|
1951
|
+
add: <T extends CommandsMpArgs[]>(command: CommandsMpOptions<T>) => void;
|
|
1952
|
+
execute: (player: PlayerMp, raw: string) => void;
|
|
1953
|
+
commands: Map<string, CommandsMpInternal>;
|
|
1954
|
+
getCommands: (player: PlayerMp) => CommandsMpInterface[];
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1896
1957
|
declare interface Mp {
|
|
1897
1958
|
Player: typeof PlayerMp;
|
|
1898
1959
|
players: PlayerMpPool;
|
|
@@ -1934,7 +1995,13 @@ declare interface Mp {
|
|
|
1934
1995
|
joaat(str: string): number;
|
|
1935
1996
|
joaat(strs: string[]): number[];
|
|
1936
1997
|
|
|
1937
|
-
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* custom command entities
|
|
2001
|
+
*/
|
|
2002
|
+
|
|
2003
|
+
commands: CommandsMp;
|
|
2004
|
+
|
|
1938
2005
|
}
|
|
1939
2006
|
|
|
1940
2007
|
declare const mp: Mp;
|