Comparing version 2.3.0 to 2.3.1
@@ -119,24 +119,11 @@ // Based on https://www.lua.org/manual/5.3/manual.html#6.1 | ||
*/ | ||
declare function pcall<T extends (...args: any[]) => any>( | ||
f: T, | ||
...args: T extends (this: infer This, ...args: infer Args) => any | ||
? void extends This | ||
? Args | ||
: Args extends [infer T1] | ||
? [{} extends This ? any : This, T1] | ||
: Args extends [infer T1, infer T2] | ||
? [{} extends This ? any : This, T1, T2] | ||
: Args extends [infer T1, infer T2, infer T3] | ||
? [{} extends This ? any : This, T1, T2, T3] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4] | ||
? [{} extends This ? any : This, T1, T2, T3, T4] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5, infer T6] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5, T6] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5, infer T6, infer T7] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5, T6, T7] | ||
: [{} extends This ? any : This, ...Args[number][]] | ||
: never | ||
): [true, ReturnType<T>] | [false, string]; | ||
declare function pcall<This, Args extends any[], R>( | ||
f: (this: This, ...args: Args) => R, | ||
context: This, | ||
...args: Args | ||
): [true, R] | [false, string]; | ||
declare function pcall<A extends any[], R>( | ||
f: (this: void, ...args: A) => R, | ||
...args: A | ||
): [true, R] | [false, string]; | ||
@@ -143,0 +130,0 @@ /** |
{ | ||
"name": "lua-types", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "TypeScript definitions for Lua standard library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,25 +40,13 @@ /** @noSelfInFile */ | ||
*/ | ||
declare function xpcall<T extends (...args: any[]) => any, E>( | ||
f: T, | ||
declare function xpcall<This, Args extends any[], R, E>( | ||
f: (this: This, ...args: Args) => R, | ||
msgh: (err: any) => E, | ||
...args: T extends (this: infer This, ...args: infer Args) => any | ||
? void extends This | ||
? Args | ||
: Args extends [infer T1] | ||
? [{} extends This ? any : This, T1] | ||
: Args extends [infer T1, infer T2] | ||
? [{} extends This ? any : This, T1, T2] | ||
: Args extends [infer T1, infer T2, infer T3] | ||
? [{} extends This ? any : This, T1, T2, T3] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4] | ||
? [{} extends This ? any : This, T1, T2, T3, T4] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5, infer T6] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5, T6] | ||
: Args extends [infer T1, infer T2, infer T3, infer T4, infer T5, infer T6, infer T7] | ||
? [{} extends This ? any : This, T1, T2, T3, T4, T5, T6, T7] | ||
: [{} extends This ? any : This, ...Args[number][]] | ||
: never | ||
): [true, ReturnType<T>] | [false, E]; | ||
context: This, | ||
...args: Args | ||
): [true, R] | [false, E]; | ||
declare function xpcall<A extends any[], R, E>( | ||
f: (this: void, ...args: A) => R, | ||
msgh: (err: any) => E, | ||
...args: A | ||
): [true, R] | [false, E]; | ||
@@ -65,0 +53,0 @@ declare namespace debug { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117380
1990