@node-red/editor-client 2.0.4 → 2.1.0-beta.2

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.
Files changed (77) hide show
  1. package/locales/en-US/editor.json +37 -7
  2. package/locales/ko/editor.json +1 -1
  3. package/package.json +2 -2
  4. package/public/red/about +109 -0
  5. package/public/red/images/node-red-256.svg +1 -0
  6. package/public/red/keymap.json +13 -2
  7. package/public/red/red.js +6122 -3663
  8. package/public/red/red.min.js +1 -1
  9. package/public/red/style.min.css +2 -2
  10. package/public/red/tours/first-flow.js +80 -0
  11. package/public/red/tours/welcome.js +135 -0
  12. package/public/tours/first-flow.js +82 -0
  13. package/public/types/node/assert.d.ts +127 -0
  14. package/public/types/node/async_hooks.d.ts +229 -0
  15. package/public/types/node/buffer.d.ts +25 -1
  16. package/public/types/node/child_process.d.ts +514 -6
  17. package/public/types/node/cluster.d.ts +265 -0
  18. package/public/types/node/console.d.ts +136 -1
  19. package/public/types/node/crypto.d.ts +1189 -1
  20. package/public/types/node/dgram.d.ts +144 -1
  21. package/public/types/node/dns.d.ts +383 -10
  22. package/public/types/node/domain.d.ts +27 -1
  23. package/public/types/node/events.d.ts +81 -1
  24. package/public/types/node/fs.d.ts +2273 -1
  25. package/public/types/node/globals.d.ts +616 -1
  26. package/public/types/node/http.d.ts +489 -1
  27. package/public/types/node/http2.d.ts +961 -0
  28. package/public/types/node/https.d.ts +142 -0
  29. package/public/types/node/module.d.ts +55 -0
  30. package/public/types/node/net.d.ts +296 -1
  31. package/public/types/node/os.d.ts +242 -1
  32. package/public/types/node/path.d.ts +156 -1
  33. package/public/types/node/perf_hooks.d.ts +274 -0
  34. package/public/types/node/process.d.ts +412 -1
  35. package/public/types/node/querystring.d.ts +31 -1
  36. package/public/types/node/readline.d.ts +173 -0
  37. package/public/types/node/stream.d.ts +358 -0
  38. package/public/types/node/string_decoder.d.ts +10 -0
  39. package/public/types/node/timers.d.ts +19 -0
  40. package/public/types/node/tls.d.ts +783 -0
  41. package/public/types/node/trace_events.d.ts +64 -0
  42. package/public/types/node/tty.d.ts +69 -0
  43. package/public/types/node/url.d.ts +119 -1
  44. package/public/types/node/util.d.ts +210 -0
  45. package/public/types/node/v8.d.ts +190 -0
  46. package/public/types/node/vm.d.ts +155 -0
  47. package/public/types/node/wasi.d.ts +89 -0
  48. package/public/types/node/worker_threads.d.ts +241 -0
  49. package/public/types/node/zlib.d.ts +364 -0
  50. package/public/types/node-red/func.d.ts +1 -1
  51. package/public/types/node-red/util.d.ts +1 -1
  52. package/public/vendor/ace/worker-jsonata.js +1 -1
  53. package/public/vendor/monaco/dist/ThirdPartyNotices.txt +192 -192
  54. package/public/vendor/monaco/dist/css.worker.js +1 -1
  55. package/public/vendor/monaco/dist/editor.js +2 -2
  56. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  57. package/public/vendor/monaco/dist/html.worker.js +1 -1
  58. package/public/vendor/monaco/dist/json.worker.js +1 -1
  59. package/public/vendor/monaco/dist/locale/cs.js +44 -10
  60. package/public/vendor/monaco/dist/locale/de.js +46 -12
  61. package/public/vendor/monaco/dist/locale/es.js +46 -12
  62. package/public/vendor/monaco/dist/locale/fr.js +43 -9
  63. package/public/vendor/monaco/dist/locale/it.js +45 -11
  64. package/public/vendor/monaco/dist/locale/ja.js +45 -11
  65. package/public/vendor/monaco/dist/locale/ko.js +44 -10
  66. package/public/vendor/monaco/dist/locale/pl.js +42 -8
  67. package/public/vendor/monaco/dist/locale/pt-br.js +49 -15
  68. package/public/vendor/monaco/dist/locale/qps-ploc.js +1445 -0
  69. package/public/vendor/monaco/dist/locale/ru.js +48 -14
  70. package/public/vendor/monaco/dist/locale/tr.js +49 -15
  71. package/public/vendor/monaco/dist/locale/zh-hans.js +48 -14
  72. package/public/vendor/monaco/dist/locale/zh-hant.js +45 -11
  73. package/public/vendor/monaco/dist/theme/monoindustrial.json +228 -0
  74. package/public/vendor/monaco/dist/theme/solarized-dark.json +1082 -0
  75. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  76. package/public/vendor/vendor.js +4 -4
  77. package/templates/index.mst +5 -1
