Show alias for method in IntelliSense in TypeScript as method instead of property

357 views Asked by At

I trying to create a class in TypeScript in Visual Studio 2013 with method func1 with alias func1_Alias and show both in IntelliSense as methods, but IntelliSense shows alias as property instead of method. I can't found a way to show my alias func1_Alias as method in IntelliSense except:

func1_alias(...args:any[]){
   return this.func1.call(this, args);
}

But this way creates another function instead of using the same function. It's mean that func1 === func1_Alias => false.

IntelliSense for function IntelliSense for property

1

There are 1 answers

0
Ryan Cavanaugh On

func1_alias is a property, not a method. It lives on the instance of the class, not the prototype. There isn't a way to tell Intellisense to lie about what the type of the object is.