strict-ts-lib-v5.4 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/libs/decorators/index.d.ts +364 -0
- package/libs/decorators/legacy/index.d.ts +19 -0
- package/libs/dom/asynciterable/index.d.ts +14 -0
- package/libs/dom/index.d.ts +35333 -0
- package/libs/dom/iterable/index.d.ts +748 -0
- package/libs/es2015/collection/index.d.ts +148 -0
- package/libs/es2015/core/index.d.ts +574 -0
- package/libs/es2015/generator/index.d.ts +65 -0
- package/libs/es2015/index.d.ts +12 -0
- package/libs/es2015/iterable/index.d.ts +524 -0
- package/libs/es2015/promise/index.d.ts +74 -0
- package/libs/es2015/proxy/index.d.ts +131 -0
- package/libs/es2015/reflect/index.d.ts +145 -0
- package/libs/es2015/symbol/index.d.ts +30 -0
- package/libs/es2015/symbol-wellknown/index.d.ts +331 -0
- package/libs/es2016/array-include/index.d.ts +115 -0
- package/libs/es2016/full/index.d.ts +7 -0
- package/libs/es2016/index.d.ts +5 -0
- package/libs/es2016/intl/index.d.ts +15 -0
- package/libs/es2017/date/index.d.ts +23 -0
- package/libs/es2017/full/index.d.ts +7 -0
- package/libs/es2017/index.d.ts +9 -0
- package/libs/es2017/intl/index.d.ts +28 -0
- package/libs/es2017/object/index.d.ts +115 -0
- package/libs/es2017/sharedmemory/index.d.ts +244 -0
- package/libs/es2017/string/index.d.ts +29 -0
- package/libs/es2017/typedarrays/index.d.ts +37 -0
- package/libs/es2018/asyncgenerator/index.d.ts +69 -0
- package/libs/es2018/asynciterable/index.d.ts +31 -0
- package/libs/es2018/full/index.d.ts +8 -0
- package/libs/es2018/index.d.ts +8 -0
- package/libs/es2018/intl/index.d.ts +103 -0
- package/libs/es2018/promise/index.d.ts +14 -0
- package/libs/es2018/regexp/index.d.ts +21 -0
- package/libs/es2019/array/index.d.ts +94 -0
- package/libs/es2019/full/index.d.ts +8 -0
- package/libs/es2019/index.d.ts +8 -0
- package/libs/es2019/intl/index.d.ts +7 -0
- package/libs/es2019/object/index.d.ts +143 -0
- package/libs/es2019/string/index.d.ts +21 -0
- package/libs/es2019/symbol/index.d.ts +8 -0
- package/libs/es2020/bigint/index.d.ts +833 -0
- package/libs/es2020/date/index.d.ts +35 -0
- package/libs/es2020/full/index.d.ts +8 -0
- package/libs/es2020/index.d.ts +11 -0
- package/libs/es2020/intl/index.d.ts +473 -0
- package/libs/es2020/number/index.d.ts +15 -0
- package/libs/es2020/promise/index.d.ts +37 -0
- package/libs/es2020/sharedmemory/index.d.ts +119 -0
- package/libs/es2020/string/index.d.ts +30 -0
- package/libs/es2020/symbol-wellknown/index.d.ts +21 -0
- package/libs/es2021/full/index.d.ts +8 -0
- package/libs/es2021/index.d.ts +7 -0
- package/libs/es2021/intl/index.d.ts +161 -0
- package/libs/es2021/promise/index.d.ts +34 -0
- package/libs/es2021/string/index.d.ts +20 -0
- package/libs/es2021/weakref/index.d.ts +60 -0
- package/libs/es2022/array/index.d.ts +105 -0
- package/libs/es2022/error/index.d.ts +57 -0
- package/libs/es2022/full/index.d.ts +8 -0
- package/libs/es2022/index.d.ts +10 -0
- package/libs/es2022/intl/index.d.ts +112 -0
- package/libs/es2022/object/index.d.ts +41 -0
- package/libs/es2022/regexp/index.d.ts +23 -0
- package/libs/es2022/sharedmemory/index.d.ts +37 -0
- package/libs/es2022/string/index.d.ts +9 -0
- package/libs/es2023/array/index.d.ts +906 -0
- package/libs/es2023/collection/index.d.ts +5 -0
- package/libs/es2023/full/index.d.ts +8 -0
- package/libs/es2023/index.d.ts +5 -0
- package/libs/es5/index.d.ts +5738 -0
- package/libs/es6/index.d.ts +7 -0
- package/libs/esnext/collection/index.d.ts +13 -0
- package/libs/esnext/decorators/index.d.ts +12 -0
- package/libs/esnext/disposable/index.d.ts +169 -0
- package/libs/esnext/full/index.d.ts +8 -0
- package/libs/esnext/index.d.ts +9 -0
- package/libs/esnext/intl/index.d.ts +15 -0
- package/libs/esnext/object/index.d.ts +13 -0
- package/libs/esnext/promise/index.d.ts +19 -0
- package/libs/scripthost/index.d.ts +310 -0
- package/libs/webworker/asynciterable/index.d.ts +14 -0
- package/libs/webworker/importscripts/index.d.ts +7 -0
- package/libs/webworker/index.d.ts +11758 -0
- package/libs/webworker/iterable/index.d.ts +543 -0
- package/package.json +23 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface MapConstructor {
|
|
4
|
+
/**
|
|
5
|
+
* Groups members of an iterable according to the return value of the passed callback.
|
|
6
|
+
* @param items An iterable.
|
|
7
|
+
* @param keySelector A callback which will be invoked for each item in items.
|
|
8
|
+
*/
|
|
9
|
+
groupBy<K, T>(
|
|
10
|
+
items: Iterable<T>,
|
|
11
|
+
keySelector: (item: T, index: number) => K,
|
|
12
|
+
): Map<K, T[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2015.symbol" />
|
|
4
|
+
/// <reference lib="decorators" />
|
|
5
|
+
|
|
6
|
+
interface SymbolConstructor {
|
|
7
|
+
readonly metadata: unique symbol;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Function {
|
|
11
|
+
readonly [Symbol.metadata]: DecoratorMetadata | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2015.symbol" />
|
|
4
|
+
|
|
5
|
+
interface SymbolConstructor {
|
|
6
|
+
/**
|
|
7
|
+
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
8
|
+
*/
|
|
9
|
+
readonly dispose: unique symbol;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
|
13
|
+
*/
|
|
14
|
+
readonly asyncDispose: unique symbol;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Disposable {
|
|
18
|
+
[Symbol.dispose](): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface AsyncDisposable {
|
|
22
|
+
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface SuppressedError extends Error {
|
|
26
|
+
readonly error: unknown;
|
|
27
|
+
readonly suppressed: unknown;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface SuppressedErrorConstructor {
|
|
31
|
+
new (error: unknown, suppressed: unknown, message?: string): SuppressedError;
|
|
32
|
+
(error: unknown, suppressed: unknown, message?: string): SuppressedError;
|
|
33
|
+
readonly prototype: SuppressedError;
|
|
34
|
+
}
|
|
35
|
+
declare const SuppressedError: SuppressedErrorConstructor;
|
|
36
|
+
|
|
37
|
+
interface DisposableStack {
|
|
38
|
+
/**
|
|
39
|
+
* Returns a value indicating whether this stack has been disposed.
|
|
40
|
+
*/
|
|
41
|
+
readonly disposed: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Disposes each resource in the stack in the reverse order that they were added.
|
|
44
|
+
*/
|
|
45
|
+
dispose(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Adds a disposable resource to the stack, returning the resource.
|
|
48
|
+
* @param value The resource to add. `null` and `undefined` will not be added, but will be returned.
|
|
49
|
+
* @returns The provided {@link value}.
|
|
50
|
+
*/
|
|
51
|
+
use<T extends Disposable | null | undefined>(value: T): T;
|
|
52
|
+
/**
|
|
53
|
+
* Adds a value and associated disposal callback as a resource to the stack.
|
|
54
|
+
* @param value The value to add.
|
|
55
|
+
* @param onDispose The callback to use in place of a `[Symbol.dispose]()` method. Will be invoked with `value`
|
|
56
|
+
* as the first parameter.
|
|
57
|
+
* @returns The provided {@link value}.
|
|
58
|
+
*/
|
|
59
|
+
adopt<T>(value: T, onDispose: (value: T) => void): T;
|
|
60
|
+
/**
|
|
61
|
+
* Adds a callback to be invoked when the stack is disposed.
|
|
62
|
+
*/
|
|
63
|
+
defer(onDispose: () => void): void;
|
|
64
|
+
/**
|
|
65
|
+
* Move all resources out of this stack and into a new `DisposableStack`, and marks this stack as disposed.
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* class C {
|
|
69
|
+
* #res1: Disposable;
|
|
70
|
+
* #res2: Disposable;
|
|
71
|
+
* #disposables: DisposableStack;
|
|
72
|
+
* constructor() {
|
|
73
|
+
* // stack will be disposed when exiting constructor for any reason
|
|
74
|
+
* using stack = new DisposableStack();
|
|
75
|
+
*
|
|
76
|
+
* // get first resource
|
|
77
|
+
* this.#res1 = stack.use(getResource1());
|
|
78
|
+
*
|
|
79
|
+
* // get second resource. If this fails, both `stack` and `#res1` will be disposed.
|
|
80
|
+
* this.#res2 = stack.use(getResource2());
|
|
81
|
+
*
|
|
82
|
+
* // all operations succeeded, move resources out of `stack` so that they aren't disposed
|
|
83
|
+
* // when constructor exits
|
|
84
|
+
* this.#disposables = stack.move();
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* [Symbol.dispose]() {
|
|
88
|
+
* this.#disposables.dispose();
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
move(): DisposableStack;
|
|
94
|
+
[Symbol.dispose](): void;
|
|
95
|
+
readonly [Symbol.toStringTag]: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface DisposableStackConstructor {
|
|
99
|
+
new (): DisposableStack;
|
|
100
|
+
readonly prototype: DisposableStack;
|
|
101
|
+
}
|
|
102
|
+
declare const DisposableStack: DisposableStackConstructor;
|
|
103
|
+
|
|
104
|
+
interface AsyncDisposableStack {
|
|
105
|
+
/**
|
|
106
|
+
* Returns a value indicating whether this stack has been disposed.
|
|
107
|
+
*/
|
|
108
|
+
readonly disposed: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Disposes each resource in the stack in the reverse order that they were added.
|
|
111
|
+
*/
|
|
112
|
+
disposeAsync(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Adds a disposable resource to the stack, returning the resource.
|
|
115
|
+
* @param value The resource to add. `null` and `undefined` will not be added, but will be returned.
|
|
116
|
+
* @returns The provided {@link value}.
|
|
117
|
+
*/
|
|
118
|
+
use<T extends AsyncDisposable | Disposable | null | undefined>(value: T): T;
|
|
119
|
+
/**
|
|
120
|
+
* Adds a value and associated disposal callback as a resource to the stack.
|
|
121
|
+
* @param value The value to add.
|
|
122
|
+
* @param onDisposeAsync The callback to use in place of a `[Symbol.asyncDispose]()` method. Will be invoked with `value`
|
|
123
|
+
* as the first parameter.
|
|
124
|
+
* @returns The provided {@link value}.
|
|
125
|
+
*/
|
|
126
|
+
adopt<T>(value: T, onDisposeAsync: (value: T) => PromiseLike<void> | void): T;
|
|
127
|
+
/**
|
|
128
|
+
* Adds a callback to be invoked when the stack is disposed.
|
|
129
|
+
*/
|
|
130
|
+
defer(onDisposeAsync: () => PromiseLike<void> | void): void;
|
|
131
|
+
/**
|
|
132
|
+
* Move all resources out of this stack and into a new `DisposableStack`, and marks this stack as disposed.
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* class C {
|
|
136
|
+
* #res1: Disposable;
|
|
137
|
+
* #res2: Disposable;
|
|
138
|
+
* #disposables: DisposableStack;
|
|
139
|
+
* constructor() {
|
|
140
|
+
* // stack will be disposed when exiting constructor for any reason
|
|
141
|
+
* using stack = new DisposableStack();
|
|
142
|
+
*
|
|
143
|
+
* // get first resource
|
|
144
|
+
* this.#res1 = stack.use(getResource1());
|
|
145
|
+
*
|
|
146
|
+
* // get second resource. If this fails, both `stack` and `#res1` will be disposed.
|
|
147
|
+
* this.#res2 = stack.use(getResource2());
|
|
148
|
+
*
|
|
149
|
+
* // all operations succeeded, move resources out of `stack` so that they aren't disposed
|
|
150
|
+
* // when constructor exits
|
|
151
|
+
* this.#disposables = stack.move();
|
|
152
|
+
* }
|
|
153
|
+
*
|
|
154
|
+
* [Symbol.dispose]() {
|
|
155
|
+
* this.#disposables.dispose();
|
|
156
|
+
* }
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
move(): AsyncDisposableStack;
|
|
161
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
162
|
+
readonly [Symbol.toStringTag]: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface AsyncDisposableStackConstructor {
|
|
166
|
+
new (): AsyncDisposableStack;
|
|
167
|
+
readonly prototype: AsyncDisposableStack;
|
|
168
|
+
}
|
|
169
|
+
declare const AsyncDisposableStack: AsyncDisposableStackConstructor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="esnext" />
|
|
4
|
+
/// <reference lib="dom" />
|
|
5
|
+
/// <reference lib="webworker.importscripts" />
|
|
6
|
+
/// <reference lib="scripthost" />
|
|
7
|
+
/// <reference lib="dom.iterable" />
|
|
8
|
+
/// <reference lib="dom.asynciterable" />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2023" />
|
|
4
|
+
/// <reference lib="esnext.intl" />
|
|
5
|
+
/// <reference lib="esnext.decorators" />
|
|
6
|
+
/// <reference lib="esnext.disposable" />
|
|
7
|
+
/// <reference lib="esnext.promise" />
|
|
8
|
+
/// <reference lib="esnext.object" />
|
|
9
|
+
/// <reference lib="esnext.collection" />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
declare namespace Intl {
|
|
4
|
+
interface NumberRangeFormatPart extends NumberFormatPart {
|
|
5
|
+
readonly source: 'startRange' | 'endRange' | 'shared';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface NumberFormat {
|
|
9
|
+
formatRange(start: number | bigint, end: number | bigint): string;
|
|
10
|
+
formatRangeToParts(
|
|
11
|
+
start: number | bigint,
|
|
12
|
+
end: number | bigint,
|
|
13
|
+
): NumberRangeFormatPart[];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface ObjectConstructor {
|
|
4
|
+
/**
|
|
5
|
+
* Groups members of an iterable according to the return value of the passed callback.
|
|
6
|
+
* @param items An iterable.
|
|
7
|
+
* @param keySelector A callback which will be invoked for each item in items.
|
|
8
|
+
*/
|
|
9
|
+
groupBy<K extends PropertyKey, T>(
|
|
10
|
+
items: Iterable<T>,
|
|
11
|
+
keySelector: (item: T, index: number) => K,
|
|
12
|
+
): Partial<import('ts-type-forge').MutableRecord<K, T[]>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface PromiseWithResolvers<T> {
|
|
4
|
+
readonly promise: Promise<T>;
|
|
5
|
+
readonly resolve: (value: T | PromiseLike<T>) => void;
|
|
6
|
+
readonly reject: (reason?: unknown) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface PromiseConstructor {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new Promise and returns it in an object, along with its resolve and reject functions.
|
|
12
|
+
* @returns An object with the properties `promise`, `resolve`, and `reject`.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* const { promise, resolve, reject } = Promise.withResolvers<T>();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
withResolvers<T>(): PromiseWithResolvers<T>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/////////////////////////////
|
|
4
|
+
/// Windows Script Host APIS
|
|
5
|
+
/////////////////////////////
|
|
6
|
+
|
|
7
|
+
interface ActiveXObject {
|
|
8
|
+
new (s: string): unknown;
|
|
9
|
+
}
|
|
10
|
+
declare const ActiveXObject: ActiveXObject;
|
|
11
|
+
|
|
12
|
+
interface ITextWriter {
|
|
13
|
+
Write(s: string): void;
|
|
14
|
+
WriteLine(s: string): void;
|
|
15
|
+
Close(): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface TextStreamBase {
|
|
19
|
+
/**
|
|
20
|
+
* The column number of the current character position in an input stream.
|
|
21
|
+
*/
|
|
22
|
+
readonly Column: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The current line number in an input stream.
|
|
26
|
+
*/
|
|
27
|
+
readonly Line: number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Closes a text stream.
|
|
31
|
+
* It is not necessary to close standard streams; they close automatically when the process ends. If
|
|
32
|
+
* you close a standard stream, be aware that any other pointers to that standard stream become invalid.
|
|
33
|
+
*/
|
|
34
|
+
Close(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface TextStreamWriter extends TextStreamBase {
|
|
38
|
+
/**
|
|
39
|
+
* Sends a string to an output stream.
|
|
40
|
+
*/
|
|
41
|
+
Write(s: string): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Sends a specified number of blank lines (newline characters) to an output stream.
|
|
45
|
+
*/
|
|
46
|
+
WriteBlankLines(intLines: number): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sends a string followed by a newline character to an output stream.
|
|
50
|
+
*/
|
|
51
|
+
WriteLine(s: string): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface TextStreamReader extends TextStreamBase {
|
|
55
|
+
/**
|
|
56
|
+
* Returns a specified number of characters from an input stream, starting at the current pointer position.
|
|
57
|
+
* Does not return until the ENTER key is pressed.
|
|
58
|
+
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
|
|
59
|
+
*/
|
|
60
|
+
Read(characters: number): string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Returns all characters from an input stream.
|
|
64
|
+
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
|
|
65
|
+
*/
|
|
66
|
+
ReadAll(): string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns an entire line from an input stream.
|
|
70
|
+
* Although this method extracts the newline character, it does not add it to the returned string.
|
|
71
|
+
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
|
|
72
|
+
*/
|
|
73
|
+
ReadLine(): string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Skips a specified number of characters when reading from an input text stream.
|
|
77
|
+
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
|
|
78
|
+
* @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
|
|
79
|
+
*/
|
|
80
|
+
Skip(characters: number): void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Skips the next line when reading from an input text stream.
|
|
84
|
+
* Can only be used on a stream in reading mode, not writing or appending mode.
|
|
85
|
+
*/
|
|
86
|
+
SkipLine(): void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Indicates whether the stream pointer position is at the end of a line.
|
|
90
|
+
*/
|
|
91
|
+
readonly AtEndOfLine: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Indicates whether the stream pointer position is at the end of a stream.
|
|
95
|
+
*/
|
|
96
|
+
readonly AtEndOfStream: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare const WScript: {
|
|
100
|
+
/**
|
|
101
|
+
* Outputs text to either a message box (under WScript.exe) or the command console window followed by
|
|
102
|
+
* a newline (under CScript.exe).
|
|
103
|
+
*/
|
|
104
|
+
Echo(s: unknown): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Exposes the write-only error output stream for the current script.
|
|
108
|
+
* Can be accessed only while using CScript.exe.
|
|
109
|
+
*/
|
|
110
|
+
readonly StdErr: TextStreamWriter;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Exposes the write-only output stream for the current script.
|
|
114
|
+
* Can be accessed only while using CScript.exe.
|
|
115
|
+
*/
|
|
116
|
+
readonly StdOut: TextStreamWriter;
|
|
117
|
+
readonly Arguments: { readonly length: number; Item(n: number): string };
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The full path of the currently running script.
|
|
121
|
+
*/
|
|
122
|
+
readonly ScriptFullName: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Forces the script to stop immediately, with an optional exit code.
|
|
126
|
+
*/
|
|
127
|
+
Quit(exitCode?: number): number;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The Windows Script Host build version number.
|
|
131
|
+
*/
|
|
132
|
+
readonly BuildVersion: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Fully qualified path of the host executable.
|
|
136
|
+
*/
|
|
137
|
+
readonly FullName: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets/sets the script mode - interactive(true) or batch(false).
|
|
141
|
+
*/
|
|
142
|
+
readonly Interactive: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The name of the host executable (WScript.exe or CScript.exe).
|
|
146
|
+
*/
|
|
147
|
+
readonly Name: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Path of the directory containing the host executable.
|
|
151
|
+
*/
|
|
152
|
+
readonly Path: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The filename of the currently running script.
|
|
156
|
+
*/
|
|
157
|
+
readonly ScriptName: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Exposes the read-only input stream for the current script.
|
|
161
|
+
* Can be accessed only while using CScript.exe.
|
|
162
|
+
*/
|
|
163
|
+
readonly StdIn: TextStreamReader;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Windows Script Host version
|
|
167
|
+
*/
|
|
168
|
+
readonly Version: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.
|
|
172
|
+
*/
|
|
173
|
+
ConnectObject(objEventSource: unknown, strPrefix: string): void;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Creates a COM object.
|
|
177
|
+
* @param strProgiID
|
|
178
|
+
* @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
|
|
179
|
+
*/
|
|
180
|
+
CreateObject(strProgID: string, strPrefix?: string): unknown;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Disconnects a COM object from its event sources.
|
|
184
|
+
*/
|
|
185
|
+
DisconnectObject(obj: unknown): void;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.
|
|
189
|
+
* @param strPathname Fully qualified path to the file containing the object persisted to disk.
|
|
190
|
+
* For objects in memory, pass a zero-length string.
|
|
191
|
+
* @param strProgID
|
|
192
|
+
* @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
|
|
193
|
+
*/
|
|
194
|
+
GetObject(
|
|
195
|
+
strPathname: string,
|
|
196
|
+
strProgID?: string,
|
|
197
|
+
strPrefix?: string,
|
|
198
|
+
): unknown;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Suspends script execution for a specified length of time, then continues execution.
|
|
202
|
+
* @param intTime Interval (in milliseconds) to suspend script execution.
|
|
203
|
+
*/
|
|
204
|
+
Sleep(intTime: number): void;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* WSH is an alias for WScript under Windows Script Host
|
|
209
|
+
*/
|
|
210
|
+
declare const WSH: typeof WScript;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Represents an Automation SAFEARRAY
|
|
214
|
+
*/
|
|
215
|
+
declare class SafeArray<T = unknown> {
|
|
216
|
+
private constructor();
|
|
217
|
+
private SafeArray_typekey: SafeArray<T>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Allows enumerating over a COM collection, which may not have indexed item access.
|
|
222
|
+
*/
|
|
223
|
+
interface Enumerator<T = unknown> {
|
|
224
|
+
/**
|
|
225
|
+
* Returns true if the current item is the last one in the collection, or the collection is empty,
|
|
226
|
+
* or the current item is undefined.
|
|
227
|
+
*/
|
|
228
|
+
atEnd(): boolean;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Returns the current item in the collection
|
|
232
|
+
*/
|
|
233
|
+
item(): T;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Resets the current item in the collection to the first item. If there are no items in the collection,
|
|
237
|
+
* the current item is set to undefined.
|
|
238
|
+
*/
|
|
239
|
+
moveFirst(): void;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Moves the current item to the next item in the collection. If the enumerator is at the end of
|
|
243
|
+
* the collection or the collection is empty, the current item is set to undefined.
|
|
244
|
+
*/
|
|
245
|
+
moveNext(): void;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
interface EnumeratorConstructor {
|
|
249
|
+
new <T = unknown>(safearray: SafeArray<T>): Enumerator<T>;
|
|
250
|
+
new <T = unknown>(collection: { Item(index: unknown): T }): Enumerator<T>;
|
|
251
|
+
new <T = unknown>(collection: unknown): Enumerator<T>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare const Enumerator: EnumeratorConstructor;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.
|
|
258
|
+
*/
|
|
259
|
+
interface VBArray<T = unknown> {
|
|
260
|
+
/**
|
|
261
|
+
* Returns the number of dimensions (1-based).
|
|
262
|
+
*/
|
|
263
|
+
dimensions(): number;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Takes an index for each dimension in the array, and returns the item at the corresponding location.
|
|
267
|
+
*/
|
|
268
|
+
getItem(dimension1Index: number, ...dimensionNIndexes: readonly number[]): T;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Returns the smallest available index for a given dimension.
|
|
272
|
+
* @param dimension 1-based dimension (defaults to 1)
|
|
273
|
+
*/
|
|
274
|
+
lbound(dimension?: number): number;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Returns the largest available index for a given dimension.
|
|
278
|
+
* @param dimension 1-based dimension (defaults to 1)
|
|
279
|
+
*/
|
|
280
|
+
ubound(dimension?: number): number;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,
|
|
284
|
+
* each successive dimension is appended to the end of the array.
|
|
285
|
+
* Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]
|
|
286
|
+
*/
|
|
287
|
+
toArray(): T[];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
interface VBArrayConstructor {
|
|
291
|
+
new <T = unknown>(safeArray: SafeArray<T>): VBArray<T>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
declare const VBArray: VBArrayConstructor;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Automation date (VT_DATE)
|
|
298
|
+
*/
|
|
299
|
+
declare class VarDate {
|
|
300
|
+
private constructor();
|
|
301
|
+
private VarDate_typekey: VarDate;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface DateConstructor {
|
|
305
|
+
new (vd: VarDate): Date;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
interface Date {
|
|
309
|
+
readonly getVarDate: () => VarDate;
|
|
310
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/////////////////////////////
|
|
4
|
+
/// Worker Async Iterable APIs
|
|
5
|
+
/////////////////////////////
|
|
6
|
+
|
|
7
|
+
interface FileSystemDirectoryHandle {
|
|
8
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<
|
|
9
|
+
readonly [string, FileSystemHandle]
|
|
10
|
+
>;
|
|
11
|
+
entries(): AsyncIterableIterator<readonly [string, FileSystemHandle]>;
|
|
12
|
+
keys(): AsyncIterableIterator<string>;
|
|
13
|
+
values(): AsyncIterableIterator<FileSystemHandle>;
|
|
14
|
+
}
|