@@ -1 +1,616 @@
1
- interface ErrorConstructor{captureStackTrace(targetObject:object,constructorOpt?:Function):void;prepareStackTrace?:(err:Error,stackTraces:NodeJS.CallSite[])=>any;stackTraceLimit:number;}interface String{trimLeft():string;trimRight():string;trimStart():string;trimEnd():string;}interface ImportMeta{url:string;}interface NodeRequire extends NodeJS.Require{}interface RequireResolve extends NodeJS.RequireResolve{}interface NodeModule extends NodeJS.Module{}declare var process:NodeJS.Process;declare var console:Console;declare var __filename:string;declare var __dirname:string;declare function setTimeout(callback:(...args:any[])=>void,ms?:number,...args:any[]):NodeJS.Timeout;declare namespace setTimeout{function __promisify__(ms:number):Promise<void>;function __promisify__<T>(ms:number,value:T):Promise<T>;}declare function clearTimeout(timeoutId:NodeJS.Timeout):void;declare function setInterval(callback:(...args:any[])=>void,ms?:number,...args:any[]):NodeJS.Timeout;declare function clearInterval(intervalId:NodeJS.Timeout):void;declare function setImmediate(callback:(...args:any[])=>void,...args:any[]):NodeJS.Immediate;declare namespace setImmediate{function __promisify__():Promise<void>;function __promisify__<T>(value:T):Promise<T>;}declare function clearImmediate(immediateId:NodeJS.Immediate):void;declare function queueMicrotask(callback:()=>void):void;declare var require:NodeRequire;declare var module:NodeModule;declare var exports:any;type BufferEncoding="ascii"|"utf8"|"utf-8"|"utf16le"|"ucs2"|"ucs-2"|"base64"|"latin1"|"binary"|"hex";type WithImplicitCoercion<T>=T|{valueOf():T};declare class Buffer extends Uint8Array{constructor(str:string,encoding?:BufferEncoding);constructor(size:number);constructor(array:Uint8Array);constructor(arrayBuffer:ArrayBuffer|SharedArrayBuffer);constructor(array:ReadonlyArray<any>);constructor(buffer:Buffer);static from(arrayBuffer:WithImplicitCoercion<ArrayBuffer|SharedArrayBuffer>,byteOffset?:number,length?:number):Buffer;static from(data:Uint8Array|ReadonlyArray<number>):Buffer;static from(data:WithImplicitCoercion<Uint8Array|ReadonlyArray<number>|string>):Buffer;static from(str:WithImplicitCoercion<string>|{[Symbol.toPrimitive](hint:'string'):string},encoding?:BufferEncoding):Buffer;static of(...items:number[]):Buffer;static isBuffer(obj:any):obj is Buffer;static isEncoding(encoding:string):encoding is BufferEncoding;static byteLength(string:string|NodeJS.ArrayBufferView|ArrayBuffer|SharedArrayBuffer,encoding?:BufferEncoding):number;static concat(list:ReadonlyArray<Uint8Array>,totalLength?:number):Buffer;static compare(buf1:Uint8Array,buf2:Uint8Array):number;static alloc(size:number,fill?:string|Buffer|number,encoding?:BufferEncoding):Buffer;static allocUnsafe(size:number):Buffer;static allocUnsafeSlow(size:number):Buffer;static poolSize:number;write(string:string,encoding?:BufferEncoding):number;write(string:string,offset:number,encoding?:BufferEncoding):number;write(string:string,offset:number,length:number,encoding?:BufferEncoding):number;toString(encoding?:BufferEncoding,start?:number,end?:number):string;toJSON():{type:'Buffer';data:number[]};equals(otherBuffer:Uint8Array):boolean;compare(otherBuffer:Uint8Array,targetStart?:number,targetEnd?:number,sourceStart?:number,sourceEnd?:number):number;copy(targetBuffer:Uint8Array,targetStart?:number,sourceStart?:number,sourceEnd?:number):number;slice(begin?:number,end?:number):Buffer;subarray(begin?:number,end?:number):Buffer;writeBigInt64BE(value:bigint,offset?:number):number;writeBigInt64LE(value:bigint,offset?:number):number;writeBigUInt64BE(value:bigint,offset?:number):number;writeBigUInt64LE(value:bigint,offset?:number):number;writeUIntLE(value:number,offset:number,byteLength:number):number;writeUIntBE(value:number,offset:number,byteLength:number):number;writeIntLE(value:number,offset:number,byteLength:number):number;writeIntBE(value:number,offset:number,byteLength:number):number;readBigUInt64BE(offset?:number):bigint;readBigUInt64LE(offset?:number):bigint;readBigInt64BE(offset?:number):bigint;readBigInt64LE(offset?:number):bigint;readUIntLE(offset:number,byteLength:number):number;readUIntBE(offset:number,byteLength:number):number;readIntLE(offset:number,byteLength:number):number;readIntBE(offset:number,byteLength:number):number;readUInt8(offset?:number):number;readUInt16LE(offset?:number):number;readUInt16BE(offset?:number):number;readUInt32LE(offset?:number):number;readUInt32BE(offset?:number):number;readInt8(offset?:number):number;readInt16LE(offset?:number):number;readInt16BE(offset?:number):number;readInt32LE(offset?:number):number;readInt32BE(offset?:number):number;readFloatLE(offset?:number):number;readFloatBE(offset?:number):number;readDoubleLE(offset?:number):number;readDoubleBE(offset?:number):number;reverse():this;swap16():Buffer;swap32():Buffer;swap64():Buffer;writeUInt8(value:number,offset?:number):number;writeUInt16LE(value:number,offset?:number):number;writeUInt16BE(value:number,offset?:number):number;writeUInt32LE(value:number,offset?:number):number;writeUInt32BE(value:number,offset?:number):number;writeInt8(value:number,offset?:number):number;writeInt16LE(value:number,offset?:number):number;writeInt16BE(value:number,offset?:number):number;writeInt32LE(value:number,offset?:number):number;writeInt32BE(value:number,offset?:number):number;writeFloatLE(value:number,offset?:number):number;writeFloatBE(value:number,offset?:number):number;writeDoubleLE(value:number,offset?:number):number;writeDoubleBE(value:number,offset?:number):number;fill(value:string|Uint8Array|number,offset?:number,end?:number,encoding?:BufferEncoding):this;indexOf(value:string|number|Uint8Array,byteOffset?:number,encoding?:BufferEncoding):number;lastIndexOf(value:string|number|Uint8Array,byteOffset?:number,encoding?:BufferEncoding):number;entries():IterableIterator<[number,number]>;includes(value:string|number|Buffer,byteOffset?:number,encoding?:BufferEncoding):boolean;keys():IterableIterator<number>;values():IterableIterator<number>;}declare namespace NodeJS{interface InspectOptions{getters?:'get'|'set'|boolean;showHidden?:boolean;depth?:number|null;colors?:boolean;customInspect?:boolean;showProxy?:boolean;maxArrayLength?:number|null;maxStringLength?:number|null;breakLength?:number;compact?:boolean|number;sorted?:boolean|((a:string,b:string)=>number);}interface CallSite{getThis():any;getTypeName():string|null;getFunction():Function|undefined;getFunctionName():string|null;getMethodName():string|null;getFileName():string|null;getLineNumber():number|null;getColumnNumber():number|null;getEvalOrigin():string|undefined;isToplevel():boolean;isEval():boolean;isNative():boolean;isConstructor():boolean;}interface ErrnoException extends Error{errno?:number;code?:string;path?:string;syscall?:string;stack?:string;}interface ReadableStream extends EventEmitter{readable:boolean;read(size?:number):string|Buffer;setEncoding(encoding:BufferEncoding):this;pause():this;resume():this;isPaused():boolean;pipe<T extends WritableStream>(destination:T,options?:{end?:boolean;}):T;unpipe(destination?:WritableStream):this;unshift(chunk:string|Uint8Array,encoding?:BufferEncoding):void;wrap(oldStream:ReadableStream):this;[Symbol.asyncIterator]():AsyncIterableIterator<string|Buffer>;}interface WritableStream extends EventEmitter{writable:boolean;write(buffer:Uint8Array|string,cb?:(err?:Error|null)=>void):boolean;write(str:string,encoding?:BufferEncoding,cb?:(err?:Error|null)=>void):boolean;end(cb?:()=>void):void;end(data:string|Uint8Array,cb?:()=>void):void;end(str:string,encoding?:BufferEncoding,cb?:()=>void):void;}interface ReadWriteStream extends ReadableStream,WritableStream{}interface Global{Array:typeof Array;ArrayBuffer:typeof ArrayBuffer;Boolean:typeof Boolean;Buffer:typeof Buffer;DataView:typeof DataView;Date:typeof Date;Error:typeof Error;EvalError:typeof EvalError;Float32Array:typeof Float32Array;Float64Array:typeof Float64Array;Function:typeof Function;Infinity:typeof Infinity;Int16Array:typeof Int16Array;Int32Array:typeof Int32Array;Int8Array:typeof Int8Array;Intl:typeof Intl;JSON:typeof JSON;Map:MapConstructor;Math:typeof Math;NaN:typeof NaN;Number:typeof Number;Object:typeof Object;Promise:typeof Promise;RangeError:typeof RangeError;ReferenceError:typeof ReferenceError;RegExp:typeof RegExp;Set:SetConstructor;String:typeof String;Symbol:Function;SyntaxError:typeof SyntaxError;TypeError:typeof TypeError;URIError:typeof URIError;Uint16Array:typeof Uint16Array;Uint32Array:typeof Uint32Array;Uint8Array:typeof Uint8Array;Uint8ClampedArray:typeof Uint8ClampedArray;WeakMap:WeakMapConstructor;WeakSet:WeakSetConstructor;clearImmediate:(immediateId:Immediate)=>void;clearInterval:(intervalId:Timeout)=>void;clearTimeout:(timeoutId:Timeout)=>void;decodeURI:typeof decodeURI;decodeURIComponent:typeof decodeURIComponent;encodeURI:typeof encodeURI;encodeURIComponent:typeof encodeURIComponent;escape:(str:string)=>string;eval:typeof eval;global:Global;isFinite:typeof isFinite;isNaN:typeof isNaN;parseFloat:typeof parseFloat;parseInt:typeof parseInt;setImmediate:(callback:(...args:any[])=>void,...args:any[])=>Immediate;setInterval:(callback:(...args:any[])=>void,ms?:number,...args:any[])=>Timeout;setTimeout:(callback:(...args:any[])=>void,ms?:number,...args:any[])=>Timeout;queueMicrotask:typeof queueMicrotask;undefined:typeof undefined;unescape:(str:string)=>string;gc:()=>void;v8debug?:any;}interface RefCounted{ref():this;unref():this;}interface Timer extends RefCounted{hasRef():boolean;refresh():this;[Symbol.toPrimitive]():number;}interface Immediate extends RefCounted{hasRef():boolean;_onImmediate:Function;}interface Timeout extends Timer{hasRef():boolean;refresh():this;[Symbol.toPrimitive]():number;}type TypedArray=|Uint8Array|Uint8ClampedArray|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|BigUint64Array|BigInt64Array|Float32Array|Float64Array;type ArrayBufferView=TypedArray|DataView;interface Require{(id:string):any;resolve:RequireResolve;cache:Dict<NodeModule>;extensions:RequireExtensions;main:Module|undefined;}interface RequireResolve{(id:string,options?:{paths?:string[];}):string;paths(request:string):string[]|null;}interface RequireExtensions extends Dict<(m:Module,filename:string)=>any>{'.js':(m:Module,filename:string)=>any;'.json':(m:Module,filename:string)=>any;'.node':(m:Module,filename:string)=>any;}interface Module{exports:any;require:Require;id:string;filename:string;loaded:boolean;parent:Module|null|undefined;children:Module[];path:string;paths:string[];}interface Dict<T>{[key:string]:T|undefined;}interface ReadOnlyDict<T>{readonly[key:string]:T|undefined;}}
1
+
2
+ /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/node-red/nr-monaco-build */
3
+
4
+ // Declare "static" methods in Error
5
+ interface ErrorConstructor {
6
+ /** Create .stack property on a target object */
7
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
8
+
9
+ /**
10
+ * Optional override for formatting stack traces
11
+ *
12
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
13
+ */
14
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
15
+
16
+ stackTraceLimit: number;
17
+ }
18
+
19
+ // Node.js ESNEXT support
20
+ interface String {
21
+ /** Removes whitespace from the left end of a string. */
22
+ trimLeft(): string;
23
+ /** Removes whitespace from the right end of a string. */
24
+ trimRight(): string;
25
+
26
+ /** Returns a copy with leading whitespace removed. */
27
+ trimStart(): string;
28
+ /** Returns a copy with trailing whitespace removed. */
29
+ trimEnd(): string;
30
+ }
31
+
32
+ interface ImportMeta {
33
+ url: string;
34
+ }
35
+
36
+ /*-----------------------------------------------*
37
+ * *
38
+ * GLOBAL *
39
+ * *
40
+ ------------------------------------------------*/
41
+
42
+ // For backwards compability
43
+ interface NodeRequire extends NodeJS.Require {}
44
+ interface RequireResolve extends NodeJS.RequireResolve {}
45
+ interface NodeModule extends NodeJS.Module {}
46
+
47
+ declare var process: NodeJS.Process;
48
+ declare var console: Console;
49
+
50
+ declare var __filename: string;
51
+ declare var __dirname: string;
52
+
53
+ declare function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
54
+ declare namespace setTimeout {
55
+ function __promisify__(ms: number): Promise<void>;
56
+ function __promisify__<T>(ms: number, value: T): Promise<T>;
57
+ }
58
+ declare function clearTimeout(timeoutId: NodeJS.Timeout): void;
59
+ declare function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
60
+ declare function clearInterval(intervalId: NodeJS.Timeout): void;
61
+ declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
62
+ declare namespace setImmediate {
63
+ function __promisify__(): Promise<void>;
64
+ function __promisify__<T>(value: T): Promise<T>;
65
+ }
66
+ declare function clearImmediate(immediateId: NodeJS.Immediate): void;
67
+
68
+ declare function queueMicrotask(callback: () => void): void;
69
+
70
+ declare var require: NodeRequire;
71
+ declare var module: NodeModule;
72
+
73
+ // Same as module.exports
74
+ declare var exports: any;
75
+
76
+ // Buffer class
77
+ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
78
+
79
+ type WithImplicitCoercion<T> = T | { valueOf(): T };
80
+
81
+ /**
82
+ * Raw data is stored in instances of the Buffer class.
83
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
84
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
85
+ */
86
+ declare class Buffer extends Uint8Array {
87
+ /**
88
+ * Allocates a new buffer containing the given {str}.
89
+ *
90
+ * @param str String to store in buffer.
91
+ * @param encoding encoding to use, optional. Default is 'utf8'
92
+ * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
93
+ */
94
+ constructor(str: string, encoding?: BufferEncoding);
95
+ /**
96
+ * Allocates a new buffer of {size} octets.
97
+ *
98
+ * @param size count of octets to allocate.
99
+ * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
100
+ */
101
+ constructor(size: number);
102
+ /**
103
+ * Allocates a new buffer containing the given {array} of octets.
104
+ *
105
+ * @param array The octets to store.
106
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
107
+ */
108
+ constructor(array: Uint8Array);
109
+ /**
110
+ * Produces a Buffer backed by the same allocated memory as
111
+ * the given {ArrayBuffer}/{SharedArrayBuffer}.
112
+ *
113
+ *
114
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
115
+ * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
116
+ */
117
+ constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer);
118
+ /**
119
+ * Allocates a new buffer containing the given {array} of octets.
120
+ *
121
+ * @param array The octets to store.
122
+ * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
123
+ */
124
+ constructor(array: ReadonlyArray<any>);
125
+ /**
126
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
127
+ *
128
+ * @param buffer The buffer to copy.
129
+ * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
130
+ */
131
+ constructor(buffer: Buffer);
132
+ /**
133
+ * When passed a reference to the .buffer property of a TypedArray instance,
134
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
135
+ * The optional {byteOffset} and {length} arguments specify a memory range
136
+ * within the {arrayBuffer} that will be shared by the Buffer.
137
+ *
138
+ * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
139
+ */
140
+ static from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
141
+ /**
142
+ * Creates a new Buffer using the passed {data}
143
+ * @param data data to create a new Buffer
144
+ */
145
+ static from(data: Uint8Array | ReadonlyArray<number>): Buffer;
146
+ static from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
147
+ /**
148
+ * Creates a new Buffer containing the given JavaScript string {str}.
149
+ * If provided, the {encoding} parameter identifies the character encoding.
150
+ * If not provided, {encoding} defaults to 'utf8'.
151
+ */
152
+ static from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
153
+ /**
154
+ * Creates a new Buffer using the passed {data}
155
+ * @param values to create a new Buffer
156
+ */
157
+ static of(...items: number[]): Buffer;
158
+ /**
159
+ * Returns true if {obj} is a Buffer
160
+ *
161
+ * @param obj object to test.
162
+ */
163
+ static isBuffer(obj: any): obj is Buffer;
164
+ /**
165
+ * Returns true if {encoding} is a valid encoding argument.
166
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
167
+ *
168
+ * @param encoding string to test.
169
+ */
170
+ static isEncoding(encoding: string): encoding is BufferEncoding;
171
+ /**
172
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
173
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
174
+ *
175
+ * @param string string to test.
176
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
177
+ */
178
+ static byteLength(
179
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
180
+ encoding?: BufferEncoding
181
+ ): number;
182
+ /**
183
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
184
+ *
185
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
186
+ * If the list has exactly one item, then the first item of the list is returned.
187
+ * If the list has more than one item, then a new Buffer is created.
188
+ *
189
+ * @param list An array of Buffer objects to concatenate
190
+ * @param totalLength Total length of the buffers when concatenated.
191
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
192
+ */
193
+ static concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
194
+ /**
195
+ * The same as buf1.compare(buf2).
196
+ */
197
+ static compare(buf1: Uint8Array, buf2: Uint8Array): number;
198
+ /**
199
+ * Allocates a new buffer of {size} octets.
200
+ *
201
+ * @param size count of octets to allocate.
202
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
203
+ * If parameter is omitted, buffer will be filled with zeros.
204
+ * @param encoding encoding used for call to buf.fill while initalizing
205
+ */
206
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
207
+ /**
208
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
209
+ * of the newly created Buffer are unknown and may contain sensitive data.
210
+ *
211
+ * @param size count of octets to allocate
212
+ */
213
+ static allocUnsafe(size: number): Buffer;
214
+ /**
215
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
216
+ * of the newly created Buffer are unknown and may contain sensitive data.
217
+ *
218
+ * @param size count of octets to allocate
219
+ */
220
+ static allocUnsafeSlow(size: number): Buffer;
221
+ /**
222
+ * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
223
+ */
224
+ static poolSize: number;
225
+
226
+ write(string: string, encoding?: BufferEncoding): number;
227
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
228
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
229
+ toString(encoding?: BufferEncoding, start?: number, end?: number): string;
230
+ toJSON(): { type: 'Buffer'; data: number[] };
231
+ equals(otherBuffer: Uint8Array): boolean;
232
+ compare(
233
+ otherBuffer: Uint8Array,
234
+ targetStart?: number,
235
+ targetEnd?: number,
236
+ sourceStart?: number,
237
+ sourceEnd?: number
238
+ ): number;
239
+ copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
240
+ /**
241
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
242
+ *
243
+ * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
244
+ *
245
+ * @param begin Where the new `Buffer` will start. Default: `0`.
246
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
247
+ */
248
+ slice(begin?: number, end?: number): Buffer;
249
+ /**
250
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
251
+ *
252
+ * This method is compatible with `Uint8Array#subarray()`.
253
+ *
254
+ * @param begin Where the new `Buffer` will start. Default: `0`.
255
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
256
+ */
257
+ subarray(begin?: number, end?: number): Buffer;
258
+ writeBigInt64BE(value: bigint, offset?: number): number;
259
+ writeBigInt64LE(value: bigint, offset?: number): number;
260
+ writeBigUInt64BE(value: bigint, offset?: number): number;
261
+ writeBigUInt64LE(value: bigint, offset?: number): number;
262
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
263
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
264
+ writeIntLE(value: number, offset: number, byteLength: number): number;
265
+ writeIntBE(value: number, offset: number, byteLength: number): number;
266
+ readBigUInt64BE(offset?: number): bigint;
267
+ readBigUInt64LE(offset?: number): bigint;
268
+ readBigInt64BE(offset?: number): bigint;
269
+ readBigInt64LE(offset?: number): bigint;
270
+ readUIntLE(offset: number, byteLength: number): number;
271
+ readUIntBE(offset: number, byteLength: number): number;
272
+ readIntLE(offset: number, byteLength: number): number;
273
+ readIntBE(offset: number, byteLength: number): number;
274
+ readUInt8(offset?: number): number;
275
+ readUInt16LE(offset?: number): number;
276
+ readUInt16BE(offset?: number): number;
277
+ readUInt32LE(offset?: number): number;
278
+ readUInt32BE(offset?: number): number;
279
+ readInt8(offset?: number): number;
280
+ readInt16LE(offset?: number): number;
281
+ readInt16BE(offset?: number): number;
282
+ readInt32LE(offset?: number): number;
283
+ readInt32BE(offset?: number): number;
284
+ readFloatLE(offset?: number): number;
285
+ readFloatBE(offset?: number): number;
286
+ readDoubleLE(offset?: number): number;
287
+ readDoubleBE(offset?: number): number;
288
+ reverse(): this;
289
+ swap16(): Buffer;
290
+ swap32(): Buffer;
291
+ swap64(): Buffer;
292
+ writeUInt8(value: number, offset?: number): number;
293
+ writeUInt16LE(value: number, offset?: number): number;
294
+ writeUInt16BE(value: number, offset?: number): number;
295
+ writeUInt32LE(value: number, offset?: number): number;
296
+ writeUInt32BE(value: number, offset?: number): number;
297
+ writeInt8(value: number, offset?: number): number;
298
+ writeInt16LE(value: number, offset?: number): number;
299
+ writeInt16BE(value: number, offset?: number): number;
300
+ writeInt32LE(value: number, offset?: number): number;
301
+ writeInt32BE(value: number, offset?: number): number;
302
+ writeFloatLE(value: number, offset?: number): number;
303
+ writeFloatBE(value: number, offset?: number): number;
304
+ writeDoubleLE(value: number, offset?: number): number;
305
+ writeDoubleBE(value: number, offset?: number): number;
306
+
307
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
308
+
309
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
310
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
311
+ entries(): IterableIterator<[number, number]>;
312
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
313
+ keys(): IterableIterator<number>;
314
+ values(): IterableIterator<number>;
315
+ }
316
+
317
+ /*----------------------------------------------*
318
+ * *
319
+ * GLOBAL INTERFACES *
320
+ * *
321
+ *-----------------------------------------------*/
322
+ declare namespace NodeJS {
323
+ interface InspectOptions {
324
+ /**
325
+ * If set to `true`, getters are going to be
326
+ * inspected as well. If set to `'get'` only getters without setter are going
327
+ * to be inspected. If set to `'set'` only getters having a corresponding
328
+ * setter are going to be inspected. This might cause side effects depending on
329
+ * the getter function.
330
+ * @default `false`
331
+ */
332
+ getters?: 'get' | 'set' | boolean | undefined;
333
+ showHidden?: boolean | undefined;
334
+ /**
335
+ * @default 2
336
+ */
337
+ depth?: number | null | undefined;
338
+ colors?: boolean | undefined;
339
+ customInspect?: boolean | undefined;
340
+ showProxy?: boolean | undefined;
341
+ maxArrayLength?: number | null | undefined;
342
+ /**
343
+ * Specifies the maximum number of characters to
344
+ * include when formatting. Set to `null` or `Infinity` to show all elements.
345
+ * Set to `0` or negative to show no characters.
346
+ * @default Infinity
347
+ */
348
+ maxStringLength?: number | null | undefined;
349
+ breakLength?: number | undefined;
350
+ /**
351
+ * Setting this to `false` causes each object key
352
+ * to be displayed on a new line. It will also add new lines to text that is
353
+ * longer than `breakLength`. If set to a number, the most `n` inner elements
354
+ * are united on a single line as long as all properties fit into
355
+ * `breakLength`. Short array elements are also grouped together. Note that no
356
+ * text will be reduced below 16 characters, no matter the `breakLength` size.
357
+ * For more information, see the example below.
358
+ * @default `true`
359
+ */
360
+ compact?: boolean | number | undefined;
361
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
362
+ }
363
+
364
+ interface CallSite {
365
+ /**
366
+ * Value of "this"
367
+ */
368
+ getThis(): any;
369
+
370
+ /**
371
+ * Type of "this" as a string.
372
+ * This is the name of the function stored in the constructor field of
373
+ * "this", if available. Otherwise the object's [[Class]] internal
374
+ * property.
375
+ */
376
+ getTypeName(): string | null;
377
+
378
+ /**
379
+ * Current function
380
+ */
381
+ getFunction(): Function | undefined;
382
+
383
+ /**
384
+ * Name of the current function, typically its name property.
385
+ * If a name property is not available an attempt will be made to try
386
+ * to infer a name from the function's context.
387
+ */
388
+ getFunctionName(): string | null;
389
+
390
+ /**
391
+ * Name of the property [of "this" or one of its prototypes] that holds
392
+ * the current function
393
+ */
394
+ getMethodName(): string | null;
395
+
396
+ /**
397
+ * Name of the script [if this function was defined in a script]
398
+ */
399
+ getFileName(): string | null;
400
+
401
+ /**
402
+ * Current line number [if this function was defined in a script]
403
+ */
404
+ getLineNumber(): number | null;
405
+
406
+ /**
407
+ * Current column number [if this function was defined in a script]
408
+ */
409
+ getColumnNumber(): number | null;
410
+
411
+ /**
412
+ * A call site object representing the location where eval was called
413
+ * [if this function was created using a call to eval]
414
+ */
415
+ getEvalOrigin(): string | undefined;
416
+
417
+ /**
418
+ * Is this a toplevel invocation, that is, is "this" the global object?
419
+ */
420
+ isToplevel(): boolean;
421
+
422
+ /**
423
+ * Does this call take place in code defined by a call to eval?
424
+ */
425
+ isEval(): boolean;
426
+
427
+ /**
428
+ * Is this call in native V8 code?
429
+ */
430
+ isNative(): boolean;
431
+
432
+ /**
433
+ * Is this a constructor call?
434
+ */
435
+ isConstructor(): boolean;
436
+ }
437
+
438
+ interface ErrnoException extends Error {
439
+ errno?: number | undefined;
440
+ code?: string | undefined;
441
+ path?: string | undefined;
442
+ syscall?: string | undefined;
443
+ }
444
+
445
+ interface ReadableStream extends EventEmitter {
446
+ readable: boolean;
447
+ read(size?: number): string | Buffer;
448
+ setEncoding(encoding: BufferEncoding): this;
449
+ pause(): this;
450
+ resume(): this;
451
+ isPaused(): boolean;
452
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
453
+ unpipe(destination?: WritableStream): this;
454
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
455
+ wrap(oldStream: ReadableStream): this;
456
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
457
+ }
458
+
459
+ interface WritableStream extends EventEmitter {
460
+ writable: boolean;
461
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
462
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
463
+ end(cb?: () => void): void;
464
+ end(data: string | Uint8Array, cb?: () => void): void;
465
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
466
+ }
467
+
468
+ interface ReadWriteStream extends ReadableStream, WritableStream { }
469
+
470
+ interface Global {
471
+ Array: typeof Array;
472
+ ArrayBuffer: typeof ArrayBuffer;
473
+ Boolean: typeof Boolean;
474
+ Buffer: typeof Buffer;
475
+ DataView: typeof DataView;
476
+ Date: typeof Date;
477
+ Error: typeof Error;
478
+ EvalError: typeof EvalError;
479
+ Float32Array: typeof Float32Array;
480
+ Float64Array: typeof Float64Array;
481
+ Function: typeof Function;
482
+ Infinity: typeof Infinity;
483
+ Int16Array: typeof Int16Array;
484
+ Int32Array: typeof Int32Array;
485
+ Int8Array: typeof Int8Array;
486
+ Intl: typeof Intl;
487
+ JSON: typeof JSON;
488
+ Map: MapConstructor;
489
+ Math: typeof Math;
490
+ NaN: typeof NaN;
491
+ Number: typeof Number;
492
+ Object: typeof Object;
493
+ Promise: typeof Promise;
494
+ RangeError: typeof RangeError;
495
+ ReferenceError: typeof ReferenceError;
496
+ RegExp: typeof RegExp;
497
+ Set: SetConstructor;
498
+ String: typeof String;
499
+ Symbol: Function;
500
+ SyntaxError: typeof SyntaxError;
501
+ TypeError: typeof TypeError;
502
+ URIError: typeof URIError;
503
+ Uint16Array: typeof Uint16Array;
504
+ Uint32Array: typeof Uint32Array;
505
+ Uint8Array: typeof Uint8Array;
506
+ Uint8ClampedArray: typeof Uint8ClampedArray;
507
+ WeakMap: WeakMapConstructor;
508
+ WeakSet: WeakSetConstructor;
509
+ clearImmediate: (immediateId: Immediate) => void;
510
+ clearInterval: (intervalId: Timeout) => void;
511
+ clearTimeout: (timeoutId: Timeout) => void;
512
+ decodeURI: typeof decodeURI;
513
+ decodeURIComponent: typeof decodeURIComponent;
514
+ encodeURI: typeof encodeURI;
515
+ encodeURIComponent: typeof encodeURIComponent;
516
+ escape: (str: string) => string;
517
+ eval: typeof eval;
518
+ global: Global;
519
+ isFinite: typeof isFinite;
520
+ isNaN: typeof isNaN;
521
+ parseFloat: typeof parseFloat;
522
+ parseInt: typeof parseInt;
523
+ setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
524
+ setInterval: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout;
525
+ setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout;
526
+ queueMicrotask: typeof queueMicrotask;
527
+ undefined: typeof undefined;
528
+ unescape: (str: string) => string;
529
+ gc: () => void;
530
+ v8debug?: any;
531
+ }
532
+
533
+ interface RefCounted {
534
+ ref(): this;
535
+ unref(): this;
536
+ }
537
+
538
+ // compatibility with older typings
539
+ interface Timer extends RefCounted {
540
+ hasRef(): boolean;
541
+ refresh(): this;
542
+ [Symbol.toPrimitive](): number;
543
+ }
544
+
545
+ interface Immediate extends RefCounted {
546
+ hasRef(): boolean;
547
+ _onImmediate: Function; // to distinguish it from the Timeout class
548
+ }
549
+
550
+ interface Timeout extends Timer {
551
+ hasRef(): boolean;
552
+ refresh(): this;
553
+ [Symbol.toPrimitive](): number;
554
+ }
555
+
556
+ type TypedArray =
557
+ | Uint8Array
558
+ | Uint8ClampedArray
559
+ | Uint16Array
560
+ | Uint32Array
561
+ | Int8Array
562
+ | Int16Array
563
+ | Int32Array
564
+ | BigUint64Array
565
+ | BigInt64Array
566
+ | Float32Array
567
+ | Float64Array;
568
+ type ArrayBufferView = TypedArray | DataView;
569
+
570
+ interface Require {
571
+ (id: string): any;
572
+ resolve: RequireResolve;
573
+ cache: Dict<NodeModule>;
574
+ /**
575
+ * @deprecated
576
+ */
577
+ extensions: RequireExtensions;
578
+ main: Module | undefined;
579
+ }
580
+
581
+ interface RequireResolve {
582
+ (id: string, options?: { paths?: string[] | undefined; }): string;
583
+ paths(request: string): string[] | null;
584
+ }
585
+
586
+ interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
587
+ '.js': (m: Module, filename: string) => any;
588
+ '.json': (m: Module, filename: string) => any;
589
+ '.node': (m: Module, filename: string) => any;
590
+ }
591
+ interface Module {
592
+ exports: any;
593
+ require: Require;
594
+ id: string;
595
+ filename: string;
596
+ loaded: boolean;
597
+ /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
598
+ parent: Module | null | undefined;
599
+ children: Module[];
600
+ /**
601
+ * @since 11.14.0
602
+ *
603
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
604
+ */
605
+ path: string;
606
+ paths: string[];
607
+ }
608
+
609
+ interface Dict<T> {
610
+ [key: string]: T | undefined;
611
+ }
612
+
613
+ interface ReadOnlyDict<T> {
614
+ readonly [key: string]: T | undefined;
615
+ }
616
+ }