@@ -179,19 +179,19 @@ interface ObjectConstructor {
179
179
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
180
180
* @param o Object on which to lock the attributes.
181
181
*/
182
- seal(o: any ): any ;
182
+ seal<T> (o: T ): T ;
183
183
184
184
/**
185
185
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
186
186
* @param o Object on which to lock the attributes.
187
187
*/
188
- freeze(o: any ): any ;
188
+ freeze<T> (o: T ): T ;
189
189
190
190
/**
191
191
* Prevents the addition of new properties to an object.
192
192
* @param o Object to make non-extensible.
193
193
*/
194
- preventExtensions(o: any ): any ;
194
+ preventExtensions<T> (o: T ): T ;
195
195
196
196
/**
197
197
* Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
@@ -425,6 +425,9 @@ interface String {
425
425
*/
426
426
substr(from: number, length?: number): string;
427
427
428
+ /** Returns the primitive value of the specified object. */
429
+ valueOf(): string;
430
+
428
431
[index: number]: string;
429
432
}
430
433
@@ -477,6 +480,9 @@ interface Number {
477
480
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
478
481
*/
479
482
toPrecision(precision?: number): string;
483
+
484
+ /** Returns the primitive value of the specified object. */
485
+ valueOf(): number;
480
486
}
481
487
482
488
interface NumberConstructor {
@@ -1165,6 +1171,20 @@ interface ArrayConstructor {
1165
1171
1166
1172
declare var Array: ArrayConstructor;
1167
1173
1174
+ interface TypedPropertyDescriptor<T> {
1175
+ enumerable?: boolean;
1176
+ configurable?: boolean;
1177
+ writable?: boolean;
1178
+ value?: T;
1179
+ get?: () => T;
1180
+ set?: (value: T) => void;
1181
+ }
1182
+
1183
+ declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
1184
+ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
1185
+ declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
1186
+ declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void;
1187
+
1168
1188
/////////////////////////////
1169
1189
/// IE10 ECMAScript Extensions
1170
1190
/////////////////////////////
@@ -14203,19 +14223,169 @@ declare function importScripts(...urls: string[]): void;
14203
14223
/// Windows Script Host APIS
14204
14224
/////////////////////////////
14205
14225
14206
- declare var ActiveXObject: { new (s: string): any; };
14226
+
14227
+ interface ActiveXObject {
14228
+ new (s: string): any;
14229
+ }
14230
+ declare var ActiveXObject: ActiveXObject;
14207
14231
14208
14232
interface ITextWriter {
14209
14233
Write(s: string): void;
14210
14234
WriteLine(s: string): void;
14211
14235
Close(): void;
14212
14236
}
14213
14237
14238
+ interface TextStreamBase {
14239
+ /**
14240
+ * The column number of the current character position in an input stream.
14241
+ */
14242
+ Column: number;
14243
+ /**
14244
+ * The current line number in an input stream.
14245
+ */
14246
+ Line: number;
14247
+ /**
14248
+ * Closes a text stream.
14249
+ * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid.
14250
+ */
14251
+ Close(): void;
14252
+ }
14253
+
14254
+ interface TextStreamWriter extends TextStreamBase {
14255
+ /**
14256
+ * Sends a string to an output stream.
14257
+ */
14258
+ Write(s: string): void;
14259
+ /**
14260
+ * Sends a specified number of blank lines (newline characters) to an output stream.
14261
+ */
14262
+ WriteBlankLines(intLines: number): void;
14263
+ /**
14264
+ * Sends a string followed by a newline character to an output stream.
14265
+ */
14266
+ WriteLine(s: string): void;
14267
+ }
14268
+
14269
+ interface TextStreamReader extends TextStreamBase {
14270
+ /**
14271
+ * Returns a specified number of characters from an input stream, beginning at the current pointer position.
14272
+ * Does not return until the ENTER key is pressed.
14273
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
14274
+ */
14275
+ Read(characters: number): string;
14276
+ /**
14277
+ * Returns all characters from an input stream.
14278
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
14279
+ */
14280
+ ReadAll(): string;
14281
+ /**
14282
+ * Returns an entire line from an input stream.
14283
+ * Although this method extracts the newline character, it does not add it to the returned string.
14284
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
14285
+ */
14286
+ ReadLine(): string;
14287
+ /**
14288
+ * Skips a specified number of characters when reading from an input text stream.
14289
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
14290
+ * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
14291
+ */
14292
+ Skip(characters: number): void;
14293
+ /**
14294
+ * Skips the next line when reading from an input text stream.
14295
+ * Can only be used on a stream in reading mode, not writing or appending mode.
14296
+ */
14297
+ SkipLine(): void;
14298
+ /**
14299
+ * Indicates whether the stream pointer position is at the end of a line.
14300
+ */
14301
+ AtEndOfLine: boolean;
14302
+ /**
14303
+ * Indicates whether the stream pointer position is at the end of a stream.
14304
+ */
14305
+ AtEndOfStream: boolean;
14306
+ }
14307
+
14214
14308
declare var WScript: {
14309
+ /**
14310
+ * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext).
14311
+ */
14215
14312
Echo(s: any): void;
14216
- StdErr: ITextWriter;
14217
- StdOut: ITextWriter;
14313
+ /**
14314
+ * Exposes the write-only error output stream for the current script.
14315
+ * Can be accessed only while using CScript.exe.
14316
+ */
14317
+ StdErr: TextStreamWriter;
14318
+ /**
14319
+ * Exposes the write-only output stream for the current script.
14320
+ * Can be accessed only while using CScript.exe.
14321
+ */
14322
+ StdOut: TextStreamWriter;
14218
14323
Arguments: { length: number; Item(n: number): string; };
14324
+ /**
14325
+ * The full path of the currently running script.
14326
+ */
14219
14327
ScriptFullName: string;
14328
+ /**
14329
+ * Forces the script to stop immediately, with an optional exit code.
14330
+ */
14220
14331
Quit(exitCode?: number): number;
14221
- }
14332
+ /**
14333
+ * The Windows Script Host build version number.
14334
+ */
14335
+ BuildVersion: number;
14336
+ /**
14337
+ * Fully qualified path of the host executable.
14338
+ */
14339
+ FullName: string;
14340
+ /**
14341
+ * Gets/sets the script mode - interactive(true) or batch(false).
14342
+ */
14343
+ Interactive: boolean;
14344
+ /**
14345
+ * The name of the host executable (WScript.exe or CScript.exe).
14346
+ */
14347
+ Name: string;
14348
+ /**
14349
+ * Path of the directory containing the host executable.
14350
+ */
14351
+ Path: string;
14352
+ /**
14353
+ * The filename of the currently running script.
14354
+ */
14355
+ ScriptName: string;
14356
+ /**
14357
+ * Exposes the read-only input stream for the current script.
14358
+ * Can be accessed only while using CScript.exe.
14359
+ */
14360
+ StdIn: TextStreamReader;
14361
+ /**
14362
+ * Windows Script Host version
14363
+ */
14364
+ Version: string;
14365
+ /**
14366
+ * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.
14367
+ */
14368
+ ConnectObject(objEventSource: any, strPrefix: string): void;
14369
+ /**
14370
+ * Creates a COM object.
14371
+ * @param strProgiID
14372
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
14373
+ */
14374
+ CreateObject(strProgID: string, strPrefix?: string): any;
14375
+ /**
14376
+ * Disconnects a COM object from its event sources.
14377
+ */
14378
+ DisconnectObject(obj: any): void;
14379
+ /**
14380
+ * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.
14381
+ * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string.
14382
+ * @param strProgID
14383
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
14384
+ */
14385
+ GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;
14386
+ /**
14387
+ * Suspends script execution for a specified length of time, then continues execution.
14388
+ * @param intTime Interval (in milliseconds) to suspend script execution.
14389
+ */
14390
+ Sleep(intTime: number): void;
14391
+ };
0 commit comments