-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
107 lines (95 loc) · 7.91 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/// <reference types="@typescript-to-lua/language-extensions" />
/**
* Emits a Lua goto statement (requires Lua 5.2+ or JIT target).
* @param label - The label name to jump to.
* @emits `goto label`
*/
declare function __goto(this: void, label: string): void;
/**
* Inlines the body of the function in-place (useful in hot-path for high-performance code).
* @param body - The function to inline (must be within chunk's scope).
* @emits `body`
* @remarks
* This is currently experimental.
*/
declare function __inline(this: void, body: ((this: void) => void)): void;
declare function __inline<T>(this: void, body: ((this: void, arg: T) => void), arg: T): void;
declare function __inline<T1, T2>(this: void, body: ((this: void, arg1: T1, arg2: T2) => void), arg1: T1, arg2: T2): void;
declare function __inline<T1, T2, T3>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3) => void), arg1: T1, arg2: T2, arg3: T3): void;
declare function __inline<T1, T2, T3, T4>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4): void;
declare function __inline<T1, T2, T3, T4, T5>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): void;
declare function __inline<T1, T2, T3, T4, T5, T6>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14, arg15: T15) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14, arg15: T15): void;
declare function __inline<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this: void, body: ((this: void, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14, arg15: T15, arg16: T16) => void), arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14, arg15: T15, arg16: T16): void;
/**
* Emits a Lua label statement (requires Lua 5.2+ or JIT target).
* @param label - The label name to define.
* @emits `::label::`
*/
declare function __label(this: void, label: string): void;
/**
* Emits a class method iterator. Use in conjunction with for-of loop.
* @typeParam TClass - The class to iterate.
* @emits `next, TClass.prototype` (skipping non-functions, metamethods and constructor)
*/
declare function __methodsof<TClass extends AnyNotNil>(this: void): LuaIterable<LuaMultiReturn<[string, ((this: void, ...args: any[]) => any)]>>;
/**
* Emits a Lua next iterator. Use in conjunction with for-of loop.
* @param t - The table to iterate.
* @emits `next, t, index`
*/
declare function __next<TKey extends AnyNotNil, TValue>(this: void, t: LuaTable<TKey, TValue>, index?: any): LuaIterable<LuaMultiReturn<[TKey, NonNullable<TValue>]>>;
/**
* Emits a Lua next iterator. Use in conjunction with for-of loop.
* @param t - The object to iterate.
* @emits `next, t, index`
*/
declare function __next<T>(this: void, t: T, index?: any): LuaIterable<LuaMultiReturn<[keyof T, NonNullable<T[keyof T]>]>>;
/**
* Emits a class prototype iterator. Use in conjunction with for-of loop.
* @typeParam TClass - The class to iterate.
* @emits `next, TClass.prototype`
*/
declare function __prototypeof<TClass extends AnyNotNil>(this: void): LuaIterable<LuaMultiReturn<[string, AnyNotNil]>>;
/**
* Emits a Lua return statement.
* @emits `return`
* @remarks
* This is useful for returning on top-level, because it allows to bypass ts(1108) error.
*/
declare function __return(this: void, ...args: any[]): void;
/**
* Efficiently swaps the two values (without a temporary variable).
* @emits `left, right = right, left`
*/
declare function __swap<T>(this: void, left: T, right: T): void;
/**
* Provides an ability to preserve (and validate) parameters' type information of the parent function.
* @param validator - The callback function which will receive parameters' type information.
* @remarks
* This is currently experimental. Must be called directly in the main scope of the function (outside of control flow).
*/
declare function __typedparams(this: void, validator: (this: void, ...info: [/*parameter name*/string, /*full type*/string, /*dotDotDotToken*/boolean, /*questionToken*/boolean, /*type*/string, /*initializer*/string?][]) => void): void;
/**
* Emits a Lua vararg operator `...`.
* @emits `...`
*/
declare function __vararg(this: void): LuaIterable<LuaMultiReturn<[...any[]]>>;
/**
* Unsafely casts a given value as a value of type T.
* @typeParam T - The type to cast to.
* @param value - The value to be cast.
* @returns Returns the given value.
* @emits `value`
* @remarks
* This is useful in-place replacement for "as any" casting, because it allows to "find all references" quickly.
*/
declare function unsafe_cast<T>(this: void, value: unknown): T;