Manaus Manaus - 1 year ago 141
TypeScript Question

Aliasing a class method in definition

I'm trying to make a typing definition file for Mootools, namely the aliasing of

. I made a interface for
, which is

interface Document {
id(el: string): Element;

In JQuery.d.ts
is aliasing the JQuery object, how can I alias an object method?


Answer Source

The 'aliasing' is performed by the implementation.

In the definition, simply declare the function you want to expose, for example

declare/export function $(el: string): Element;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download