-
Notifications
You must be signed in to change notification settings - Fork 63
/
index.d.ts
52 lines (45 loc) · 1.5 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
declare module 'winax' {
export class Object {
constructor(id: string, options?: ActiveXOptions);
// Define properties typically found on COM objects
__id?: string;
__value?: any;
__type?: any[];
__methods?: string[];
__vars?: string[];
// Define general method signatures if any known
[key: string]: any;
}
export interface ActiveXOptions {
activate?: boolean; // Allow activate existing object instance
getobject?: boolean; // Allow using the name of the file in the ROT
type?: boolean; // Allow using type information
}
export class Variant {
constructor(value?: any, type?: VariantType);
assign(value: any): void;
cast(type: VariantType): void;
clear(): void;
valueOf(): any;
}
export type VariantType =
| 'int' | 'uint' | 'int8' | 'char' | 'uint8' | 'uchar' | 'byte'
| 'int16' | 'short' | 'uint16' | 'ushort'
| 'int32' | 'uint32'
| 'int64' | 'long' | 'uint64' | 'ulong'
| 'currency' | 'float' | 'double' | 'string'
| 'date' | 'decimal' | 'variant' | 'null' | 'empty'
| 'byref' | 'pbyref';
export function cast(value: any, type: VariantType): any;
// Utility function to release COM objects
export function release(...objects: any[]): void;
}
declare global {
function ActiveXObject(id: string, options?: ActiveXObjectOptions): any;
function ActiveXObject(obj: Record<string, any>): any;
interface ActiveXObjectOptions {
activate?: boolean;
getobject?: boolean;
type?: boolean;
}
}