lua-types
Advanced tools
Comparing version 2.10.0 to 2.10.1
@@ -195,6 +195,13 @@ // Based on https://www.lua.org/manual/5.3/manual.html#6.10 | ||
*/ | ||
function setmetatable<T, TIndex>( | ||
function setmetatable< | ||
T extends object, | ||
TIndex extends object | ((this: T, key: any) => any) | undefined = undefined | ||
>( | ||
value: T, | ||
table: LuaMetatable<T & TIndex, TIndex> | null | undefined | ||
): T & TIndex; | ||
table?: LuaMetatable<T, TIndex> | null | ||
): TIndex extends (this: T, key: infer TKey) => infer TValue | ||
? T & { [K in TKey & string]: TValue } | ||
: TIndex extends object | ||
? T & TIndex | ||
: T; | ||
@@ -201,0 +208,0 @@ /** |
// Based on https://www.lua.org/manual/5.3/manual.html#2.4 | ||
interface LuaMetatable<T, TIndex extends object | ((this: T, key: any) => any) | undefined> { | ||
interface LuaMetatable< | ||
T, | ||
TIndex extends object | ((this: T, key: any) => any) | undefined = | ||
| object | ||
| ((this: T, key: any) => any) | ||
| undefined | ||
> { | ||
/** | ||
@@ -5,0 +11,0 @@ * the addition (+) operation. If any operand for an addition is not a number |
{ | ||
"name": "lua-types", | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"description": "TypeScript definitions for Lua standard library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
129811
2873
0