in the post of "Typescript extend String Static", I got the a few that we can extend existing baseclass of typescript, for example, add new method
interface StringConstructor {
isNullOrEmpty(str:string):boolean;
}
String.isNullOrEmpty = (str:string) => !str;
it really does work. but for generic interface, I met problems. for example, I need to add new method contain() in Array. I use the following code:
//1
interface Array<T> {
contain(item: T): boolean;
}
//2
?????? = (item: T) => {
// ....
return true;
};
after step1, in VS intellisense does and pop up contain method, but where can I do implement method?