changed types and added utils/sw
This commit is contained in:
1
ts-lua/README
Normal file
1
ts-lua/README
Normal file
@@ -0,0 +1 @@
|
|||||||
|
wstring will not be added for now, and the only mention of it is in the discord where kektram mentions a bug that never got fixed so it's not worth it until i finish everything else (https://canary.discord.com/channels/701762303024169027/701762305012006921/846484799064899614)
|
||||||
44
ts-lua/types/2take1.d.ts
vendored
44
ts-lua/types/2take1.d.ts
vendored
@@ -2,25 +2,29 @@
|
|||||||
* Menu Functions
|
* Menu Functions
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
declare namespace type2take1 {
|
|
||||||
type Player = number;
|
|
||||||
type Entity = number;
|
|
||||||
type Ped = number;
|
|
||||||
type Vehicle = number;
|
|
||||||
type Group = number;
|
|
||||||
type Hash = number;
|
|
||||||
type Ptfx = number;
|
|
||||||
type Any = number;
|
|
||||||
type Thread = number;
|
|
||||||
|
|
||||||
type Feature = number;
|
type Player = number;
|
||||||
|
type Entity = number;
|
||||||
|
type Ped = number;
|
||||||
|
type Vehicle = number;
|
||||||
|
type Group = number;
|
||||||
|
type Hash = number;
|
||||||
|
type Ptfx = number;
|
||||||
|
type Any = number;
|
||||||
|
type Thread = number;
|
||||||
|
|
||||||
type vector<T> = object;
|
type Feature = number;
|
||||||
type table<T> = vector<T>;
|
|
||||||
type uint8_t = number;
|
// C++ Types
|
||||||
type uint32_t = number;
|
|
||||||
type uint64_t = number;
|
type vector<T> = object;
|
||||||
type integer = number;
|
type uint8_t = number;
|
||||||
type int = number;
|
type uint32_t = number;
|
||||||
type float = number;
|
type uint64_t = number;
|
||||||
}
|
type integer = number;
|
||||||
|
type int = number;
|
||||||
|
type float = number;
|
||||||
|
//type wstring = string;
|
||||||
|
|
||||||
|
// lua C++ adjacent types
|
||||||
|
type table<T> = vector<T>;
|
||||||
16
ts-lua/types/Menu.d.ts
vendored
16
ts-lua/types/Menu.d.ts
vendored
@@ -8,27 +8,27 @@ declare namespace menu {
|
|||||||
|
|
||||||
type featureTypes = "parent"|"toggle"|"action"|"value_i"|"action_value_i"|"autoaction_value_i";
|
type featureTypes = "parent"|"toggle"|"action"|"value_i"|"action_value_i"|"autoaction_value_i";
|
||||||
|
|
||||||
export function add_feature(name: string, type: featureTypes, parent: type2take1.Feature, script_handler: (feat: Feat) => void): Feat;
|
export function add_feature(name: string, type: featureTypes, parent: Feature, script_handler: (feat: Feat) => void): Feat;
|
||||||
|
|
||||||
export function delete_feature(id: type2take1.int): boolean;
|
export function delete_feature(id: int): boolean;
|
||||||
|
|
||||||
export function set_menu_can_navigate(): void;
|
export function set_menu_can_navigate(): void;
|
||||||
|
|
||||||
export function get_version(): void;
|
export function get_version(): void;
|
||||||
|
|
||||||
export function add_player_feature(name: string, type: string, parent: type2take1.integer, script_handler: (feat: Feat) => void): PlayerFeat
|
export function add_player_feature(name: string, type: string, parent: integer, script_handler: (feat: Feat) => void): PlayerFeat
|
||||||
|
|
||||||
export function get_player_feature(i: type2take1.uint32_t): PlayerFeat
|
export function get_player_feature(i: uint32_t): PlayerFeat
|
||||||
|
|
||||||
export function is_threading_mode(mode: type2take1.int): boolean
|
export function is_threading_mode(mode: int): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @privateRemarks callback declaration may be wrong
|
* @privateRemarks callback declaration may be wrong
|
||||||
*/
|
*/
|
||||||
export function create_thread(callback: () => void, context: any): type2take1.Thread
|
export function create_thread(callback: () => void, context: any): Thread
|
||||||
|
|
||||||
export function has_thread_finished(id: type2take1.Thread): boolean
|
export function has_thread_finished(id: Thread): boolean
|
||||||
|
|
||||||
export function delete_thread(id: type2take1.Thread): boolean
|
export function delete_thread(id: Thread): boolean
|
||||||
|
|
||||||
}
|
}
|
||||||
28
ts-lua/types/RAGE/ScriptDraw.d.ts
vendored
28
ts-lua/types/RAGE/ScriptDraw.d.ts
vendored
@@ -4,20 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
declare namespace scriptdraw {
|
declare namespace scriptdraw {
|
||||||
|
|
||||||
//void draw_text(string text, v2 pos, v2 size, float scale, uint32_t color, uint32_t flags)
|
function draw_text(text: string, pos: v2, size: v2, scale: float, color: uint32_t, flags: uint32_t): void;
|
||||||
//void wdraw_text(wstring text, v2 pos, v2 size, float scale, uint32_t color, uint32_t flags)
|
//function wdraw_text(text: wstring, pos: v2, size: v2, scale: float, color: uint32_t, flags: uint32_t): void;
|
||||||
//uint32_t register_sprite(string path)
|
function register_sprite(path: string): uint32_t;
|
||||||
//void draw_sprite(uint32_t id, v2 pos, float scale, float rot, uint32_t color)
|
function draw_sprite(id: uint32_t, pos: v2, scale: float, rot: float, color: uint32_t): void;
|
||||||
//void draw_line(v2 start, v2 end, uint32_t size, uint32_t color)
|
function draw_line(start: v2, end: v2, size: uint32_t, color: uint32_t): void;
|
||||||
//void draw_rect(v2 pos, v2 size, uint32_t color)
|
function draw_rect(pos: v2, size: v2, color: uint32_t): void;
|
||||||
//float pos_pixel_to_rel_x(float in)
|
function pos_pixel_to_rel_x(input: float): float;
|
||||||
//float pos_pixel_to_rel_y(float in)
|
function pos_pixel_to_rel_y(input: float): float;
|
||||||
//float pos_rel_to_pixel_x(float in)
|
function pos_rel_to_pixel_x(input: float): float;
|
||||||
//float pos_rel_to_pixel_y(float in)
|
function pos_rel_to_pixel_y(input: float): float;
|
||||||
//float size_pixel_to_rel_x(float in)
|
function size_pixel_to_rel_x(input: float): float;
|
||||||
//float size_pixel_to_rel_y(float in)
|
function size_pixel_to_rel_y(input: float): float;
|
||||||
//float size_rel_to_pixel_x(float in)
|
function size_rel_to_pixel_x(input: float): float;
|
||||||
//float size_rel_to_pixel_y(float in)
|
function size_rel_to_pixel_y(input: float): float;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
ts-lua/types/RAGE/Utils.d.ts
vendored
16
ts-lua/types/RAGE/Utils.d.ts
vendored
@@ -4,7 +4,21 @@
|
|||||||
*/
|
*/
|
||||||
declare namespace utils {
|
declare namespace utils {
|
||||||
|
|
||||||
|
function str_to_vk(keyName: string): int
|
||||||
|
//function string_to_wstring(str: string): wstring
|
||||||
|
//function wstring_to_string(str: wstring): string
|
||||||
|
function get_all_files_in_directory(path: string, extension: string): vector<string>
|
||||||
|
function get_all_sub_directories_in_directory(path: string): vector<string>
|
||||||
|
function file_exists(path: string): boolean
|
||||||
|
function dir_exists(path: string): boolean
|
||||||
|
function make_dir(path: string): boolean
|
||||||
|
function get_appdata_path(dir: string, file: string): string
|
||||||
|
function from_clipboard(): string
|
||||||
|
function to_clipboard(str: string): void
|
||||||
|
function time(): int
|
||||||
|
function time_ms(): int
|
||||||
|
function str_to_vecu64(str: string): vector<uint64_t>
|
||||||
|
function vecu64_to_str(vec: vector<uint64_t>): string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
ts-lua/types/structs/Feat.d.ts
vendored
16
ts-lua/types/structs/Feat.d.ts
vendored
@@ -44,26 +44,26 @@ declare class Feat {
|
|||||||
/**
|
/**
|
||||||
* value for integer features
|
* value for integer features
|
||||||
*/
|
*/
|
||||||
public get value_i(): type2take1.integer;
|
public get value_i(): integer;
|
||||||
public set value_i(value_i: type2take1.integer);
|
public set value_i(value_i: integer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* min value
|
* min value
|
||||||
*/
|
*/
|
||||||
public get min_1(): type2take1.integer;
|
public get min_1(): integer;
|
||||||
public set min_1(min_1: type2take1.integer);
|
public set min_1(min_1: integer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* max value
|
* max value
|
||||||
*/
|
*/
|
||||||
public get max_i(): type2take1.integer;
|
public get max_i(): integer;
|
||||||
public set max_i(max_i: type2take1.integer);
|
public set max_i(max_i: integer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* step size
|
* step size
|
||||||
*/
|
*/
|
||||||
public get mod_i(): type2take1.integer;
|
public get mod_i(): integer;
|
||||||
public set mod_i(mod_i: type2take1.integer);
|
public set mod_i(mod_i: integer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deprecated
|
* deprecated
|
||||||
|
|||||||
4
ts-lua/types/structs/MenuKey.d.ts
vendored
4
ts-lua/types/structs/MenuKey.d.ts
vendored
@@ -7,9 +7,9 @@ declare class MenuKey {
|
|||||||
/**
|
/**
|
||||||
* vector of virtual keys
|
* vector of virtual keys
|
||||||
*/
|
*/
|
||||||
readonly keys: type2take1.table<type2take1.uint32_t>;
|
readonly keys: table<uint32_t>;
|
||||||
|
|
||||||
public push_vk(virtualKeyCode: type2take1.uint32_t): void;
|
public push_vk(virtualKeyCode: uint32_t): void;
|
||||||
|
|
||||||
public push_str(key: string): boolean;
|
public push_str(key: string): boolean;
|
||||||
|
|
||||||
|
|||||||
2
ts-lua/types/structs/RegexResult.d.ts
vendored
2
ts-lua/types/structs/RegexResult.d.ts
vendored
@@ -30,7 +30,7 @@ declare class RegexResult {
|
|||||||
*/
|
*/
|
||||||
constructor(type: "debug");
|
constructor(type: "debug");
|
||||||
|
|
||||||
readonly count: type2take1.integer;
|
readonly count: integer;
|
||||||
|
|
||||||
readonly matches: string[];
|
readonly matches: string[];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user