@types/node 14.18.8 → 15.0.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.
- {node v14.18 → node}/LICENSE +0 -0
- node/README.md +16 -0
- node/assert/strict.d.ts +4 -0
- node v14.18/assert.d.ts → node/assert.d.ts +3 -7
- node v14.18/async_hooks.d.ts → node/async_hooks.d.ts +4 -7
- node/base.d.ts +19 -0
- node/buffer.d.ts +22 -0
- node v14.18/child_process.d.ts → node/child_process.d.ts +63 -67
- node v14.18/cluster.d.ts → node/cluster.d.ts +10 -13
- node v14.18/console.d.ts → node/console.d.ts +13 -22
- node v14.18/constants.d.ts → node/constants.d.ts +0 -5
- node v14.18/crypto.d.ts → node/crypto.d.ts +134 -53
- node v14.18/dgram.d.ts → node/dgram.d.ts +17 -20
- node/dns/promises.d.ts +97 -0
- node/dns.d.ts +322 -0
- node v14.18/domain.d.ts → node/domain.d.ts +0 -3
- node v14.18/events.d.ts → node/events.d.ts +8 -8
- node v14.18/fs/promises.d.ts → node/fs/promises.d.ts +18 -29
- node v14.18/fs.d.ts → node/fs.d.ts +77 -93
- node v14.18/globals.d.ts → node/globals.d.ts +60 -24
- {node v14.18 → node}/globals.global.d.ts +0 -0
- node v14.18/http.d.ts → node/http.d.ts +108 -176
- node v14.18/http2.d.ts → node/http2.d.ts +74 -71
- node/https.d.ts +36 -0
- node v14.18/index.d.ts → node/index.d.ts +15 -55
- node v14.18/inspector.d.ts → node/inspector.d.ts +151 -161
- node v14.18/module.d.ts → node/module.d.ts +0 -4
- node v14.18/net.d.ts → node/net.d.ts +70 -42
- node v14.18/os.d.ts → node/os.d.ts +0 -3
- node v14.18/package.json → node/package.json +25 -19
- node v14.18/path.d.ts → node/path.d.ts +5 -9
- node v14.18/perf_hooks.d.ts → node/perf_hooks.d.ts +5 -8
- node v14.18/process.d.ts → node/process.d.ts +53 -17
- node v14.18/punycode.d.ts → node/punycode.d.ts +0 -3
- node v14.18/querystring.d.ts → node/querystring.d.ts +3 -6
- node v14.18/readline.d.ts → node/readline.d.ts +14 -18
- node v14.18/repl.d.ts → node/repl.d.ts +17 -20
- node/stream/promises.d.ts +67 -0
- node v14.18/stream.d.ts → node/stream.d.ts +164 -60
- node v14.18/string_decoder.d.ts → node/string_decoder.d.ts +0 -3
- node/timers/promises.d.ts +13 -0
- node v14.18/timers.d.ts → node/timers.d.ts +16 -5
- node v14.18/tls.d.ts → node/tls.d.ts +51 -56
- node v14.18/trace_events.d.ts → node/trace_events.d.ts +0 -3
- node/ts3.6/assert.d.ts +98 -0
- node/ts3.6/base.d.ts +66 -0
- node/ts3.6/index.d.ts +7 -0
- node v14.18/tty.d.ts → node/tty.d.ts +0 -3
- node v14.18/url.d.ts → node/url.d.ts +16 -19
- node v14.18/util.d.ts → node/util.d.ts +3 -12
- node v14.18/v8.d.ts → node/v8.d.ts +0 -3
- node v14.18/vm.d.ts → node/vm.d.ts +25 -28
- node v14.18/wasi.d.ts → node/wasi.d.ts +7 -10
- node v14.18/worker_threads.d.ts → node/worker_threads.d.ts +18 -18
- node v14.18/zlib.d.ts → node/zlib.d.ts +16 -19
- node v14.18/README.md +0 -16
- node v14.18/buffer.d.ts +0 -89
- node v14.18/dns.d.ts +0 -387
- node v14.18/https.d.ts +0 -142
|
@@ -3,12 +3,14 @@ declare module 'crypto' {
|
|
|
3
3
|
|
|
4
4
|
interface Certificate {
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated
|
|
6
7
|
* @param spkac
|
|
7
8
|
* @returns The challenge component of the `spkac` data structure,
|
|
8
9
|
* which includes a public key and a challenge.
|
|
9
10
|
*/
|
|
10
11
|
exportChallenge(spkac: BinaryLike): Buffer;
|
|
11
12
|
/**
|
|
13
|
+
* @deprecated
|
|
12
14
|
* @param spkac
|
|
13
15
|
* @param encoding The encoding of the spkac string.
|
|
14
16
|
* @returns The public key component of the `spkac` data structure,
|
|
@@ -16,6 +18,7 @@ declare module 'crypto' {
|
|
|
16
18
|
*/
|
|
17
19
|
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
18
20
|
/**
|
|
21
|
+
* @deprecated
|
|
19
22
|
* @param spkac
|
|
20
23
|
* @returns `true` if the given `spkac` data structure is valid,
|
|
21
24
|
* `false` otherwise.
|
|
@@ -24,9 +27,29 @@ declare module 'crypto' {
|
|
|
24
27
|
}
|
|
25
28
|
const Certificate: Certificate & {
|
|
26
29
|
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
27
|
-
new
|
|
30
|
+
new(): Certificate;
|
|
28
31
|
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
|
29
32
|
(): Certificate;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param spkac
|
|
36
|
+
* @returns The challenge component of the `spkac` data structure,
|
|
37
|
+
* which includes a public key and a challenge.
|
|
38
|
+
*/
|
|
39
|
+
exportChallenge(spkac: BinaryLike): Buffer;
|
|
40
|
+
/**
|
|
41
|
+
* @param spkac
|
|
42
|
+
* @param encoding The encoding of the spkac string.
|
|
43
|
+
* @returns The public key component of the `spkac` data structure,
|
|
44
|
+
* which includes a public key and a challenge.
|
|
45
|
+
*/
|
|
46
|
+
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
|
47
|
+
/**
|
|
48
|
+
* @param spkac
|
|
49
|
+
* @returns `true` if the given `spkac` data structure is valid,
|
|
50
|
+
* `false` otherwise.
|
|
51
|
+
*/
|
|
52
|
+
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
30
53
|
};
|
|
31
54
|
|
|
32
55
|
namespace constants {
|
|
@@ -130,7 +153,7 @@ declare module 'crypto' {
|
|
|
130
153
|
* For XOF hash functions such as `shake256`, the
|
|
131
154
|
* outputLength option can be used to specify the desired output length in bytes.
|
|
132
155
|
*/
|
|
133
|
-
outputLength?: number
|
|
156
|
+
outputLength?: number;
|
|
134
157
|
}
|
|
135
158
|
|
|
136
159
|
/** @deprecated since v10.0.0 */
|
|
@@ -140,7 +163,7 @@ declare module 'crypto' {
|
|
|
140
163
|
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
|
141
164
|
|
|
142
165
|
// https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
|
|
143
|
-
type BinaryToTextEncoding = 'base64' | '
|
|
166
|
+
type BinaryToTextEncoding = 'base64' | 'hex';
|
|
144
167
|
type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
|
|
145
168
|
type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
|
|
146
169
|
|
|
@@ -169,21 +192,21 @@ declare module 'crypto' {
|
|
|
169
192
|
interface KeyExportOptions<T extends KeyFormat> {
|
|
170
193
|
type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
|
|
171
194
|
format: T;
|
|
172
|
-
cipher?: string
|
|
173
|
-
passphrase?: string | Buffer
|
|
195
|
+
cipher?: string;
|
|
196
|
+
passphrase?: string | Buffer;
|
|
174
197
|
}
|
|
175
198
|
|
|
176
199
|
class KeyObject {
|
|
177
200
|
private constructor();
|
|
178
|
-
asymmetricKeyType?: KeyType
|
|
201
|
+
asymmetricKeyType?: KeyType;
|
|
179
202
|
/**
|
|
180
203
|
* For asymmetric keys, this property represents the size of the embedded key in
|
|
181
204
|
* bytes. This property is `undefined` for symmetric keys.
|
|
182
205
|
*/
|
|
183
|
-
asymmetricKeySize?: number
|
|
206
|
+
asymmetricKeySize?: number;
|
|
184
207
|
export(options: KeyExportOptions<'pem'>): string | Buffer;
|
|
185
208
|
export(options?: KeyExportOptions<'der'>): Buffer;
|
|
186
|
-
symmetricKeySize?: number
|
|
209
|
+
symmetricKeySize?: number;
|
|
187
210
|
type: KeyObjectType;
|
|
188
211
|
}
|
|
189
212
|
|
|
@@ -198,7 +221,7 @@ declare module 'crypto' {
|
|
|
198
221
|
authTagLength: number;
|
|
199
222
|
}
|
|
200
223
|
interface CipherGCMOptions extends stream.TransformOptions {
|
|
201
|
-
authTagLength?: number
|
|
224
|
+
authTagLength?: number;
|
|
202
225
|
}
|
|
203
226
|
/** @deprecated since v10.0.0 use `createCipheriv()` */
|
|
204
227
|
function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
|
|
@@ -295,15 +318,15 @@ declare module 'crypto' {
|
|
|
295
318
|
|
|
296
319
|
interface PrivateKeyInput {
|
|
297
320
|
key: string | Buffer;
|
|
298
|
-
format?: KeyFormat
|
|
299
|
-
type?: 'pkcs1' | 'pkcs8' | 'sec1'
|
|
300
|
-
passphrase?: string | Buffer
|
|
321
|
+
format?: KeyFormat;
|
|
322
|
+
type?: 'pkcs1' | 'pkcs8' | 'sec1';
|
|
323
|
+
passphrase?: string | Buffer;
|
|
301
324
|
}
|
|
302
325
|
|
|
303
326
|
interface PublicKeyInput {
|
|
304
327
|
key: string | Buffer;
|
|
305
|
-
format?: KeyFormat
|
|
306
|
-
type?: 'pkcs1' | 'spki'
|
|
328
|
+
format?: KeyFormat;
|
|
329
|
+
type?: 'pkcs1' | 'spki';
|
|
307
330
|
}
|
|
308
331
|
|
|
309
332
|
function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
|
|
@@ -318,16 +341,16 @@ declare module 'crypto' {
|
|
|
318
341
|
/**
|
|
319
342
|
* @See crypto.constants.RSA_PKCS1_PADDING
|
|
320
343
|
*/
|
|
321
|
-
padding?: number
|
|
322
|
-
saltLength?: number
|
|
323
|
-
dsaEncoding?: DSAEncoding
|
|
344
|
+
padding?: number;
|
|
345
|
+
saltLength?: number;
|
|
346
|
+
dsaEncoding?: DSAEncoding;
|
|
324
347
|
}
|
|
325
348
|
|
|
326
|
-
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
349
|
+
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions { }
|
|
327
350
|
interface SignKeyObjectInput extends SigningOptions {
|
|
328
351
|
key: KeyObject;
|
|
329
352
|
}
|
|
330
|
-
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
|
|
353
|
+
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions { }
|
|
331
354
|
interface VerifyKeyObjectInput extends SigningOptions {
|
|
332
355
|
key: KeyObject;
|
|
333
356
|
}
|
|
@@ -448,28 +471,14 @@ declare module 'crypto' {
|
|
|
448
471
|
callback: (err: Error | null, buf: T) => void,
|
|
449
472
|
): void;
|
|
450
473
|
|
|
451
|
-
interface RandomUUIDOptions {
|
|
452
|
-
/**
|
|
453
|
-
* By default, to improve performance,
|
|
454
|
-
* Node.js will pre-emptively generate and persistently cache enough
|
|
455
|
-
* random data to generate up to 128 random UUIDs. To generate a UUID
|
|
456
|
-
* without using the cache, set `disableEntropyCache` to `true`.
|
|
457
|
-
*
|
|
458
|
-
* @default `false`
|
|
459
|
-
*/
|
|
460
|
-
disableEntropyCache?: boolean | undefined;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
function randomUUID(options?: RandomUUIDOptions): string;
|
|
464
|
-
|
|
465
474
|
interface ScryptOptions {
|
|
466
|
-
cost?: number
|
|
467
|
-
blockSize?: number
|
|
468
|
-
parallelization?: number
|
|
469
|
-
N?: number
|
|
470
|
-
r?: number
|
|
471
|
-
p?: number
|
|
472
|
-
maxmem?: number
|
|
475
|
+
cost?: number;
|
|
476
|
+
blockSize?: number;
|
|
477
|
+
parallelization?: number;
|
|
478
|
+
N?: number;
|
|
479
|
+
r?: number;
|
|
480
|
+
p?: number;
|
|
481
|
+
maxmem?: number;
|
|
473
482
|
}
|
|
474
483
|
function scrypt(
|
|
475
484
|
password: BinaryLike,
|
|
@@ -488,17 +497,17 @@ declare module 'crypto' {
|
|
|
488
497
|
|
|
489
498
|
interface RsaPublicKey {
|
|
490
499
|
key: KeyLike;
|
|
491
|
-
padding?: number
|
|
500
|
+
padding?: number;
|
|
492
501
|
}
|
|
493
502
|
interface RsaPrivateKey {
|
|
494
503
|
key: KeyLike;
|
|
495
|
-
passphrase?: string
|
|
504
|
+
passphrase?: string;
|
|
496
505
|
/**
|
|
497
506
|
* @default 'sha1'
|
|
498
507
|
*/
|
|
499
|
-
oaepHash?: string
|
|
500
|
-
oaepLabel?: NodeJS.TypedArray
|
|
501
|
-
padding?: number
|
|
508
|
+
oaepHash?: string;
|
|
509
|
+
oaepLabel?: NodeJS.TypedArray;
|
|
510
|
+
padding?: number;
|
|
502
511
|
}
|
|
503
512
|
function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
504
513
|
function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
@@ -514,7 +523,7 @@ declare module 'crypto' {
|
|
|
514
523
|
key: BinaryLike,
|
|
515
524
|
curve: string,
|
|
516
525
|
inputEncoding?: BinaryToTextEncoding,
|
|
517
|
-
outputEncoding?: 'latin1' | 'hex' | 'base64'
|
|
526
|
+
outputEncoding?: 'latin1' | 'hex' | 'base64',
|
|
518
527
|
format?: 'uncompressed' | 'compressed' | 'hybrid',
|
|
519
528
|
): Buffer | string;
|
|
520
529
|
generateKeys(): Buffer;
|
|
@@ -544,8 +553,8 @@ declare module 'crypto' {
|
|
|
544
553
|
|
|
545
554
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
546
555
|
format: T;
|
|
547
|
-
cipher?: string
|
|
548
|
-
passphrase?: string
|
|
556
|
+
cipher?: string;
|
|
557
|
+
passphrase?: string;
|
|
549
558
|
}
|
|
550
559
|
|
|
551
560
|
interface KeyPairKeyObjectResult {
|
|
@@ -593,7 +602,7 @@ declare module 'crypto' {
|
|
|
593
602
|
/**
|
|
594
603
|
* @default 0x10001
|
|
595
604
|
*/
|
|
596
|
-
publicExponent?: number
|
|
605
|
+
publicExponent?: number;
|
|
597
606
|
}
|
|
598
607
|
|
|
599
608
|
interface DSAKeyPairKeyObjectOptions {
|
|
@@ -616,7 +625,7 @@ declare module 'crypto' {
|
|
|
616
625
|
/**
|
|
617
626
|
* @default 0x10001
|
|
618
627
|
*/
|
|
619
|
-
publicExponent?: number
|
|
628
|
+
publicExponent?: number;
|
|
620
629
|
|
|
621
630
|
publicKeyEncoding: {
|
|
622
631
|
type: 'pkcs1' | 'spki';
|
|
@@ -1183,7 +1192,79 @@ declare module 'crypto' {
|
|
|
1183
1192
|
* 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
|
|
1184
1193
|
*/
|
|
1185
1194
|
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1195
|
+
|
|
1196
|
+
type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts';
|
|
1197
|
+
|
|
1198
|
+
interface CipherInfoOptions {
|
|
1199
|
+
/**
|
|
1200
|
+
* A test key length.
|
|
1201
|
+
*/
|
|
1202
|
+
keyLength?: number;
|
|
1203
|
+
/**
|
|
1204
|
+
* A test IV length.
|
|
1205
|
+
*/
|
|
1206
|
+
ivLength?: number;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
interface CipherInfo {
|
|
1210
|
+
/**
|
|
1211
|
+
* The name of the cipher.
|
|
1212
|
+
*/
|
|
1213
|
+
name: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* The nid of the cipher.
|
|
1216
|
+
*/
|
|
1217
|
+
nid: number;
|
|
1218
|
+
/**
|
|
1219
|
+
* The block size of the cipher in bytes.
|
|
1220
|
+
* This property is omitted when mode is 'stream'.
|
|
1221
|
+
*/
|
|
1222
|
+
blockSize?: number;
|
|
1223
|
+
/**
|
|
1224
|
+
* The expected or default initialization vector length in bytes.
|
|
1225
|
+
* This property is omitted if the cipher does not use an initialization vector.
|
|
1226
|
+
*/
|
|
1227
|
+
ivLength?: number;
|
|
1228
|
+
/**
|
|
1229
|
+
* The expected or default key length in bytes.
|
|
1230
|
+
*/
|
|
1231
|
+
keyLength: number;
|
|
1232
|
+
/**
|
|
1233
|
+
* The cipher mode.
|
|
1234
|
+
*/
|
|
1235
|
+
mode: CipherMode;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Returns information about a given cipher.
|
|
1240
|
+
*
|
|
1241
|
+
* Some ciphers accept variable length keys and initialization vectors.
|
|
1242
|
+
* By default, the `crypto.getCipherInfo()` method will return the default
|
|
1243
|
+
* values for these ciphers. To test if a given key length or iv length
|
|
1244
|
+
* is acceptable for given cipher, use the `keyLenth` and `ivLenth` options.
|
|
1245
|
+
* If the given values are unacceptable, `undefined` will be returned.
|
|
1246
|
+
* @param nameOrNid The name or nid of the cipher to query.
|
|
1247
|
+
*/
|
|
1248
|
+
function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* HKDF is a simple key derivation function defined in RFC 5869.
|
|
1252
|
+
* The given `key`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
|
|
1253
|
+
*
|
|
1254
|
+
* The supplied `callback` function is called with two arguments: `err` and `derivedKey`.
|
|
1255
|
+
* If an errors occurs while deriving the key, `err` will be set; otherwise `err` will be `null`.
|
|
1256
|
+
* The successfully generated `derivedKey` will be passed to the callback as an [`ArrayBuffer`][].
|
|
1257
|
+
* An error will be thrown if any of the input aguments specify invalid values or types.
|
|
1258
|
+
*/
|
|
1259
|
+
function hkdf(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => any): void;
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* Provides a synchronous HKDF key derivation function as defined in RFC 5869.
|
|
1263
|
+
* The given `key`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
|
|
1264
|
+
*
|
|
1265
|
+
* The successfully generated `derivedKey` will be returned as an [`ArrayBuffer`][].
|
|
1266
|
+
* An error will be thrown if any of the input aguments specify invalid values or types,
|
|
1267
|
+
* or if the derived key cannot be generated.
|
|
1268
|
+
*/
|
|
1269
|
+
function hkdfSync(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer;
|
|
1189
1270
|
}
|
|
@@ -11,24 +11,24 @@ declare module 'dgram' {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
interface BindOptions {
|
|
14
|
-
port?: number
|
|
15
|
-
address?: string
|
|
16
|
-
exclusive?: boolean
|
|
17
|
-
fd?: number
|
|
14
|
+
port?: number;
|
|
15
|
+
address?: string;
|
|
16
|
+
exclusive?: boolean;
|
|
17
|
+
fd?: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
type SocketType = "udp4" | "udp6";
|
|
21
21
|
|
|
22
22
|
interface SocketOptions {
|
|
23
23
|
type: SocketType;
|
|
24
|
-
reuseAddr?: boolean
|
|
24
|
+
reuseAddr?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
|
-
ipv6Only?: boolean
|
|
29
|
-
recvBufferSize?: number
|
|
30
|
-
sendBufferSize?: number
|
|
31
|
-
lookup?: (
|
|
28
|
+
ipv6Only?: boolean;
|
|
29
|
+
recvBufferSize?: number;
|
|
30
|
+
sendBufferSize?: number;
|
|
31
|
+
lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
|
@@ -37,11 +37,11 @@ declare module 'dgram' {
|
|
|
37
37
|
class Socket extends EventEmitter {
|
|
38
38
|
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
|
39
39
|
address(): AddressInfo;
|
|
40
|
-
bind(port?: number, address?: string, callback?: () => void):
|
|
41
|
-
bind(port?: number, callback?: () => void):
|
|
42
|
-
bind(callback?: () => void):
|
|
43
|
-
bind(options: BindOptions, callback?: () => void):
|
|
44
|
-
close(callback?: () => void):
|
|
40
|
+
bind(port?: number, address?: string, callback?: () => void): void;
|
|
41
|
+
bind(port?: number, callback?: () => void): void;
|
|
42
|
+
bind(callback?: () => void): void;
|
|
43
|
+
bind(options: BindOptions, callback?: () => void): void;
|
|
44
|
+
close(callback?: () => void): void;
|
|
45
45
|
connect(port: number, address?: string, callback?: () => void): void;
|
|
46
46
|
connect(port: number, callback: () => void): void;
|
|
47
47
|
disconnect(): void;
|
|
@@ -58,11 +58,11 @@ declare module 'dgram' {
|
|
|
58
58
|
send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
|
|
59
59
|
setBroadcast(flag: boolean): void;
|
|
60
60
|
setMulticastInterface(multicastInterface: string): void;
|
|
61
|
-
setMulticastLoopback(flag: boolean):
|
|
62
|
-
setMulticastTTL(ttl: number):
|
|
61
|
+
setMulticastLoopback(flag: boolean): void;
|
|
62
|
+
setMulticastTTL(ttl: number): void;
|
|
63
63
|
setRecvBufferSize(size: number): void;
|
|
64
64
|
setSendBufferSize(size: number): void;
|
|
65
|
-
setTTL(ttl: number):
|
|
65
|
+
setTTL(ttl: number): void;
|
|
66
66
|
unref(): this;
|
|
67
67
|
/**
|
|
68
68
|
* Tells the kernel to join a source-specific multicast channel at the given
|
|
@@ -139,6 +139,3 @@ declare module 'dgram' {
|
|
|
139
139
|
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
declare module 'node:dgram' {
|
|
143
|
-
export * from 'dgram';
|
|
144
|
-
}
|
node/dns/promises.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
declare module "dns/promises" {
|
|
2
|
+
import {
|
|
3
|
+
LookupAddress,
|
|
4
|
+
LookupOneOptions,
|
|
5
|
+
LookupAllOptions,
|
|
6
|
+
LookupOptions,
|
|
7
|
+
AnyRecord,
|
|
8
|
+
CaaRecord,
|
|
9
|
+
MxRecord,
|
|
10
|
+
NaptrRecord,
|
|
11
|
+
SoaRecord,
|
|
12
|
+
SrvRecord,
|
|
13
|
+
ResolveWithTtlOptions,
|
|
14
|
+
RecordWithTtl,
|
|
15
|
+
ResolveOptions,
|
|
16
|
+
ResolverOptions,
|
|
17
|
+
} from "dns";
|
|
18
|
+
|
|
19
|
+
function getServers(): string[];
|
|
20
|
+
|
|
21
|
+
function lookup(hostname: string, family: number): Promise<LookupAddress>;
|
|
22
|
+
function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
|
|
23
|
+
function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
|
24
|
+
function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
|
|
25
|
+
function lookup(hostname: string): Promise<LookupAddress>;
|
|
26
|
+
|
|
27
|
+
function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
|
28
|
+
|
|
29
|
+
function resolve(hostname: string): Promise<string[]>;
|
|
30
|
+
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
|
31
|
+
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
|
32
|
+
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
|
33
|
+
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
|
34
|
+
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
|
35
|
+
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
|
36
|
+
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
|
37
|
+
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
|
38
|
+
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
|
39
|
+
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
|
40
|
+
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
|
41
|
+
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
|
42
|
+
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
|
43
|
+
|
|
44
|
+
function resolve4(hostname: string): Promise<string[]>;
|
|
45
|
+
function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
|
46
|
+
function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
|
47
|
+
|
|
48
|
+
function resolve6(hostname: string): Promise<string[]>;
|
|
49
|
+
function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
|
50
|
+
function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
|
51
|
+
|
|
52
|
+
function resolveAny(hostname: string): Promise<AnyRecord[]>;
|
|
53
|
+
|
|
54
|
+
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
|
|
55
|
+
|
|
56
|
+
function resolveCname(hostname: string): Promise<string[]>;
|
|
57
|
+
|
|
58
|
+
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
|
59
|
+
|
|
60
|
+
function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
|
|
61
|
+
|
|
62
|
+
function resolveNs(hostname: string): Promise<string[]>;
|
|
63
|
+
|
|
64
|
+
function resolvePtr(hostname: string): Promise<string[]>;
|
|
65
|
+
|
|
66
|
+
function resolveSoa(hostname: string): Promise<SoaRecord>;
|
|
67
|
+
|
|
68
|
+
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
69
|
+
|
|
70
|
+
function resolveTxt(hostname: string): Promise<string[][]>;
|
|
71
|
+
|
|
72
|
+
function reverse(ip: string): Promise<string[]>;
|
|
73
|
+
|
|
74
|
+
function setServers(servers: ReadonlyArray<string>): void;
|
|
75
|
+
|
|
76
|
+
class Resolver {
|
|
77
|
+
constructor(options?: ResolverOptions);
|
|
78
|
+
|
|
79
|
+
cancel(): void;
|
|
80
|
+
getServers: typeof getServers;
|
|
81
|
+
resolve: typeof resolve;
|
|
82
|
+
resolve4: typeof resolve4;
|
|
83
|
+
resolve6: typeof resolve6;
|
|
84
|
+
resolveAny: typeof resolveAny;
|
|
85
|
+
resolveCname: typeof resolveCname;
|
|
86
|
+
resolveMx: typeof resolveMx;
|
|
87
|
+
resolveNaptr: typeof resolveNaptr;
|
|
88
|
+
resolveNs: typeof resolveNs;
|
|
89
|
+
resolvePtr: typeof resolvePtr;
|
|
90
|
+
resolveSoa: typeof resolveSoa;
|
|
91
|
+
resolveSrv: typeof resolveSrv;
|
|
92
|
+
resolveTxt: typeof resolveTxt;
|
|
93
|
+
reverse: typeof reverse;
|
|
94
|
+
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
|
95
|
+
setServers: typeof setServers;
|
|
96
|
+
}
|
|
97
|
+
}
|