Search Terms
Suggestion
i don't know what is better name for ITSOverwriteThisFunction
interfaceFunction2extendsFunction{bind<Textendsany,Fextends(...args: any[])=>any>(this: F,thisArg: T, ...argArray: any[]): ITSOverwriteThisFunction<T,F>;}exporttypeITSOverwriteThisFunction<Textendsany,Fextends(...args: any[])=>any>=(this: T, ...args: Parameters<F>)=>ReturnType<F>Use Cases
- we can now let
fn.bind, know who is this
problem: current typescript not support overload function, so this has limit
Examples
this examples looks so stupid, but i don't know how to make look better
exportinterfacet4extendsFunction2{(): string}exportdeclarelett5: t4exportlett6=t5.bind([]asstring[])t6=function(){this.includes('')// => this is string[]return''}Checklist
My suggestion meets these guidelines:
Search Terms
Suggestion
i don't know what is better name for
ITSOverwriteThisFunctionUse Cases
fn.bind, know who isthisExamples
Checklist
My suggestion meets these guidelines: