Allows retyping of functions. Useful for calling functions with hidden parameters (for recursion).
function someFunc(someParam: string) { const isRecursiveCall: boolean = arguments[1] ?? false const self = someFunc as any as AddParameters<typeof someFunc, [typeof isRecursiveCall]> // no error self(someParam, true)} Copy
function someFunc(someParam: string) { const isRecursiveCall: boolean = arguments[1] ?? false const self = someFunc as any as AddParameters<typeof someFunc, [typeof isRecursiveCall]> // no error self(someParam, true)}
Allows retyping of functions. Useful for calling functions with hidden parameters (for recursion).