typescript-to-lua 1.9.0 → 1.10.0-beta.0
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/dist/CompilerOptions.d.ts +1 -0
- package/dist/CompilerOptions.js +1 -0
- package/dist/LuaAST.d.ts +43 -37
- package/dist/LuaAST.js +48 -38
- package/dist/LuaLib.d.ts +12 -6
- package/dist/LuaLib.js +31 -21
- package/dist/LuaPrinter.d.ts +1 -0
- package/dist/LuaPrinter.js +10 -4
- package/dist/lualib/5.0/ArrayConcat.lua +22 -0
- package/dist/lualib/5.0/ArrayEntries.lua +13 -0
- package/dist/lualib/5.0/ArrayEvery.lua +8 -0
- package/dist/lualib/5.0/ArrayFilter.lua +11 -0
- package/dist/lualib/5.0/ArrayFind.lua +9 -0
- package/dist/lualib/5.0/ArrayFindIndex.lua +8 -0
- package/dist/lualib/5.0/ArrayFlat.lua +27 -0
- package/dist/lualib/5.0/ArrayFlatMap.lua +17 -0
- package/dist/lualib/5.0/ArrayForEach.lua +5 -0
- package/dist/lualib/5.0/ArrayFrom.lua +29 -0
- package/dist/lualib/5.0/ArrayIncludes.lua +19 -0
- package/dist/lualib/5.0/ArrayIndexOf.lua +24 -0
- package/dist/lualib/5.0/ArrayIsArray.lua +3 -0
- package/dist/lualib/5.0/ArrayJoin.lua +10 -0
- package/dist/lualib/5.0/ArrayMap.lua +7 -0
- package/dist/lualib/5.0/ArrayPush.lua +9 -0
- package/dist/lualib/5.0/ArrayPushArray.lua +8 -0
- package/dist/lualib/5.0/ArrayReduce.lua +23 -0
- package/dist/lualib/5.0/ArrayReduceRight.lua +23 -0
- package/dist/lualib/5.0/ArrayReverse.lua +12 -0
- package/dist/lualib/5.0/ArraySetLength.lua +12 -0
- package/dist/lualib/5.0/ArraySlice.lua +43 -0
- package/dist/lualib/5.0/ArraySome.lua +8 -0
- package/dist/lualib/5.0/ArraySort.lua +11 -0
- package/dist/lualib/5.0/ArraySplice.lua +77 -0
- package/dist/lualib/5.0/ArrayToObject.lua +7 -0
- package/dist/lualib/5.0/ArrayUnshift.lua +14 -0
- package/dist/lualib/5.0/Await.lua +54 -0
- package/dist/lualib/5.0/Class.lua +6 -0
- package/dist/lualib/5.0/ClassExtends.lua +24 -0
- package/dist/lualib/5.0/CloneDescriptor.lua +28 -0
- package/dist/lualib/5.0/CountVarargs.lua +4 -0
- package/dist/lualib/5.0/Decorate.lua +36 -0
- package/dist/lualib/5.0/DecorateParam.lua +3 -0
- package/dist/lualib/5.0/DelegatedYield.lua +34 -0
- package/dist/lualib/5.0/Delete.lua +19 -0
- package/dist/lualib/5.0/Error.lua +85 -0
- package/dist/lualib/5.0/FunctionBind.lua +11 -0
- package/dist/lualib/5.0/Generator.lua +34 -0
- package/dist/lualib/5.0/InstanceOf.lua +18 -0
- package/dist/lualib/5.0/InstanceOfObject.lua +4 -0
- package/dist/lualib/5.0/Iterator.lua +40 -0
- package/dist/lualib/5.0/LuaIteratorSpread.lua +9 -0
- package/dist/lualib/5.0/Map.lua +140 -0
- package/dist/lualib/5.0/Match.lua +13 -0
- package/dist/lualib/5.0/MathAtan2.lua +1 -0
- package/dist/lualib/5.0/MathModf.lua +10 -0
- package/dist/lualib/5.0/MathSign.lua +8 -0
- package/dist/lualib/5.0/Modulo50.lua +3 -0
- package/dist/lualib/5.0/New.lua +5 -0
- package/dist/lualib/5.0/Number.lua +26 -0
- package/dist/lualib/5.0/NumberIsFinite.lua +3 -0
- package/dist/lualib/5.0/NumberIsNaN.lua +3 -0
- package/dist/lualib/5.0/NumberToString.lua +47 -0
- package/dist/lualib/5.0/ObjectAssign.lua +10 -0
- package/dist/lualib/5.0/ObjectDefineProperty.lua +59 -0
- package/dist/lualib/5.0/ObjectEntries.lua +9 -0
- package/dist/lualib/5.0/ObjectFromEntries.lua +20 -0
- package/dist/lualib/5.0/ObjectGetOwnPropertyDescriptor.lua +10 -0
- package/dist/lualib/5.0/ObjectGetOwnPropertyDescriptors.lua +7 -0
- package/dist/lualib/5.0/ObjectKeys.lua +9 -0
- package/dist/lualib/5.0/ObjectRest.lua +9 -0
- package/dist/lualib/5.0/ObjectValues.lua +9 -0
- package/dist/lualib/5.0/ParseFloat.lua +18 -0
- package/dist/lualib/5.0/ParseInt.lua +49 -0
- package/dist/lualib/5.0/Promise.lua +176 -0
- package/dist/lualib/5.0/PromiseAll.lua +44 -0
- package/dist/lualib/5.0/PromiseAllSettled.lua +48 -0
- package/dist/lualib/5.0/PromiseAny.lua +41 -0
- package/dist/lualib/5.0/PromiseRace.lua +28 -0
- package/dist/lualib/5.0/Set.lua +130 -0
- package/dist/lualib/5.0/SetDescriptor.lua +79 -0
- package/dist/lualib/5.0/SourceMapTraceBack.lua +56 -0
- package/dist/lualib/5.0/SparseArrayNew.lua +5 -0
- package/dist/lualib/5.0/SparseArrayPush.lua +9 -0
- package/dist/lualib/5.0/SparseArraySpread.lua +3 -0
- package/dist/lualib/5.0/Spread.lua +15 -0
- package/dist/lualib/5.0/StringAccess.lua +5 -0
- package/dist/lualib/5.0/StringCharAt.lua +9 -0
- package/dist/lualib/5.0/StringCharCodeAt.lua +13 -0
- package/dist/lualib/5.0/StringEndsWith.lua +10 -0
- package/dist/lualib/5.0/StringIncludes.lua +9 -0
- package/dist/lualib/5.0/StringPadEnd.lua +26 -0
- package/dist/lualib/5.0/StringPadStart.lua +26 -0
- package/dist/lualib/5.0/StringReplace.lua +20 -0
- package/dist/lualib/5.0/StringReplaceAll.lua +42 -0
- package/dist/lualib/5.0/StringSlice.lua +15 -0
- package/dist/lualib/5.0/StringSplit.lua +36 -0
- package/dist/lualib/5.0/StringStartsWith.lua +10 -0
- package/dist/lualib/5.0/StringSubstr.lua +15 -0
- package/dist/lualib/5.0/StringSubstring.lua +17 -0
- package/dist/lualib/5.0/StringTrim.lua +4 -0
- package/dist/lualib/5.0/StringTrimEnd.lua +4 -0
- package/dist/lualib/5.0/StringTrimStart.lua +4 -0
- package/dist/lualib/5.0/Symbol.lua +15 -0
- package/dist/lualib/5.0/SymbolRegistry.lua +17 -0
- package/dist/lualib/5.0/TypeOf.lua +10 -0
- package/dist/lualib/5.0/Unpack.lua +1 -0
- package/dist/lualib/5.0/WeakMap.lua +45 -0
- package/dist/lualib/5.0/WeakSet.lua +41 -0
- package/dist/lualib/5.0/lualib_bundle.lua +2574 -0
- package/dist/lualib/5.0/lualib_module_info.json +672 -0
- package/dist/lualib/universal/ArrayConcat.lua +22 -0
- package/dist/lualib/universal/ArrayEntries.lua +13 -0
- package/dist/lualib/universal/ArrayEvery.lua +8 -0
- package/dist/lualib/universal/ArrayFilter.lua +11 -0
- package/dist/lualib/universal/ArrayFind.lua +9 -0
- package/dist/lualib/universal/ArrayFindIndex.lua +8 -0
- package/dist/lualib/universal/ArrayFlat.lua +27 -0
- package/dist/lualib/universal/ArrayFlatMap.lua +17 -0
- package/dist/lualib/universal/ArrayForEach.lua +5 -0
- package/dist/lualib/universal/ArrayFrom.lua +29 -0
- package/dist/lualib/universal/ArrayIncludes.lua +19 -0
- package/dist/lualib/universal/ArrayIndexOf.lua +24 -0
- package/dist/lualib/universal/ArrayIsArray.lua +3 -0
- package/dist/lualib/universal/ArrayJoin.lua +10 -0
- package/dist/lualib/universal/ArrayMap.lua +7 -0
- package/dist/lualib/universal/ArrayPush.lua +9 -0
- package/dist/lualib/universal/ArrayPushArray.lua +8 -0
- package/dist/lualib/universal/ArrayReduce.lua +23 -0
- package/dist/lualib/universal/ArrayReduceRight.lua +23 -0
- package/dist/lualib/universal/ArrayReverse.lua +12 -0
- package/dist/lualib/universal/ArraySetLength.lua +12 -0
- package/dist/lualib/universal/ArraySlice.lua +43 -0
- package/dist/lualib/universal/ArraySome.lua +8 -0
- package/dist/lualib/universal/ArraySort.lua +11 -0
- package/dist/lualib/universal/ArraySplice.lua +77 -0
- package/dist/lualib/universal/ArrayToObject.lua +7 -0
- package/dist/lualib/universal/ArrayUnshift.lua +14 -0
- package/dist/lualib/universal/Await.lua +54 -0
- package/dist/lualib/universal/Class.lua +6 -0
- package/dist/lualib/universal/ClassExtends.lua +24 -0
- package/dist/lualib/universal/CloneDescriptor.lua +28 -0
- package/dist/lualib/universal/CountVarargs.lua +3 -0
- package/dist/lualib/universal/Decorate.lua +36 -0
- package/dist/lualib/universal/DecorateParam.lua +3 -0
- package/dist/lualib/universal/DelegatedYield.lua +34 -0
- package/dist/lualib/universal/Delete.lua +19 -0
- package/dist/lualib/universal/Error.lua +82 -0
- package/dist/lualib/universal/FunctionBind.lua +11 -0
- package/dist/lualib/universal/Generator.lua +31 -0
- package/dist/lualib/universal/InstanceOf.lua +18 -0
- package/dist/lualib/universal/InstanceOfObject.lua +4 -0
- package/dist/lualib/universal/Iterator.lua +40 -0
- package/dist/lualib/universal/LuaIteratorSpread.lua +9 -0
- package/dist/lualib/universal/Map.lua +140 -0
- package/dist/lualib/universal/Match.lua +1 -0
- package/dist/lualib/universal/MathAtan2.lua +1 -0
- package/dist/lualib/universal/MathModf.lua +1 -0
- package/dist/lualib/universal/MathSign.lua +8 -0
- package/dist/lualib/universal/Modulo50.lua +3 -0
- package/dist/lualib/universal/New.lua +5 -0
- package/dist/lualib/universal/Number.lua +26 -0
- package/dist/lualib/universal/NumberIsFinite.lua +3 -0
- package/dist/lualib/universal/NumberIsNaN.lua +3 -0
- package/dist/lualib/universal/NumberToString.lua +44 -0
- package/dist/lualib/universal/ObjectAssign.lua +10 -0
- package/dist/lualib/universal/ObjectDefineProperty.lua +59 -0
- package/dist/lualib/universal/ObjectEntries.lua +9 -0
- package/dist/lualib/universal/ObjectFromEntries.lua +20 -0
- package/dist/lualib/universal/ObjectGetOwnPropertyDescriptor.lua +10 -0
- package/dist/lualib/universal/ObjectGetOwnPropertyDescriptors.lua +7 -0
- package/dist/lualib/universal/ObjectKeys.lua +9 -0
- package/dist/lualib/universal/ObjectRest.lua +9 -0
- package/dist/lualib/universal/ObjectValues.lua +9 -0
- package/dist/lualib/universal/ParseFloat.lua +18 -0
- package/dist/lualib/universal/ParseInt.lua +43 -0
- package/dist/lualib/universal/Promise.lua +176 -0
- package/dist/lualib/universal/PromiseAll.lua +44 -0
- package/dist/lualib/universal/PromiseAllSettled.lua +48 -0
- package/dist/lualib/universal/PromiseAny.lua +41 -0
- package/dist/lualib/universal/PromiseRace.lua +28 -0
- package/dist/lualib/universal/Set.lua +130 -0
- package/dist/lualib/universal/SetDescriptor.lua +79 -0
- package/dist/lualib/universal/SourceMapTraceBack.lua +56 -0
- package/dist/lualib/universal/SparseArrayNew.lua +5 -0
- package/dist/lualib/universal/SparseArrayPush.lua +9 -0
- package/dist/lualib/universal/SparseArraySpread.lua +8 -0
- package/dist/lualib/universal/Spread.lua +15 -0
- package/dist/lualib/universal/StringAccess.lua +5 -0
- package/dist/lualib/universal/StringCharAt.lua +9 -0
- package/dist/lualib/universal/StringCharCodeAt.lua +13 -0
- package/dist/lualib/universal/StringEndsWith.lua +6 -0
- package/dist/lualib/universal/StringIncludes.lua +9 -0
- package/dist/lualib/universal/StringPadEnd.lua +26 -0
- package/dist/lualib/universal/StringPadStart.lua +26 -0
- package/dist/lualib/universal/StringReplace.lua +20 -0
- package/dist/lualib/universal/StringReplaceAll.lua +42 -0
- package/dist/lualib/universal/StringSlice.lua +15 -0
- package/dist/lualib/universal/StringSplit.lua +36 -0
- package/dist/lualib/universal/StringStartsWith.lua +6 -0
- package/dist/lualib/universal/StringSubstr.lua +15 -0
- package/dist/lualib/universal/StringSubstring.lua +17 -0
- package/dist/lualib/universal/StringTrim.lua +4 -0
- package/dist/lualib/universal/StringTrimEnd.lua +4 -0
- package/dist/lualib/universal/StringTrimStart.lua +4 -0
- package/dist/lualib/universal/Symbol.lua +15 -0
- package/dist/lualib/universal/SymbolRegistry.lua +17 -0
- package/dist/lualib/universal/TypeOf.lua +10 -0
- package/dist/lualib/universal/Unpack.lua +1 -0
- package/dist/lualib/universal/WeakMap.lua +45 -0
- package/dist/lualib/universal/WeakSet.lua +41 -0
- package/dist/lualib/universal/lualib_bundle.lua +2534 -0
- package/dist/lualib/universal/lualib_module_info.json +671 -0
- package/dist/lualib/universal/universal/CountVarargs.lua +3 -0
- package/dist/lualib/universal/universal/Match.lua +1 -0
- package/dist/lualib/universal/universal/MathModf.lua +1 -0
- package/dist/lualib/universal/universal/SparseArraySpread.lua +8 -0
- package/dist/lualib/universal/universal/Unpack.lua +1 -0
- package/dist/lualib-build/plugin.js +12 -2
- package/dist/transformation/builtins/array.d.ts +1 -1
- package/dist/transformation/builtins/array.js +12 -2
- package/dist/transformation/builtins/function.js +4 -2
- package/dist/transformation/builtins/index.js +11 -3
- package/dist/transformation/builtins/string.d.ts +1 -1
- package/dist/transformation/builtins/string.js +8 -1
- package/dist/transformation/utils/diagnostics.d.ts +2 -4
- package/dist/transformation/utils/lua-ast.js +3 -1
- package/dist/transformation/utils/typescript/index.js +2 -2
- package/dist/transformation/visitors/binary-expression/bit.js +4 -2
- package/dist/transformation/visitors/binary-expression/index.js +4 -0
- package/dist/transformation/visitors/break-continue.js +4 -2
- package/dist/transformation/visitors/class/index.js +9 -4
- package/dist/transformation/visitors/class/members/fields.js +6 -2
- package/dist/transformation/visitors/class/members/method.js +4 -2
- package/dist/transformation/visitors/errors.js +4 -2
- package/dist/transformation/visitors/function.js +2 -1
- package/dist/transformation/visitors/language-extensions/operators.js +2 -1
- package/dist/transformation/visitors/literal.js +12 -4
- package/dist/transformation/visitors/modules/export.js +1 -1
- package/dist/transformation/visitors/spread.js +4 -1
- package/dist/transformation/visitors/typescript.js +1 -0
- package/dist/transpilation/bundle.js +11 -4
- package/dist/transpilation/transpiler.js +3 -1
- package/package.json +18 -18
- package/language-extensions/index.d.ts +0 -676
|
@@ -1,676 +0,0 @@
|
|
|
1
|
-
type AnyTable = Record<any, any>;
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/consistent-type-definitions
|
|
3
|
-
type AnyNotNil = {};
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Indicates a type is a language extension provided by TypescriptToLua when used as a value or function call.
|
|
7
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
8
|
-
*
|
|
9
|
-
* @param TBrand A string used to uniquely identify the language extension type
|
|
10
|
-
*/
|
|
11
|
-
declare interface LuaExtension<TBrand extends string> {
|
|
12
|
-
readonly __tstlExtension: TBrand;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Indicates a type is a language extension provided by TypescriptToLua when used in a for-of loop.
|
|
17
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
18
|
-
*
|
|
19
|
-
* @param TBrand A string used to uniquely identify the language extension type
|
|
20
|
-
*/
|
|
21
|
-
declare interface LuaIterationExtension<TBrand extends string> {
|
|
22
|
-
readonly __tstlIterable: TBrand;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Returns multiple values from a function, by wrapping them in a LuaMultiReturn tuple.
|
|
27
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
28
|
-
*
|
|
29
|
-
* @param T A tuple type with each element type representing a return value's type.
|
|
30
|
-
* @param values Return values.
|
|
31
|
-
*/
|
|
32
|
-
declare const $multi: (<T extends any[]>(...values: T) => LuaMultiReturn<T>) & LuaExtension<"MultiFunction">;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Represents multiple return values as a tuple.
|
|
36
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
37
|
-
*
|
|
38
|
-
* @param T A tuple type with each element type representing a return value's type.
|
|
39
|
-
*/
|
|
40
|
-
declare type LuaMultiReturn<T extends any[]> = T & {
|
|
41
|
-
readonly __tstlMultiReturn: any;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Creates a Lua-style numeric for loop (for i=start,limit,step) when used in for...of. Not valid in any other context.
|
|
46
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
47
|
-
*
|
|
48
|
-
* @param start The first number in the sequence to iterate over.
|
|
49
|
-
* @param limit The last number in the sequence to iterate over.
|
|
50
|
-
* @param step The amount to increment each iteration.
|
|
51
|
-
*/
|
|
52
|
-
declare const $range: ((start: number, limit: number, step?: number) => Iterable<number>) &
|
|
53
|
-
LuaExtension<"RangeFunction">;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Transpiles to the global vararg (`...`)
|
|
57
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
58
|
-
*/
|
|
59
|
-
declare const $vararg: string[] & LuaExtension<"VarargConstant">;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Represents a Lua-style iterator which is returned from a LuaIterable.
|
|
63
|
-
* For simple iterators (with no state), this is just a function.
|
|
64
|
-
* For complex iterators that use a state, this is a LuaMultiReturn tuple containing a function, the state, and the initial value to pass to the function.
|
|
65
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
66
|
-
*
|
|
67
|
-
* @param state The state object returned from the LuaIterable.
|
|
68
|
-
* @param lastValue The last value returned from this function. If iterating LuaMultiReturn values, this is the first value of the tuple.
|
|
69
|
-
*/
|
|
70
|
-
declare type LuaIterator<TValue, TState> = TState extends undefined
|
|
71
|
-
? (this: void) => TValue
|
|
72
|
-
: LuaMultiReturn<
|
|
73
|
-
[
|
|
74
|
-
(
|
|
75
|
-
this: void,
|
|
76
|
-
state: TState,
|
|
77
|
-
lastValue: TValue extends LuaMultiReturn<infer TTuple> ? TTuple[0] : TValue
|
|
78
|
-
) => TValue,
|
|
79
|
-
TState,
|
|
80
|
-
TValue extends LuaMultiReturn<infer TTuple> ? TTuple[0] : TValue
|
|
81
|
-
]
|
|
82
|
-
>;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Represents a Lua-style iteratable which iterates single values in a `for...in` loop (ex. `for x in iter() do`).
|
|
86
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
87
|
-
*
|
|
88
|
-
* @param TValue The type of value returned each iteration. If this is LuaMultiReturn, multiple values will be returned each iteration.
|
|
89
|
-
* @param TState The type of the state value passed back to the iterator function each iteration.
|
|
90
|
-
*/
|
|
91
|
-
declare type LuaIterable<TValue, TState = undefined> = Iterable<TValue> &
|
|
92
|
-
LuaIterator<TValue, TState> &
|
|
93
|
-
LuaIterationExtension<"Iterable">;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Represents an object that can be iterated with pairs()
|
|
97
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
98
|
-
*
|
|
99
|
-
* @param TKey The type of the key returned each iteration.
|
|
100
|
-
* @param TValue The type of the value returned each iteration.
|
|
101
|
-
*/
|
|
102
|
-
declare type LuaPairsIterable<TKey extends AnyNotNil, TValue> = Iterable<[TKey, TValue]> &
|
|
103
|
-
LuaIterationExtension<"Pairs">;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Represents an object that can be iterated with pairs(), where only the key value is used.
|
|
107
|
-
*
|
|
108
|
-
* @param TKey The type of the key returned each iteration.
|
|
109
|
-
*/
|
|
110
|
-
declare type LuaPairsKeyIterable<TKey extends AnyNotNil> = Iterable<TKey> & LuaIterationExtension<"PairsKey">;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Calls to functions with this type are translated to `left + right`.
|
|
114
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
115
|
-
*
|
|
116
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
117
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
118
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
119
|
-
*/
|
|
120
|
-
declare type LuaAddition<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"Addition">;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Calls to methods with this type are translated to `left + right`, where `left` is the object with the method.
|
|
124
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
125
|
-
*
|
|
126
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
127
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
128
|
-
*/
|
|
129
|
-
declare type LuaAdditionMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"AdditionMethod">;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Calls to functions with this type are translated to `left - right`.
|
|
133
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
134
|
-
*
|
|
135
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
136
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
137
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
138
|
-
*/
|
|
139
|
-
declare type LuaSubtraction<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
140
|
-
LuaExtension<"Subtraction">;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Calls to methods with this type are translated to `left - right`, where `left` is the object with the method.
|
|
144
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
145
|
-
*
|
|
146
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
147
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
148
|
-
*/
|
|
149
|
-
declare type LuaSubtractionMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"SubtractionMethod">;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Calls to functions with this type are translated to `left * right`.
|
|
153
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
154
|
-
*
|
|
155
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
156
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
157
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
158
|
-
*/
|
|
159
|
-
declare type LuaMultiplication<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
160
|
-
LuaExtension<"Multiplication">;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Calls to methods with this type are translated to `left * right`, where `left` is the object with the method.
|
|
164
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
165
|
-
*
|
|
166
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
167
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
168
|
-
*/
|
|
169
|
-
declare type LuaMultiplicationMethod<TRight, TReturn> = ((right: TRight) => TReturn) &
|
|
170
|
-
LuaExtension<"MultiplicationMethod">;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Calls to functions with this type are translated to `left / right`.
|
|
174
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
175
|
-
*
|
|
176
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
177
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
178
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
179
|
-
*/
|
|
180
|
-
declare type LuaDivision<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"Division">;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Calls to methods with this type are translated to `left / right`, where `left` is the object with the method.
|
|
184
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
185
|
-
*
|
|
186
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
187
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
188
|
-
*/
|
|
189
|
-
declare type LuaDivisionMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"DivisionMethod">;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Calls to functions with this type are translated to `left % right`.
|
|
193
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
194
|
-
*
|
|
195
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
196
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
197
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
198
|
-
*/
|
|
199
|
-
declare type LuaModulo<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"Modulo">;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Calls to methods with this type are translated to `left % right`, where `left` is the object with the method.
|
|
203
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
204
|
-
*
|
|
205
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
206
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
207
|
-
*/
|
|
208
|
-
declare type LuaModuloMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"ModuloMethod">;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Calls to functions with this type are translated to `left ^ right`.
|
|
212
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
213
|
-
*
|
|
214
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
215
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
216
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
217
|
-
*/
|
|
218
|
-
declare type LuaPower<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"Power">;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Calls to methods with this type are translated to `left ^ right`, where `left` is the object with the method.
|
|
222
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
223
|
-
*
|
|
224
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
225
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
226
|
-
*/
|
|
227
|
-
declare type LuaPowerMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"PowerMethod">;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Calls to functions with this type are translated to `left // right`.
|
|
231
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
232
|
-
*
|
|
233
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
234
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
235
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
236
|
-
*/
|
|
237
|
-
declare type LuaFloorDivision<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
238
|
-
LuaExtension<"FloorDivision">;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Calls to methods with this type are translated to `left // right`, where `left` is the object with the method.
|
|
242
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
243
|
-
*
|
|
244
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
245
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
246
|
-
*/
|
|
247
|
-
declare type LuaFloorDivisionMethod<TRight, TReturn> = ((right: TRight) => TReturn) &
|
|
248
|
-
LuaExtension<"FloorDivisionMethod">;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Calls to functions with this type are translated to `left & right`.
|
|
252
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
253
|
-
*
|
|
254
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
255
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
256
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
257
|
-
*/
|
|
258
|
-
declare type LuaBitwiseAnd<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
259
|
-
LuaExtension<"BitwiseAnd">;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Calls to methods with this type are translated to `left & right`, where `left` is the object with the method.
|
|
263
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
264
|
-
*
|
|
265
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
266
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
267
|
-
*/
|
|
268
|
-
declare type LuaBitwiseAndMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"BitwiseAndMethod">;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Calls to functions with this type are translated to `left | right`.
|
|
272
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
273
|
-
*
|
|
274
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
275
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
276
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
277
|
-
*/
|
|
278
|
-
declare type LuaBitwiseOr<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
279
|
-
LuaExtension<"BitwiseOr">;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Calls to methods with this type are translated to `left | right`, where `left` is the object with the method.
|
|
283
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
284
|
-
*
|
|
285
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
286
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
287
|
-
*/
|
|
288
|
-
declare type LuaBitwiseOrMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"BitwiseOrMethod">;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Calls to functions with this type are translated to `left ~ right`.
|
|
292
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
293
|
-
*
|
|
294
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
295
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
296
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
297
|
-
*/
|
|
298
|
-
declare type LuaBitwiseExclusiveOr<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
299
|
-
LuaExtension<"BitwiseExclusiveOr">;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Calls to methods with this type are translated to `left ~ right`, where `left` is the object with the method.
|
|
303
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
304
|
-
*
|
|
305
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
306
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
307
|
-
*/
|
|
308
|
-
declare type LuaBitwiseExclusiveOrMethod<TRight, TReturn> = ((right: TRight) => TReturn) &
|
|
309
|
-
LuaExtension<"BitwiseExclusiveOrMethod">;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Calls to functions with this type are translated to `left << right`.
|
|
313
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
314
|
-
*
|
|
315
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
316
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
317
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
318
|
-
*/
|
|
319
|
-
declare type LuaBitwiseLeftShift<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
320
|
-
LuaExtension<"BitwiseLeftShift">;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Calls to methods with this type are translated to `left << right`, where `left` is the object with the method.
|
|
324
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
325
|
-
*
|
|
326
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
327
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
328
|
-
*/
|
|
329
|
-
declare type LuaBitwiseLeftShiftMethod<TRight, TReturn> = ((right: TRight) => TReturn) &
|
|
330
|
-
LuaExtension<"BitwiseLeftShiftMethod">;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Calls to functions with this type are translated to `left >> right`.
|
|
334
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
335
|
-
*
|
|
336
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
337
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
338
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
339
|
-
*/
|
|
340
|
-
declare type LuaBitwiseRightShift<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
341
|
-
LuaExtension<"BitwiseRightShift">;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Calls to methods with this type are translated to `left >> right`, where `left` is the object with the method.
|
|
345
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
346
|
-
*
|
|
347
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
348
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
349
|
-
*/
|
|
350
|
-
declare type LuaBitwiseRightShiftMethod<TRight, TReturn> = ((right: TRight) => TReturn) &
|
|
351
|
-
LuaExtension<"BitwiseRightShiftMethod">;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Calls to functions with this type are translated to `left .. right`.
|
|
355
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
356
|
-
*
|
|
357
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
358
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
359
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
360
|
-
*/
|
|
361
|
-
declare type LuaConcat<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"Concat">;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Calls to methods with this type are translated to `left .. right`, where `left` is the object with the method.
|
|
365
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
366
|
-
*
|
|
367
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
368
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
369
|
-
*/
|
|
370
|
-
declare type LuaConcatMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"ConcatMethod">;
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Calls to functions with this type are translated to `left < right`.
|
|
374
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
375
|
-
*
|
|
376
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
377
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
378
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
379
|
-
*/
|
|
380
|
-
declare type LuaLessThan<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) & LuaExtension<"LessThan">;
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Calls to methods with this type are translated to `left < right`, where `left` is the object with the method.
|
|
384
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
385
|
-
*
|
|
386
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
387
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
388
|
-
*/
|
|
389
|
-
declare type LuaLessThanMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"LessThanMethod">;
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Calls to functions with this type are translated to `left > right`.
|
|
393
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
394
|
-
*
|
|
395
|
-
* @param TLeft The type of the left-hand-side of the operation.
|
|
396
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
397
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
398
|
-
*/
|
|
399
|
-
declare type LuaGreaterThan<TLeft, TRight, TReturn> = ((left: TLeft, right: TRight) => TReturn) &
|
|
400
|
-
LuaExtension<"GreaterThan">;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Calls to methods with this type are translated to `left > right`, where `left` is the object with the method.
|
|
404
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
405
|
-
*
|
|
406
|
-
* @param TRight The type of the right-hand-side of the operation.
|
|
407
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
408
|
-
*/
|
|
409
|
-
declare type LuaGreaterThanMethod<TRight, TReturn> = ((right: TRight) => TReturn) & LuaExtension<"GreaterThanMethod">;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Calls to functions with this type are translated to `-operand`.
|
|
413
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
414
|
-
*
|
|
415
|
-
* @param TOperand The type of the value in the operation.
|
|
416
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
417
|
-
*/
|
|
418
|
-
declare type LuaNegation<TOperand, TReturn> = ((operand: TOperand) => TReturn) & LuaExtension<"Negation">;
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Calls to method with this type are translated to `-operand`, where `operand` is the object with the method.
|
|
422
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
423
|
-
*
|
|
424
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
425
|
-
*/
|
|
426
|
-
declare type LuaNegationMethod<TReturn> = (() => TReturn) & LuaExtension<"NegationMethod">;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Calls to functions with this type are translated to `~operand`.
|
|
430
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
431
|
-
*
|
|
432
|
-
* @param TOperand The type of the value in the operation.
|
|
433
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
434
|
-
*/
|
|
435
|
-
declare type LuaBitwiseNot<TOperand, TReturn> = ((operand: TOperand) => TReturn) & LuaExtension<"BitwiseNot">;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Calls to method with this type are translated to `~operand`, where `operand` is the object with the method.
|
|
439
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
440
|
-
*
|
|
441
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
442
|
-
*/
|
|
443
|
-
declare type LuaBitwiseNotMethod<TReturn> = (() => TReturn) & LuaExtension<"BitwiseNotMethod">;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Calls to functions with this type are translated to `#operand`.
|
|
447
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
448
|
-
*
|
|
449
|
-
* @param TOperand The type of the value in the operation.
|
|
450
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
451
|
-
*/
|
|
452
|
-
declare type LuaLength<TOperand, TReturn> = ((operand: TOperand) => TReturn) & LuaExtension<"Length">;
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Calls to method with this type are translated to `#operand`, where `operand` is the object with the method.
|
|
456
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
457
|
-
*
|
|
458
|
-
* @param TReturn The resulting (return) type of the operation.
|
|
459
|
-
*/
|
|
460
|
-
declare type LuaLengthMethod<TReturn> = (() => TReturn) & LuaExtension<"LengthMethod">;
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Calls to functions with this type are translated to `table[key]`.
|
|
464
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
465
|
-
*
|
|
466
|
-
* @param TTable The type to access as a Lua table.
|
|
467
|
-
* @param TKey The type of the key to use to access the table.
|
|
468
|
-
* @param TValue The type of the value stored in the table.
|
|
469
|
-
*/
|
|
470
|
-
declare type LuaTableGet<TTable extends AnyTable, TKey extends AnyNotNil, TValue> = ((
|
|
471
|
-
table: TTable,
|
|
472
|
-
key: TKey
|
|
473
|
-
) => TValue) &
|
|
474
|
-
LuaExtension<"TableGet">;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Calls to methods with this type are translated to `table[key]`, where `table` is the object with the method.
|
|
478
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
479
|
-
*
|
|
480
|
-
* @param TKey The type of the key to use to access the table.
|
|
481
|
-
* @param TValue The type of the value stored in the table.
|
|
482
|
-
*/
|
|
483
|
-
declare type LuaTableGetMethod<TKey extends AnyNotNil, TValue> = ((key: TKey) => TValue) &
|
|
484
|
-
LuaExtension<"TableGetMethod">;
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Calls to functions with this type are translated to `table[key] = value`.
|
|
488
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
489
|
-
*
|
|
490
|
-
* @param TTable The type to access as a Lua table.
|
|
491
|
-
* @param TKey The type of the key to use to access the table.
|
|
492
|
-
* @param TValue The type of the value to assign to the table.
|
|
493
|
-
*/
|
|
494
|
-
declare type LuaTableSet<TTable extends AnyTable, TKey extends AnyNotNil, TValue> = ((
|
|
495
|
-
table: TTable,
|
|
496
|
-
key: TKey,
|
|
497
|
-
value: TValue
|
|
498
|
-
) => void) &
|
|
499
|
-
LuaExtension<"TableSet">;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Calls to methods with this type are translated to `table[key] = value`, where `table` is the object with the method.
|
|
503
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
504
|
-
*
|
|
505
|
-
* @param TKey The type of the key to use to access the table.
|
|
506
|
-
* @param TValue The type of the value to assign to the table.
|
|
507
|
-
*/
|
|
508
|
-
declare type LuaTableSetMethod<TKey extends AnyNotNil, TValue> = ((key: TKey, value: TValue) => void) &
|
|
509
|
-
LuaExtension<"TableSetMethod">;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Calls to functions with this type are translated to `table[key] = true`.
|
|
513
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
514
|
-
*
|
|
515
|
-
* @param TTable The type to access as a Lua table.
|
|
516
|
-
* @param TKey The type of the key to use to access the table.
|
|
517
|
-
*/
|
|
518
|
-
declare type LuaTableAddKey<TTable extends AnyTable, TKey extends AnyNotNil> = ((table: TTable, key: TKey) => void) &
|
|
519
|
-
LuaExtension<"TableAddKey">;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Calls to methods with this type are translated to `table[key] = true`, where `table` is the object with the method.
|
|
523
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
524
|
-
* @param TKey The type of the key to use to access the table.
|
|
525
|
-
*/
|
|
526
|
-
declare type LuaTableAddKeyMethod<TKey extends AnyNotNil> = ((key: TKey) => void) & LuaExtension<"TableAddKeyMethod">;
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Calls to functions with this type are translated to `table[key] ~= nil`.
|
|
530
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
531
|
-
*
|
|
532
|
-
* @param TTable The type to access as a Lua table.
|
|
533
|
-
* @param TKey The type of the key to use to access the table.
|
|
534
|
-
*/
|
|
535
|
-
declare type LuaTableHas<TTable extends AnyTable, TKey extends AnyNotNil> = ((table: TTable, key: TKey) => boolean) &
|
|
536
|
-
LuaExtension<"TableHas">;
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Calls to methods with this type are translated to `table[key] ~= nil`, where `table` is the object with the method.
|
|
540
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
541
|
-
*
|
|
542
|
-
* @param TKey The type of the key to use to access the table.
|
|
543
|
-
*/
|
|
544
|
-
declare type LuaTableHasMethod<TKey extends AnyNotNil> = ((key: TKey) => boolean) & LuaExtension<"TableHasMethod">;
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* Calls to functions with this type are translated to `table[key] = nil`.
|
|
548
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
549
|
-
*
|
|
550
|
-
* @param TTable The type to access as a Lua table.
|
|
551
|
-
* @param TKey The type of the key to use to access the table.
|
|
552
|
-
*/
|
|
553
|
-
declare type LuaTableDelete<TTable extends AnyTable, TKey extends AnyNotNil> = ((table: TTable, key: TKey) => boolean) &
|
|
554
|
-
LuaExtension<"TableDelete">;
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Calls to methods with this type are translated to `table[key] = nil`, where `table` is the object with the method.
|
|
558
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
559
|
-
*
|
|
560
|
-
* @param TKey The type of the key to use to access the table.
|
|
561
|
-
*/
|
|
562
|
-
declare type LuaTableDeleteMethod<TKey extends AnyNotNil> = ((key: TKey) => boolean) &
|
|
563
|
-
LuaExtension<"TableDeleteMethod">;
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* A convenience type for working directly with a Lua table.
|
|
567
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
568
|
-
*
|
|
569
|
-
* @param TKey The type of the keys used to access the table.
|
|
570
|
-
* @param TValue The type of the values stored in the table.
|
|
571
|
-
*/
|
|
572
|
-
declare interface LuaTable<TKey extends AnyNotNil = AnyNotNil, TValue = any> extends LuaPairsIterable<TKey, TValue> {
|
|
573
|
-
length: LuaLengthMethod<number>;
|
|
574
|
-
get: LuaTableGetMethod<TKey, TValue>;
|
|
575
|
-
set: LuaTableSetMethod<TKey, TValue>;
|
|
576
|
-
has: LuaTableHasMethod<TKey>;
|
|
577
|
-
delete: LuaTableDeleteMethod<TKey>;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* A convenience type for working directly with a Lua table.
|
|
582
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
583
|
-
*
|
|
584
|
-
* @param TKey The type of the keys used to access the table.
|
|
585
|
-
* @param TValue The type of the values stored in the table.
|
|
586
|
-
*/
|
|
587
|
-
declare type LuaTableConstructor = (new <TKey extends AnyNotNil = AnyNotNil, TValue = any>() => LuaTable<
|
|
588
|
-
TKey,
|
|
589
|
-
TValue
|
|
590
|
-
>) &
|
|
591
|
-
LuaExtension<"TableNew">;
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* A convenience type for working directly with a Lua table.
|
|
595
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
596
|
-
*
|
|
597
|
-
* @param TKey The type of the keys used to access the table.
|
|
598
|
-
* @param TValue The type of the values stored in the table.
|
|
599
|
-
*/
|
|
600
|
-
declare const LuaTable: LuaTableConstructor;
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* A convenience type for working directly with a Lua table, used as a map.
|
|
604
|
-
*
|
|
605
|
-
* This differs from LuaTable in that the `get` method may return `nil`.
|
|
606
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
607
|
-
* @param K The type of the keys used to access the table.
|
|
608
|
-
* @param V The type of the values stored in the table.
|
|
609
|
-
*/
|
|
610
|
-
declare interface LuaMap<K extends AnyNotNil = AnyNotNil, V = any> extends LuaPairsIterable<K, V> {
|
|
611
|
-
get: LuaTableGetMethod<K, V | undefined>;
|
|
612
|
-
set: LuaTableSetMethod<K, V>;
|
|
613
|
-
has: LuaTableHasMethod<K>;
|
|
614
|
-
delete: LuaTableDeleteMethod<K>;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* A convenience type for working directly with a Lua table, used as a map.
|
|
619
|
-
*
|
|
620
|
-
* This differs from LuaTable in that the `get` method may return `nil`.
|
|
621
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
622
|
-
* @param K The type of the keys used to access the table.
|
|
623
|
-
* @param V The type of the values stored in the table.
|
|
624
|
-
*/
|
|
625
|
-
declare const LuaMap: (new <K extends AnyNotNil = AnyNotNil, V = any>() => LuaMap<K, V>) & LuaExtension<"TableNew">;
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* Readonly version of {@link LuaMap}.
|
|
629
|
-
*
|
|
630
|
-
* @param K The type of the keys used to access the table.
|
|
631
|
-
* @param V The type of the values stored in the table.
|
|
632
|
-
*/
|
|
633
|
-
declare interface ReadonlyLuaMap<K extends AnyNotNil = AnyNotNil, V = any> extends LuaPairsIterable<K, V> {
|
|
634
|
-
get: LuaTableGetMethod<K, V | undefined>;
|
|
635
|
-
has: LuaTableHasMethod<K>;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* A convenience type for working directly with a Lua table, used as a set.
|
|
640
|
-
*
|
|
641
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
642
|
-
* @param T The type of the keys used to access the table.
|
|
643
|
-
*/
|
|
644
|
-
declare interface LuaSet<T extends AnyNotNil = AnyNotNil> extends LuaPairsKeyIterable<T> {
|
|
645
|
-
add: LuaTableAddKeyMethod<T>;
|
|
646
|
-
has: LuaTableHasMethod<T>;
|
|
647
|
-
delete: LuaTableDeleteMethod<T>;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* A convenience type for working directly with a Lua table, used as a set.
|
|
652
|
-
*
|
|
653
|
-
* For more information see: https://typescripttolua.github.io/docs/advanced/language-extensions
|
|
654
|
-
* @param T The type of the keys used to access the table.
|
|
655
|
-
*/
|
|
656
|
-
declare const LuaSet: (new <T extends AnyNotNil = AnyNotNil>() => LuaSet<T>) & LuaExtension<"TableNew">;
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* Readonly version of {@link LuaSet}.
|
|
660
|
-
*
|
|
661
|
-
* @param T The type of the keys used to access the table.
|
|
662
|
-
*/
|
|
663
|
-
declare interface ReadonlyLuaSet<T extends AnyNotNil = AnyNotNil> extends LuaPairsKeyIterable<T> {
|
|
664
|
-
has: LuaTableHasMethod<T>;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
interface ObjectConstructor {
|
|
668
|
-
/** Returns an array of keys of an object, when iterated with `pairs`. */
|
|
669
|
-
keys<K>(o: LuaPairsIterable<K, any> | LuaPairsKeyIterable<K>): K[];
|
|
670
|
-
|
|
671
|
-
/** Returns an array of values of an object, when iterated with `pairs`. */
|
|
672
|
-
values<V>(o: LuaPairsIterable<any, V>): V[];
|
|
673
|
-
|
|
674
|
-
/** Returns an array of key/values of an object, when iterated with `pairs`. */
|
|
675
|
-
entries<K, V>(o: LuaPairsIterable<K, V>): Array<[K, V]>;
|
|
676
|
-
}
|