If I've defined an interface corresponding to an Automation object:
module Scripting {
interface FileSystemObject {
BuildPath(Path: string,Name: string): string
FileExists(FileSpec: string): boolean
//other members ...
}
}
it should be possible to get the type as said interface, using type inference and specialized overloads:
var fso = new ActiveXObject('Scripting.FileSystemObject');
This could be done by having ActiveXObject implement a named interface in lib.d.ts:
interface ActiveXObject {
new (s: string): any;
}
declare var ActiveXObject: ActiveXObject;
Then, other modules could add the additional specialized overloads:
interface ActiveXObject {
new (s: 'Scripting.FileSystemObject'): Scripting.FileSystemObject;
}
If I've defined an interface corresponding to an Automation object:
it should be possible to get the type as said interface, using type inference and specialized overloads:
This could be done by having
ActiveXObjectimplement a named interface inlib.d.ts:Then, other modules could add the additional specialized overloads: