strict-ts-lib-v5.9 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 +362 -0
- package/libs/decorators/legacy/index.d.ts +19 -0
- package/libs/dom/asynciterable/index.d.ts +41 -0
- package/libs/dom/index.d.ts +46522 -0
- package/libs/dom/iterable/index.d.ts +872 -0
- package/libs/es2015/collection/index.d.ts +148 -0
- package/libs/es2015/core/index.d.ts +647 -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 +660 -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/arraybuffer/index.d.ts +5 -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 +10 -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 +248 -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 +49 -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 +92 -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 +954 -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 +494 -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 +146 -0
- package/libs/es2020/string/index.d.ts +32 -0
- package/libs/es2020/symbol-wellknown/index.d.ts +29 -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 +62 -0
- package/libs/es2022/array/index.d.ts +105 -0
- package/libs/es2022/error/index.d.ts +59 -0
- package/libs/es2022/full/index.d.ts +8 -0
- package/libs/es2022/index.d.ts +9 -0
- package/libs/es2022/intl/index.d.ts +144 -0
- package/libs/es2022/object/index.d.ts +41 -0
- package/libs/es2022/regexp/index.d.ts +23 -0
- package/libs/es2022/string/index.d.ts +9 -0
- package/libs/es2023/array/index.d.ts +915 -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 +6 -0
- package/libs/es2023/intl/index.d.ts +106 -0
- package/libs/es2024/arraybuffer/index.d.ts +52 -0
- package/libs/es2024/collection/index.d.ts +13 -0
- package/libs/es2024/full/index.d.ts +8 -0
- package/libs/es2024/index.d.ts +10 -0
- package/libs/es2024/object/index.d.ts +13 -0
- package/libs/es2024/promise/index.d.ts +19 -0
- package/libs/es2024/regexp/index.d.ts +9 -0
- package/libs/es2024/sharedmemory/index.d.ts +69 -0
- package/libs/es2024/string/index.d.ts +13 -0
- package/libs/es5/index.d.ts +5845 -0
- package/libs/es6/index.d.ts +7 -0
- package/libs/esnext/array/index.d.ts +28 -0
- package/libs/esnext/collection/index.d.ts +80 -0
- package/libs/esnext/decorators/index.d.ts +12 -0
- package/libs/esnext/disposable/index.d.ts +175 -0
- package/libs/esnext/error/index.d.ts +8 -0
- package/libs/esnext/float16/index.d.ts +505 -0
- package/libs/esnext/full/index.d.ts +8 -0
- package/libs/esnext/index.d.ts +13 -0
- package/libs/esnext/intl/index.d.ts +5 -0
- package/libs/esnext/iterator/index.d.ts +172 -0
- package/libs/esnext/promise/index.d.ts +21 -0
- package/libs/esnext/sharedmemory/index.d.ts +9 -0
- package/libs/scripthost/index.d.ts +310 -0
- package/libs/webworker/asynciterable/index.d.ts +41 -0
- package/libs/webworker/importscripts/index.d.ts +7 -0
- package/libs/webworker/index.d.ts +15593 -0
- package/libs/webworker/iterable/index.d.ts +630 -0
- package/package.json +23 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2015.iterable" />
|
|
4
|
+
|
|
5
|
+
// NOTE: This is specified as what is essentially an unreachable module. All actual global declarations can be found
|
|
6
|
+
// in the `declare global` section, below. This is necessary as there is currently no way to declare an `abstract`
|
|
7
|
+
// member without declaring a `class`, but declaring `class Iterator<T>` globally would conflict with TypeScript's
|
|
8
|
+
// general purpose `Iterator<T>` interface.
|
|
9
|
+
export {};
|
|
10
|
+
|
|
11
|
+
// Abstract type that allows us to mark `next` as `abstract`
|
|
12
|
+
declare abstract class Iterator<T, TResult = undefined, TNext = unknown> {
|
|
13
|
+
// eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging
|
|
14
|
+
abstract next(value?: TNext): IteratorResult<T, TResult>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Merge all members of `IteratorObject<T>` into `Iterator<T>`
|
|
18
|
+
interface Iterator<T, TResult, TNext> extends globalThis.IteratorObject<
|
|
19
|
+
T,
|
|
20
|
+
TResult,
|
|
21
|
+
TNext
|
|
22
|
+
> {}
|
|
23
|
+
|
|
24
|
+
// Capture the `Iterator` constructor in a type we can use in the `extends` clause of `IteratorConstructor`.
|
|
25
|
+
type IteratorObjectConstructor = typeof Iterator;
|
|
26
|
+
|
|
27
|
+
declare global {
|
|
28
|
+
// Global `IteratorObject<T, TReturn, TNext>` interface that can be augmented by polyfills
|
|
29
|
+
interface IteratorObject<T, TReturn, TNext> {
|
|
30
|
+
/**
|
|
31
|
+
* Returns this iterator.
|
|
32
|
+
*/
|
|
33
|
+
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Creates an iterator whose values are the result of applying the callback to the values from this iterator.
|
|
37
|
+
* @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.
|
|
38
|
+
*/
|
|
39
|
+
map<U>(
|
|
40
|
+
callbackfn: (value: T, index: number) => U,
|
|
41
|
+
): IteratorObject<U, undefined, unknown>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
|
45
|
+
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
|
46
|
+
*/
|
|
47
|
+
filter<S extends T>(
|
|
48
|
+
predicate: (value: T, index: number) => value is S,
|
|
49
|
+
): IteratorObject<S, undefined, unknown>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
|
53
|
+
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
|
54
|
+
*/
|
|
55
|
+
filter(
|
|
56
|
+
predicate: (value: T, index: number) => unknown,
|
|
57
|
+
): IteratorObject<T, undefined, unknown>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
|
|
61
|
+
* @param limit The maximum number of values to yield.
|
|
62
|
+
*/
|
|
63
|
+
take(limit: number): IteratorObject<T, undefined, unknown>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Creates an iterator whose values are the values from this iterator after skipping the provided count.
|
|
67
|
+
* @param count The number of values to drop.
|
|
68
|
+
*/
|
|
69
|
+
drop(limit: number): IteratorObject<T, undefined, unknown>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
|
|
73
|
+
* @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.
|
|
74
|
+
*/
|
|
75
|
+
flatMap<U>(
|
|
76
|
+
callback: (
|
|
77
|
+
value: T,
|
|
78
|
+
index: number,
|
|
79
|
+
) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>,
|
|
80
|
+
): IteratorObject<U, undefined, unknown>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
|
84
|
+
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
|
85
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
|
86
|
+
*/
|
|
87
|
+
reduce(
|
|
88
|
+
callbackfn: (
|
|
89
|
+
previousValue: T,
|
|
90
|
+
currentValue: T,
|
|
91
|
+
currentIndex: number,
|
|
92
|
+
) => T,
|
|
93
|
+
): T;
|
|
94
|
+
reduce(
|
|
95
|
+
callbackfn: (
|
|
96
|
+
previousValue: T,
|
|
97
|
+
currentValue: T,
|
|
98
|
+
currentIndex: number,
|
|
99
|
+
) => T,
|
|
100
|
+
initialValue: T,
|
|
101
|
+
): T;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
|
105
|
+
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
|
106
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
|
107
|
+
*/
|
|
108
|
+
reduce<U>(
|
|
109
|
+
callbackfn: (
|
|
110
|
+
previousValue: U,
|
|
111
|
+
currentValue: T,
|
|
112
|
+
currentIndex: number,
|
|
113
|
+
) => U,
|
|
114
|
+
initialValue: U,
|
|
115
|
+
): U;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new array from the values yielded by this iterator.
|
|
119
|
+
*/
|
|
120
|
+
toArray(): T[];
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Performs the specified action for each element in the iterator.
|
|
124
|
+
* @param callbackfn A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.
|
|
125
|
+
*/
|
|
126
|
+
forEach(callbackfn: (value: T, index: number) => void): void;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Determines whether the specified callback function returns true for any element of this iterator.
|
|
130
|
+
* @param predicate A function that accepts up to two arguments. The some method calls
|
|
131
|
+
* the predicate function for each element in this iterator until the predicate returns a value
|
|
132
|
+
* true, or until the end of the iterator.
|
|
133
|
+
*/
|
|
134
|
+
some(predicate: (value: T, index: number) => unknown): boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Determines whether all the members of this iterator satisfy the specified test.
|
|
138
|
+
* @param predicate A function that accepts up to two arguments. The every method calls
|
|
139
|
+
* the predicate function for each element in this iterator until the predicate returns
|
|
140
|
+
* false, or until the end of this iterator.
|
|
141
|
+
*/
|
|
142
|
+
every(predicate: (value: T, index: number) => unknown): boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Returns the value of the first element in this iterator where predicate is true, and undefined
|
|
146
|
+
* otherwise.
|
|
147
|
+
* @param predicate find calls predicate once for each element of this iterator, in
|
|
148
|
+
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
149
|
+
* immediately returns that element value. Otherwise, find returns undefined.
|
|
150
|
+
*/
|
|
151
|
+
find<S extends T>(
|
|
152
|
+
predicate: (value: T, index: number) => value is S,
|
|
153
|
+
): S | undefined;
|
|
154
|
+
find(predicate: (value: T, index: number) => unknown): T | undefined;
|
|
155
|
+
|
|
156
|
+
readonly [Symbol.toStringTag]: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Global `IteratorConstructor` interface that can be augmented by polyfills
|
|
160
|
+
interface IteratorConstructor extends IteratorObjectConstructor {
|
|
161
|
+
/**
|
|
162
|
+
* Creates a native iterator from an iterator or iterable object.
|
|
163
|
+
* Returns its input if the input already inherits from the built-in Iterator class.
|
|
164
|
+
* @param value An iterator or iterable object to convert a native iterator.
|
|
165
|
+
*/
|
|
166
|
+
from<T>(
|
|
167
|
+
value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>,
|
|
168
|
+
): IteratorObject<T, undefined, unknown>;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const Iterator: IteratorConstructor;
|
|
172
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface PromiseConstructor {
|
|
4
|
+
/**
|
|
5
|
+
* Takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result
|
|
6
|
+
* in a Promise.
|
|
7
|
+
*
|
|
8
|
+
* @param callbackFn A function that is called synchronously. It can do anything: either return
|
|
9
|
+
* a value, throw an error, or return a promise.
|
|
10
|
+
* @param args Additional arguments, that will be passed to the callback.
|
|
11
|
+
*
|
|
12
|
+
* @returns A Promise that is:
|
|
13
|
+
* - Already fulfilled, if the callback synchronously returns a value.
|
|
14
|
+
* - Already rejected, if the callback synchronously throws an error.
|
|
15
|
+
* - Asynchronously fulfilled or rejected, if the callback returns a promise.
|
|
16
|
+
*/
|
|
17
|
+
try<T, U extends readonly unknown[]>(
|
|
18
|
+
callbackFn: (...args: U) => T | PromiseLike<T>,
|
|
19
|
+
...args: U
|
|
20
|
+
): Promise<Awaited<T>>;
|
|
21
|
+
}
|
|
@@ -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,41 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/////////////////////////////
|
|
4
|
+
/// Worker Async Iterable APIs
|
|
5
|
+
/////////////////////////////
|
|
6
|
+
|
|
7
|
+
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<
|
|
8
|
+
T,
|
|
9
|
+
BuiltinIteratorReturn,
|
|
10
|
+
unknown
|
|
11
|
+
> {
|
|
12
|
+
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface FileSystemDirectoryHandle {
|
|
16
|
+
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<
|
|
17
|
+
readonly [string, FileSystemHandle]
|
|
18
|
+
>;
|
|
19
|
+
entries(): FileSystemDirectoryHandleAsyncIterator<
|
|
20
|
+
readonly [string, FileSystemHandle]
|
|
21
|
+
>;
|
|
22
|
+
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
|
|
23
|
+
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<
|
|
27
|
+
T,
|
|
28
|
+
BuiltinIteratorReturn,
|
|
29
|
+
unknown
|
|
30
|
+
> {
|
|
31
|
+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface ReadableStream<R = unknown> {
|
|
35
|
+
[Symbol.asyncIterator](
|
|
36
|
+
options?: ReadableStreamIteratorOptions,
|
|
37
|
+
): ReadableStreamAsyncIterator<R>;
|
|
38
|
+
values(
|
|
39
|
+
options?: ReadableStreamIteratorOptions,
|
|
40
|
+
): ReadableStreamAsyncIterator<R>;
|
|
41
|
+
}
|