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