declare module "puerts" { import CSharp from "csharp"; function $ref(x? : T) : CSharp.$Ref; function $unref(x: CSharp.$Ref) : T; function $set(x: CSharp.$Ref, val:T) : void; function $promise(x: CSharp.$Task) : Promise; function $generic any> (genericType :T, ...genericArguments: (new (...args:any[]) => any)[]) : T; function $typeof(x : new (...args:any[]) => any) : CSharp.System.Type; function $extension(c : Function, e: Function) : void; function on(eventType: string, listener: Function, prepend?: boolean) : void; function off(eventType: string, listener: Function) : void; function emit(eventType: string, ...args:any[]) : boolean; } declare function require(name: string): any;