Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier-eslint / node_modules / typescript / lib / lib.scripthost.d.ts
1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
6
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
11
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
15
16
17
18 /// <reference no-default-lib="true"/>\r
19
20
21 \r
22 \r
23 /////////////////////////////\r
24 /// Windows Script Host APIS\r
25 /////////////////////////////\r
26 \r
27 \r
28 interface ActiveXObject {\r
29     new (s: string): any;\r
30 }\r
31 declare var ActiveXObject: ActiveXObject;\r
32 \r
33 interface ITextWriter {\r
34     Write(s: string): void;\r
35     WriteLine(s: string): void;\r
36     Close(): void;\r
37 }\r
38 \r
39 interface TextStreamBase {\r
40     /**\r
41      * The column number of the current character position in an input stream.\r
42      */\r
43     Column: number;\r
44 \r
45     /**\r
46      * The current line number in an input stream.\r
47      */\r
48     Line: number;\r
49 \r
50     /**\r
51      * Closes a text stream.\r
52      * It is not necessary to close standard streams; they close automatically when the process ends. If\r
53      * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\r
54      */\r
55     Close(): void;\r
56 }\r
57 \r
58 interface TextStreamWriter extends TextStreamBase {\r
59     /**\r
60      * Sends a string to an output stream.\r
61      */\r
62     Write(s: string): void;\r
63 \r
64     /**\r
65      * Sends a specified number of blank lines (newline characters) to an output stream.\r
66      */\r
67     WriteBlankLines(intLines: number): void;\r
68 \r
69     /**\r
70      * Sends a string followed by a newline character to an output stream.\r
71      */\r
72     WriteLine(s: string): void;\r
73 }\r
74 \r
75 interface TextStreamReader extends TextStreamBase {\r
76     /**\r
77      * Returns a specified number of characters from an input stream, starting at the current pointer position.\r
78      * Does not return until the ENTER key is pressed.\r
79      * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\r
80      */\r
81     Read(characters: number): string;\r
82 \r
83     /**\r
84      * Returns all characters from an input stream.\r
85      * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\r
86      */\r
87     ReadAll(): string;\r
88 \r
89     /**\r
90      * Returns an entire line from an input stream.\r
91      * Although this method extracts the newline character, it does not add it to the returned string.\r
92      * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\r
93      */\r
94     ReadLine(): string;\r
95 \r
96     /**\r
97      * Skips a specified number of characters when reading from an input text stream.\r
98      * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\r
99      * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\r
100      */\r
101     Skip(characters: number): void;\r
102 \r
103     /**\r
104      * Skips the next line when reading from an input text stream.\r
105      * Can only be used on a stream in reading mode, not writing or appending mode.\r
106      */\r
107     SkipLine(): void;\r
108 \r
109     /**\r
110      * Indicates whether the stream pointer position is at the end of a line.\r
111      */\r
112     AtEndOfLine: boolean;\r
113 \r
114     /**\r
115      * Indicates whether the stream pointer position is at the end of a stream.\r
116      */\r
117     AtEndOfStream: boolean;\r
118 }\r
119 \r
120 declare var WScript: {\r
121     /**\r
122      * Outputs text to either a message box (under WScript.exe) or the command console window followed by\r
123      * a newline (under CScript.exe).\r
124      */\r
125     Echo(s: any): void;\r
126 \r
127     /**\r
128      * Exposes the write-only error output stream for the current script.\r
129      * Can be accessed only while using CScript.exe.\r
130      */\r
131     StdErr: TextStreamWriter;\r
132 \r
133     /**\r
134      * Exposes the write-only output stream for the current script.\r
135      * Can be accessed only while using CScript.exe.\r
136      */\r
137     StdOut: TextStreamWriter;\r
138     Arguments: { length: number; Item(n: number): string; };\r
139 \r
140     /**\r
141      *  The full path of the currently running script.\r
142      */\r
143     ScriptFullName: string;\r
144 \r
145     /**\r
146      * Forces the script to stop immediately, with an optional exit code.\r
147      */\r
148     Quit(exitCode?: number): number;\r
149 \r
150     /**\r
151      * The Windows Script Host build version number.\r
152      */\r
153     BuildVersion: number;\r
154 \r
155     /**\r
156      * Fully qualified path of the host executable.\r
157      */\r
158     FullName: string;\r
159 \r
160     /**\r
161      * Gets/sets the script mode - interactive(true) or batch(false).\r
162      */\r
163     Interactive: boolean;\r
164 \r
165     /**\r
166      * The name of the host executable (WScript.exe or CScript.exe).\r
167      */\r
168     Name: string;\r
169 \r
170     /**\r
171      * Path of the directory containing the host executable.\r
172      */\r
173     Path: string;\r
174 \r
175     /**\r
176      * The filename of the currently running script.\r
177      */\r
178     ScriptName: string;\r
179 \r
180     /**\r
181      * Exposes the read-only input stream for the current script.\r
182      * Can be accessed only while using CScript.exe.\r
183      */\r
184     StdIn: TextStreamReader;\r
185 \r
186     /**\r
187      * Windows Script Host version\r
188      */\r
189     Version: string;\r
190 \r
191     /**\r
192      * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\r
193      */\r
194     ConnectObject(objEventSource: any, strPrefix: string): void;\r
195 \r
196     /**\r
197      * Creates a COM object.\r
198      * @param strProgiID\r
199      * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\r
200      */\r
201     CreateObject(strProgID: string, strPrefix?: string): any;\r
202 \r
203     /**\r
204      * Disconnects a COM object from its event sources.\r
205      */\r
206     DisconnectObject(obj: any): void;\r
207 \r
208     /**\r
209      * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\r
210      * @param strPathname Fully qualified path to the file containing the object persisted to disk.\r
211      *                       For objects in memory, pass a zero-length string.\r
212      * @param strProgID\r
213      * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\r
214      */\r
215     GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\r
216 \r
217     /**\r
218      * Suspends script execution for a specified length of time, then continues execution.\r
219      * @param intTime Interval (in milliseconds) to suspend script execution.\r
220      */\r
221     Sleep(intTime: number): void;\r
222 };\r
223 \r
224 /**\r
225  * WSH is an alias for WScript under Windows Script Host\r
226  */\r
227 declare var WSH: typeof WScript;\r
228 \r
229 /**\r
230  * Represents an Automation SAFEARRAY\r
231  */\r
232 declare class SafeArray<T = any> {\r
233     private constructor();\r
234     private SafeArray_typekey: SafeArray<T>;\r
235 }\r
236 \r
237 /**\r
238  * Allows enumerating over a COM collection, which may not have indexed item access.\r
239  */\r
240 interface Enumerator<T = any> {\r
241     /**\r
242      * Returns true if the current item is the last one in the collection, or the collection is empty,\r
243      * or the current item is undefined.\r
244      */\r
245     atEnd(): boolean;\r
246 \r
247     /**\r
248      * Returns the current item in the collection\r
249      */\r
250     item(): T;\r
251 \r
252     /**\r
253      * Resets the current item in the collection to the first item. If there are no items in the collection,\r
254      * the current item is set to undefined.\r
255      */\r
256     moveFirst(): void;\r
257 \r
258     /**\r
259      * Moves the current item to the next item in the collection. If the enumerator is at the end of\r
260      * the collection or the collection is empty, the current item is set to undefined.\r
261      */\r
262     moveNext(): void;\r
263 }\r
264 \r
265 interface EnumeratorConstructor {\r
266     new <T = any>(safearray: SafeArray<T>): Enumerator<T>;\r
267     new <T = any>(collection: { Item(index: any): T }): Enumerator<T>;\r
268     new <T = any>(collection: any): Enumerator<T>;\r
269 }\r
270 \r
271 declare var Enumerator: EnumeratorConstructor;\r
272 \r
273 /**\r
274  * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\r
275  */\r
276 interface VBArray<T = any> {\r
277     /**\r
278      * Returns the number of dimensions (1-based).\r
279      */\r
280     dimensions(): number;\r
281 \r
282     /**\r
283      * Takes an index for each dimension in the array, and returns the item at the corresponding location.\r
284      */\r
285     getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\r
286 \r
287     /**\r
288      * Returns the smallest available index for a given dimension.\r
289      * @param dimension 1-based dimension (defaults to 1)\r
290      */\r
291     lbound(dimension?: number): number;\r
292 \r
293     /**\r
294      * Returns the largest available index for a given dimension.\r
295      * @param dimension 1-based dimension (defaults to 1)\r
296      */\r
297     ubound(dimension?: number): number;\r
298 \r
299     /**\r
300      * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\r
301      * each successive dimension is appended to the end of the array.\r
302      * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\r
303      */\r
304     toArray(): T[];\r
305 }\r
306 \r
307 interface VBArrayConstructor {\r
308     new <T = any>(safeArray: SafeArray<T>): VBArray<T>;\r
309 }\r
310 \r
311 declare var VBArray: VBArrayConstructor;\r
312 \r
313 /**\r
314  * Automation date (VT_DATE)\r
315  */\r
316 declare class VarDate {\r
317     private constructor();\r
318     private VarDate_typekey: VarDate;\r
319 }\r
320 \r
321 interface DateConstructor {\r
322     new (vd: VarDate): Date;\r
323 }\r
324 \r
325 interface Date {\r
326     getVarDate: () => VarDate;\r
327 }\r