We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Narrow
this
declare global { interface Array<T> { fn<A>(this: Narrow<A>): A } } // expected type: ['foo', 'bar'] // actual type: string[] const foo = ['foo', 'bar'].fn()
type is ['foo', 'bar']
['foo', 'bar']
i'm trying to improve some of the builtin types using ts-toolbelt, but can only do so using a this parameter
declare global { interface ReadonlyArray<T> { join<Arr extends ReadonlyArray<Literal>, D extends string = ','>( this: Arr, delimiter?: D ): Join<Arr, D> } interface Array<T> extends ReadonlyArray<T> { join<Arr extends ReadonlyArray<Literal>, D extends string = ','>( this: Arr, delimiter?: D ): Join<Arr, D> } }
see microsoft/TypeScript#44268 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
馃悶 Bug Report
Reproduce the bug
Expected behavior
type is
['foo', 'bar']
Additional context
i'm trying to improve some of the builtin types using ts-toolbelt, but can only do so using a
this
parametersee microsoft/TypeScript#44268 (comment)
The text was updated successfully, but these errors were encountered: