diff --git a/src/lib/scripthost.d.ts b/src/lib/scripthost.d.ts index bec8be3173506..1fbd185949f26 100644 --- a/src/lib/scripthost.d.ts +++ b/src/lib/scripthost.d.ts @@ -201,10 +201,18 @@ declare var WScript: { Sleep(intTime: number): void; }; +/** + * Represents an Automation SAFEARRAY + */ +declare class SafeArray { + private constructor(); + private SafeArray_typekey: SafeArray; +} + /** * Allows enumerating over a COM collection, which may not have indexed item access. */ -interface Enumerator { +interface Enumerator { /** * Returns true if the current item is the last one in the collection, or the collection is empty, * or the current item is undefined. @@ -230,8 +238,9 @@ interface Enumerator { } interface EnumeratorConstructor { - new (collection: any): Enumerator; - new (collection: any): Enumerator; + new (safearray: SafeArray): Enumerator; + new (collection: { Item(index: any): T }): Enumerator; + new (collection: any): Enumerator; } declare var Enumerator: EnumeratorConstructor; @@ -239,7 +248,7 @@ declare var Enumerator: EnumeratorConstructor; /** * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. */ -interface VBArray { +interface VBArray { /** * Returns the number of dimensions (1-based). */ @@ -271,8 +280,7 @@ interface VBArray { } interface VBArrayConstructor { - new (safeArray: any): VBArray; - new (safeArray: any): VBArray; + new (safeArray: SafeArray): VBArray; } declare var VBArray: VBArrayConstructor; @@ -280,7 +288,10 @@ declare var VBArray: VBArrayConstructor; /** * Automation date (VT_DATE) */ -interface VarDate { } +declare class VarDate { + private constructor(); + private VarDate_typekey: VarDate; +} interface DateConstructor { new (vd: VarDate): Date;