@evobug_com/safe-ts-feature-node 0.2.0 → 0.3.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.
Files changed (82) hide show
  1. package/README.md +2 -2
  2. package/node-api.json +48 -85
  3. package/package.json +162 -3
  4. package/safe/buffer.d.ts +155 -0
  5. package/safe/buffer.js +582 -0
  6. package/safe/child_process.d.ts +32 -0
  7. package/safe/child_process.js +21 -0
  8. package/safe/core.d.ts +36 -0
  9. package/safe/core.js +25 -0
  10. package/safe/crypto.d.ts +105 -0
  11. package/safe/crypto.js +205 -0
  12. package/safe/dgram.d.ts +26 -0
  13. package/safe/dgram.js +76 -0
  14. package/safe/dns/promises.d.ts +136 -0
  15. package/safe/dns/promises.js +262 -0
  16. package/safe/errors.d.ts +155 -0
  17. package/safe/errors.js +32 -0
  18. package/safe/events.d.ts +11 -0
  19. package/safe/events.js +14 -0
  20. package/safe/ffi.d.ts +23 -0
  21. package/safe/ffi.js +57 -0
  22. package/safe/fs/promises.d.ts +168 -0
  23. package/safe/fs/promises.js +366 -0
  24. package/safe/fs.d.ts +201 -0
  25. package/safe/fs.js +422 -0
  26. package/safe/globals.d.ts +87 -0
  27. package/safe/globals.js +232 -0
  28. package/safe/http.d.ts +34 -0
  29. package/safe/http.js +85 -0
  30. package/safe/http2.d.ts +26 -0
  31. package/safe/http2.js +61 -0
  32. package/safe/https.d.ts +21 -0
  33. package/safe/https.js +29 -0
  34. package/safe/inspector/promises.d.ts +200 -0
  35. package/safe/inspector/promises.js +13 -0
  36. package/safe/inspector.d.ts +8 -0
  37. package/safe/inspector.js +13 -0
  38. package/safe/module.d.ts +21 -0
  39. package/safe/module.js +45 -0
  40. package/safe/net.d.ts +11 -0
  41. package/safe/net.js +17 -0
  42. package/safe/os.d.ts +20 -0
  43. package/safe/os.js +29 -0
  44. package/safe/perf_hooks.d.ts +11 -0
  45. package/safe/perf_hooks.js +12 -0
  46. package/safe/process.d.ts +31 -0
  47. package/safe/process.js +97 -0
  48. package/safe/punycode.d.ts +10 -0
  49. package/safe/punycode.js +21 -0
  50. package/safe/querystring.d.ts +11 -0
  51. package/safe/querystring.js +21 -0
  52. package/safe/readline/promises.d.ts +12 -0
  53. package/safe/readline/promises.js +13 -0
  54. package/safe/runtime.d.ts +10 -0
  55. package/safe/runtime.js +16 -0
  56. package/safe/sqlite.d.ts +54 -0
  57. package/safe/sqlite.js +118 -0
  58. package/safe/stream/consumers.d.ts +19 -0
  59. package/safe/stream/consumers.js +54 -0
  60. package/safe/stream/promises.d.ts +26 -0
  61. package/safe/stream/promises.js +22 -0
  62. package/safe/stream/web.d.ts +18 -0
  63. package/safe/stream/web.js +37 -0
  64. package/safe/stream.d.ts +29 -0
  65. package/safe/stream.js +62 -0
  66. package/safe/tls.d.ts +27 -0
  67. package/safe/tls.js +65 -0
  68. package/safe/url.d.ts +28 -0
  69. package/safe/url.js +57 -0
  70. package/safe/util.d.ts +13 -0
  71. package/safe/util.js +25 -0
  72. package/safe/v8.d.ts +28 -0
  73. package/safe/v8.js +85 -0
  74. package/safe/vm.d.ts +23 -0
  75. package/safe/vm.js +69 -0
  76. package/safe/wasi.d.ts +10 -0
  77. package/safe/wasi.js +20 -0
  78. package/safe/worker_threads.d.ts +31 -0
  79. package/safe/worker_threads.js +62 -0
  80. package/safe/zlib.d.ts +61 -0
  81. package/safe/zlib.js +214 -0
  82. package/safe-ts.json +1722 -490
@@ -0,0 +1,105 @@
1
+ // Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
2
+ /// <reference types="node" />
3
+ import type { Option, Result } from "@evobug_com/safe-ts-std/result";
4
+ import type { NodeError, OpenSSLError, PlainError } from "./errors.js";
5
+ import type * as $buffer from "node:buffer";
6
+ import type * as $crypto from "node:crypto";
7
+ import type * as $stream from "node:stream";
8
+ export * from "node:crypto";
9
+
10
+ /** `argon2Sync()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
11
+ export declare function argon2Sync(algorithm: $crypto.Argon2Algorithm, parameters: $crypto.Argon2Parameters): Result<$buffer.NonSharedBuffer, OpenSSLError>;
12
+ /** `DiffieHellman#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY]`. */
13
+ export declare function computeSecret(diffieHellman: $crypto.DiffieHellman, otherPublicKey: $crypto.BinaryLike, inputEncoding?: BufferEncoding): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY">>;
14
+ /** `DiffieHellman#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY]`. */
15
+ export declare function computeSecret(diffieHellman: $crypto.DiffieHellman, otherPublicKey: $crypto.BinaryLike, inputEncoding: BufferEncoding | null | undefined, outputEncoding: BufferEncoding): Result<string, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY">>;
16
+ /** `DiffieHellmanGroup#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY]`. */
17
+ export declare function computeSecret(diffieHellmanGroup: $crypto.DiffieHellmanGroup, otherPublicKey: $crypto.BinaryLike, inputEncoding?: BufferEncoding): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY">>;
18
+ /** `DiffieHellmanGroup#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY]`. */
19
+ export declare function computeSecret(diffieHellmanGroup: $crypto.DiffieHellmanGroup, otherPublicKey: $crypto.BinaryLike, inputEncoding: BufferEncoding | null | undefined, outputEncoding: BufferEncoding): Result<string, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY">>;
20
+ /** `ECDH#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY | ERR_CRYPTO_OPERATION_FAILED]`. */
21
+ export declare function computeSecret(ecdh: $crypto.ECDH, otherPublicKey: $crypto.BinaryLike, inputEncoding?: BufferEncoding): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY" | "ERR_CRYPTO_OPERATION_FAILED">>;
22
+ /** `ECDH#computeSecret()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY | ERR_CRYPTO_OPERATION_FAILED]`. */
23
+ export declare function computeSecret(ecdh: $crypto.ECDH, otherPublicKey: $crypto.BinaryLike, inputEncoding: BufferEncoding | null | undefined, outputEncoding: BufferEncoding): Result<string, NodeError<"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY" | "ERR_CRYPTO_OPERATION_FAILED">>;
24
+ /** `createCipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
25
+ export declare function createCipheriv(algorithm: $crypto.CipherCCMTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options: $crypto.CipherCCMOptions): Result<$crypto.CipherCCM, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
26
+ /** `createCipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
27
+ export declare function createCipheriv(algorithm: $crypto.CipherOCBTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options: $crypto.CipherOCBOptions): Result<$crypto.CipherOCB, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
28
+ /** `createCipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
29
+ export declare function createCipheriv(algorithm: $crypto.CipherGCMTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options?: $crypto.CipherGCMOptions): Result<$crypto.CipherGCM, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
30
+ /** `createCipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
31
+ export declare function createCipheriv(algorithm: $crypto.CipherChaCha20Poly1305Types, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options?: $crypto.CipherChaCha20Poly1305Options): Result<$crypto.CipherChaCha20Poly1305, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
32
+ /** `createCipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
33
+ export declare function createCipheriv(algorithm: string, key: $crypto.KeyLike, iv: Option<$crypto.BinaryLike>, options?: $stream.TransformOptions): Result<$crypto.Cipheriv, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
34
+ /** `createDecipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
35
+ export declare function createDecipheriv(algorithm: $crypto.CipherCCMTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options: $crypto.CipherCCMOptions): Result<$crypto.DecipherCCM, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
36
+ /** `createDecipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
37
+ export declare function createDecipheriv(algorithm: $crypto.CipherOCBTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options: $crypto.CipherOCBOptions): Result<$crypto.DecipherOCB, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
38
+ /** `createDecipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
39
+ export declare function createDecipheriv(algorithm: $crypto.CipherGCMTypes, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options?: $crypto.CipherGCMOptions): Result<$crypto.DecipherGCM, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
40
+ /** `createDecipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
41
+ export declare function createDecipheriv(algorithm: $crypto.CipherChaCha20Poly1305Types, key: $crypto.KeyLike, iv: $crypto.BinaryLike, options?: $crypto.CipherChaCha20Poly1305Options): Result<$crypto.DecipherChaCha20Poly1305, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
42
+ /** `createDecipheriv()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYLEN] | TypeError [ERR_CRYPTO_INVALID_IV]`; `undefined` passed on as `null` for the third argument. */
43
+ export declare function createDecipheriv(algorithm: string, key: $crypto.KeyLike, iv: Option<$crypto.BinaryLike>, options?: $stream.TransformOptions): Result<$crypto.Decipheriv, NodeError<"ERR_CRYPTO_INVALID_KEYLEN", "RangeError"> | NodeError<"ERR_CRYPTO_INVALID_IV", "TypeError">>;
44
+ /** `createPrivateKey()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
45
+ export declare function createPrivateKey(key: $crypto.PrivateKeyInput | $crypto.RawPrivateKeyInput | $crypto.JsonWebKeyInput | $crypto.BinaryLike): Result<$crypto.KeyObject, OpenSSLError>;
46
+ /** `createPublicKey()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
47
+ export declare function createPublicKey(key: $crypto.PublicKeyInput | $crypto.RawPublicKeyInput | $crypto.JsonWebKeyInput | $crypto.KeyLike): Result<$crypto.KeyObject, OpenSSLError>;
48
+ /** `decapsulate()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
49
+ export declare function decapsulate(key: $crypto.KeyLike | $crypto.PrivateKeyInput | $crypto.RawPrivateKeyInput | $crypto.JsonWebKeyInput, ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
50
+ /** `decapsulate()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
51
+ export declare function decapsulate(key: $crypto.KeyLike | $crypto.PrivateKeyInput | $crypto.RawPrivateKeyInput | $crypto.JsonWebKeyInput, ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView, callback: (err: Error, sharedKey: $buffer.NonSharedBuffer) => void): Result<void, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
52
+ /** `diffieHellman()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_INCOMPATIBLE_KEY] | Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
53
+ export declare function diffieHellman(options: $crypto.DiffieHellmanOptions): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_INCOMPATIBLE_KEY"> | OpenSSLError>;
54
+ /** `diffieHellman()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_INCOMPATIBLE_KEY] | Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
55
+ export declare function diffieHellman(options: $crypto.DiffieHellmanOptions, callback: (err: Error | null, secret: $buffer.NonSharedBuffer) => void): Result<void, NodeError<"ERR_CRYPTO_INCOMPATIBLE_KEY"> | OpenSSLError>;
56
+ /** `ECDH.convertKey()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
57
+ export declare function ecdhConvertKey(key: $crypto.BinaryLike, curve: string, inputEncoding?: BufferEncoding, outputEncoding?: null, format?: "uncompressed" | "compressed" | "hybrid"): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
58
+ /** `ECDH.convertKey()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
59
+ export declare function ecdhConvertKey(key: $crypto.BinaryLike, curve: string, inputEncoding: BufferEncoding | null | undefined, outputEncoding: BufferEncoding, format?: "uncompressed" | "compressed" | "hybrid"): Result<string, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
60
+ /** `encapsulate()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
61
+ export declare function encapsulate(key: $crypto.KeyLike | $crypto.PublicKeyInput | $crypto.RawPublicKeyInput | $crypto.JsonWebKeyInput): Result<{ sharedKey: $buffer.NonSharedBuffer; ciphertext: $buffer.NonSharedBuffer }, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
62
+ /** `encapsulate()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_OPERATION_FAILED]`. */
63
+ export declare function encapsulate(key: $crypto.KeyLike | $crypto.PublicKeyInput | $crypto.RawPublicKeyInput | $crypto.JsonWebKeyInput, callback: (err: Error, result: { sharedKey: $buffer.NonSharedBuffer; ciphertext: $buffer.NonSharedBuffer }) => void): Result<void, NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
64
+ /** `Cipheriv#final()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
65
+ export declare function final(cipheriv: $crypto.Cipheriv): Result<$buffer.NonSharedBuffer, OpenSSLError>;
66
+ /** `Cipheriv#final()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
67
+ export declare function final(cipheriv: $crypto.Cipheriv, outputEncoding: BufferEncoding): Result<string, OpenSSLError>;
68
+ /** `Decipheriv#final()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?} | Error`. */
69
+ export declare function final(decipheriv: $crypto.Decipheriv): Result<$buffer.NonSharedBuffer, OpenSSLError | PlainError<"Error">>;
70
+ /** `Decipheriv#final()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?} | Error`. */
71
+ export declare function final(decipheriv: $crypto.Decipheriv, outputEncoding: BufferEncoding): Result<string, OpenSSLError | PlainError<"Error">>;
72
+ /** `new X509Certificate()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
73
+ export declare function newX509Certificate(buffer: string | NodeJS.ArrayBufferView): Result<$crypto.X509Certificate, OpenSSLError>;
74
+ /** `privateDecrypt()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
75
+ export declare function privateDecrypt(privateKey: $crypto.KeyLike | $crypto.PublicEncryptKeyObjectInput | $crypto.PublicEncryptPrivateKeyInput | $crypto.PublicEncryptJsonWebKeyInput, buffer: $crypto.BinaryLike): Result<$buffer.NonSharedBuffer, OpenSSLError>;
76
+ /** `privateEncrypt()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
77
+ export declare function privateEncrypt(privateKey: $crypto.KeyLike | $crypto.PublicDecryptKeyObjectInput | $crypto.PublicDecryptPrivateKeyInput | $crypto.PublicDecryptJsonWebKeyInput, buffer: $crypto.BinaryLike): Result<$buffer.NonSharedBuffer, OpenSSLError>;
78
+ /** `publicDecrypt()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
79
+ export declare function publicDecrypt(key: $crypto.KeyLike | $crypto.PublicDecryptKeyObjectInput | $crypto.PublicDecryptPrivateKeyInput | $crypto.PublicDecryptPublicKeyInput | $crypto.PublicDecryptJsonWebKeyInput, buffer: $crypto.BinaryLike): Result<$buffer.NonSharedBuffer, OpenSSLError>;
80
+ /** `publicEncrypt()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
81
+ export declare function publicEncrypt(key: $crypto.KeyLike | $crypto.PublicEncryptKeyObjectInput | $crypto.PublicEncryptPrivateKeyInput | $crypto.PublicEncryptPublicKeyInput | $crypto.PublicEncryptJsonWebKeyInput, buffer: $crypto.BinaryLike): Result<$buffer.NonSharedBuffer, OpenSSLError>;
82
+ /** `scryptSync()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_SCRYPT_PARAMS]`. */
83
+ export declare function scryptSync(password: $crypto.BinaryLike, salt: $crypto.BinaryLike, keylen: number, options?: $crypto.ScryptOptions): Result<$buffer.NonSharedBuffer, NodeError<"ERR_CRYPTO_INVALID_SCRYPT_PARAMS", "RangeError">>;
84
+ /** `setEngine()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_ENGINE_UNKNOWN]`. */
85
+ export declare function setEngine(engine: string, flags?: number): Result<void, NodeError<"ERR_CRYPTO_ENGINE_UNKNOWN">>;
86
+ /** `setFips()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_CRYPTO_FIPS_FORCED] | TypeError [ERR_WORKER_UNSUPPORTED_OPERATION] | Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
87
+ export declare function setFips(bool: boolean): Result<void, NodeError<"ERR_CRYPTO_FIPS_FORCED"> | NodeError<"ERR_WORKER_UNSUPPORTED_OPERATION", "TypeError"> | OpenSSLError>;
88
+ /** `ECDH#setPrivateKey()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_INVALID_KEYTYPE] | Error [ERR_CRYPTO_OPERATION_FAILED]`. */
89
+ export declare function setPrivateKey(ecdh: $crypto.ECDH, privateKey: $crypto.BinaryLike, encoding?: BufferEncoding): Result<void, NodeError<"ERR_CRYPTO_INVALID_KEYTYPE", "RangeError"> | NodeError<"ERR_CRYPTO_OPERATION_FAILED">>;
90
+ /** `sign()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
91
+ export declare function sign(algorithm: string | null | undefined, data: $crypto.BinaryLike, key: $crypto.KeyLike | $crypto.SignKeyObjectInput | $crypto.SignPrivateKeyInput | $crypto.SignJsonWebKeyInput): Result<$buffer.NonSharedBuffer, OpenSSLError>;
92
+ /** `sign()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
93
+ export declare function sign(algorithm: string | null | undefined, data: $crypto.BinaryLike, key: $crypto.KeyLike | $crypto.SignKeyObjectInput | $crypto.SignPrivateKeyInput | $crypto.SignJsonWebKeyInput, callback: (error: Error | null, data: $buffer.NonSharedBuffer) => void): Result<void, OpenSSLError>;
94
+ /** `Sign#sign()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
95
+ export declare function signSign(sign: $crypto.Sign, privateKey: $crypto.KeyLike | $crypto.SignKeyObjectInput | $crypto.SignPrivateKeyInput | $crypto.SignRawPrivateKeyInput | $crypto.SignJsonWebKeyInput): Result<$buffer.NonSharedBuffer, OpenSSLError>;
96
+ /** `Sign#sign()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
97
+ export declare function signSign(sign: $crypto.Sign, privateKey: $crypto.KeyLike | $crypto.SignKeyObjectInput | $crypto.SignPrivateKeyInput | $crypto.SignRawPrivateKeyInput | $crypto.SignJsonWebKeyInput, outputFormat: BufferEncoding): Result<string, OpenSSLError>;
98
+ /** `timingSafeEqual()` (node:crypto), with what it throws returned as an `Err`: `RangeError [ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH]`. */
99
+ export declare function timingSafeEqual(a: ArrayBufferLike | NodeJS.ArrayBufferView, b: ArrayBufferLike | NodeJS.ArrayBufferView): Result<boolean, NodeError<"ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH", "RangeError">>;
100
+ /** `verify()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
101
+ export declare function verify(algorithm: string | null | undefined, data: $crypto.BinaryLike, key: $crypto.KeyLike | $crypto.VerifyKeyObjectInput | $crypto.VerifyPublicKeyInput | $crypto.VerifyJsonWebKeyInput, signature: $crypto.BinaryLike): Result<boolean, OpenSSLError>;
102
+ /** `verify()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
103
+ export declare function verify(algorithm: string | null | undefined, data: $crypto.BinaryLike, key: $crypto.KeyLike | $crypto.VerifyKeyObjectInput | $crypto.VerifyPublicKeyInput | $crypto.VerifyJsonWebKeyInput, signature: $crypto.BinaryLike, callback: (error: Error | null, result: boolean) => void): Result<void, OpenSSLError>;
104
+ /** `Verify#verify()` (node:crypto), with what it throws returned as an `Err`: `Error [ERR_OSSL_*] {library, reason, opensslErrorStack?}`. */
105
+ export declare function verifyVerify(verify: $crypto.Verify, key: $crypto.KeyLike | $crypto.VerifyKeyObjectInput | $crypto.VerifyPublicKeyInput | $crypto.VerifyRawPublicKeyInput | $crypto.VerifyJsonWebKeyInput, signature: $crypto.BinaryLike, signatureEncoding?: BufferEncoding): Result<boolean, OpenSSLError>;
package/safe/crypto.js ADDED
@@ -0,0 +1,205 @@
1
+ // @safe-ts std
2
+ // Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
3
+ import * as $module from "node:crypto";
4
+ import { Err } from "@evobug_com/safe-ts-std/result";
5
+ export * from "node:crypto";
6
+
7
+ export function argon2Sync(...args) {
8
+ try {
9
+ return $module.argon2Sync(...args);
10
+ } catch (error) {
11
+ return new Err(error);
12
+ }
13
+ }
14
+
15
+ export function computeSecret(self, ...args) {
16
+ try {
17
+ return self.computeSecret(...args);
18
+ } catch (error) {
19
+ return new Err(error);
20
+ }
21
+ }
22
+
23
+ export function createCipheriv(a0, a1, a2, ...args) {
24
+ try {
25
+ return $module.createCipheriv(a0, a1, a2 ?? null, ...args);
26
+ } catch (error) {
27
+ return new Err(error);
28
+ }
29
+ }
30
+
31
+ export function createDecipheriv(a0, a1, a2, ...args) {
32
+ try {
33
+ return $module.createDecipheriv(a0, a1, a2 ?? null, ...args);
34
+ } catch (error) {
35
+ return new Err(error);
36
+ }
37
+ }
38
+
39
+ export function createPrivateKey(...args) {
40
+ try {
41
+ return $module.createPrivateKey(...args);
42
+ } catch (error) {
43
+ return new Err(error);
44
+ }
45
+ }
46
+
47
+ export function createPublicKey(...args) {
48
+ try {
49
+ return $module.createPublicKey(...args);
50
+ } catch (error) {
51
+ return new Err(error);
52
+ }
53
+ }
54
+
55
+ export function decapsulate(...args) {
56
+ try {
57
+ return $module.decapsulate(...args);
58
+ } catch (error) {
59
+ return new Err(error);
60
+ }
61
+ }
62
+
63
+ export function diffieHellman(...args) {
64
+ try {
65
+ return $module.diffieHellman(...args);
66
+ } catch (error) {
67
+ return new Err(error);
68
+ }
69
+ }
70
+
71
+ export function ecdhConvertKey(...args) {
72
+ try {
73
+ return $module.ECDH.convertKey(...args);
74
+ } catch (error) {
75
+ return new Err(error);
76
+ }
77
+ }
78
+
79
+ export function encapsulate(...args) {
80
+ try {
81
+ return $module.encapsulate(...args);
82
+ } catch (error) {
83
+ return new Err(error);
84
+ }
85
+ }
86
+
87
+ export function final(self, ...args) {
88
+ try {
89
+ return self.final(...args);
90
+ } catch (error) {
91
+ return new Err(error);
92
+ }
93
+ }
94
+
95
+ export function newX509Certificate(...args) {
96
+ try {
97
+ return new $module.X509Certificate(...args);
98
+ } catch (error) {
99
+ return new Err(error);
100
+ }
101
+ }
102
+
103
+ export function privateDecrypt(...args) {
104
+ try {
105
+ return $module.privateDecrypt(...args);
106
+ } catch (error) {
107
+ return new Err(error);
108
+ }
109
+ }
110
+
111
+ export function privateEncrypt(...args) {
112
+ try {
113
+ return $module.privateEncrypt(...args);
114
+ } catch (error) {
115
+ return new Err(error);
116
+ }
117
+ }
118
+
119
+ export function publicDecrypt(...args) {
120
+ try {
121
+ return $module.publicDecrypt(...args);
122
+ } catch (error) {
123
+ return new Err(error);
124
+ }
125
+ }
126
+
127
+ export function publicEncrypt(...args) {
128
+ try {
129
+ return $module.publicEncrypt(...args);
130
+ } catch (error) {
131
+ return new Err(error);
132
+ }
133
+ }
134
+
135
+ export function scryptSync(...args) {
136
+ try {
137
+ return $module.scryptSync(...args);
138
+ } catch (error) {
139
+ return new Err(error);
140
+ }
141
+ }
142
+
143
+ export function setEngine(...args) {
144
+ try {
145
+ return $module.setEngine(...args);
146
+ } catch (error) {
147
+ return new Err(error);
148
+ }
149
+ }
150
+
151
+ export function setFips(...args) {
152
+ try {
153
+ return $module.setFips(...args);
154
+ } catch (error) {
155
+ return new Err(error);
156
+ }
157
+ }
158
+
159
+ export function setPrivateKey(self, ...args) {
160
+ try {
161
+ return self.setPrivateKey(...args);
162
+ } catch (error) {
163
+ return new Err(error);
164
+ }
165
+ }
166
+
167
+ export function sign(...args) {
168
+ try {
169
+ return $module.sign(...args);
170
+ } catch (error) {
171
+ return new Err(error);
172
+ }
173
+ }
174
+
175
+ export function signSign(self, ...args) {
176
+ try {
177
+ return self.sign(...args);
178
+ } catch (error) {
179
+ return new Err(error);
180
+ }
181
+ }
182
+
183
+ export function timingSafeEqual(...args) {
184
+ try {
185
+ return $module.timingSafeEqual(...args);
186
+ } catch (error) {
187
+ return new Err(error);
188
+ }
189
+ }
190
+
191
+ export function verify(...args) {
192
+ try {
193
+ return $module.verify(...args);
194
+ } catch (error) {
195
+ return new Err(error);
196
+ }
197
+ }
198
+
199
+ export function verifyVerify(self, ...args) {
200
+ try {
201
+ return self.verify(...args);
202
+ } catch (error) {
203
+ return new Err(error);
204
+ }
205
+ }
@@ -0,0 +1,26 @@
1
+ // Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
2
+ /// <reference types="node" />
3
+ import type { Result } from "@evobug_com/safe-ts-std/result";
4
+ import type { NodeError, SystemError } from "./errors.js";
5
+ import type * as $dgram from "node:dgram";
6
+ import type * as $net from "node:net";
7
+ export * from "node:dgram";
8
+
9
+ /** `Socket#addMembership()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'addMembership'}`. */
10
+ export declare function addMembership(socket: $dgram.Socket, multicastAddress: string, multicastInterface?: string): Result<void, SystemError<"addMembership">>;
11
+ /** `Socket#addSourceSpecificMembership()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'addSourceSpecificMembership'}`. */
12
+ export declare function addSourceSpecificMembership(socket: $dgram.Socket, sourceAddress: string, groupAddress: string, multicastInterface?: string): Result<void, SystemError<"addSourceSpecificMembership">>;
13
+ /** `Socket#bindSync()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'bind', address, port?}`. */
14
+ export declare function bindSync(socket: $dgram.Socket, options?: $dgram.BindSyncOptions): Result<$net.AddressInfo, SystemError<"bind", { address: string; port?: number }>>;
15
+ /** `Socket#connectSync()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'bind' | 'connect', address, port?}`. */
16
+ export declare function connectSync(socket: $dgram.Socket, port: number, address?: string): Result<void, SystemError<"bind" | "connect", { address: string; port?: number }>>;
17
+ /** `Socket#dropMembership()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'dropMembership'}`. */
18
+ export declare function dropMembership(socket: $dgram.Socket, multicastAddress: string, multicastInterface?: string): Result<void, SystemError<"dropMembership">>;
19
+ /** `Socket#dropSourceSpecificMembership()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'dropSourceSpecificMembership'}`. */
20
+ export declare function dropSourceSpecificMembership(socket: $dgram.Socket, sourceAddress: string, groupAddress: string, multicastInterface?: string): Result<void, SystemError<"dropSourceSpecificMembership">>;
21
+ /** `Socket#setMulticastInterface()` (node:dgram), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'setMulticastInterface'}`. */
22
+ export declare function setMulticastInterface(socket: $dgram.Socket, multicastInterface: string): Result<void, SystemError<"setMulticastInterface">>;
23
+ /** `Socket#setRecvBufferSize()` (node:dgram), with what it throws returned as an `Err`: `SystemError [ERR_SOCKET_BUFFER_SIZE] {info, errno, syscall: 'uv_recv_buffer_size'}`. */
24
+ export declare function setRecvBufferSize(socket: $dgram.Socket, size: number): Result<void, NodeError<"ERR_SOCKET_BUFFER_SIZE", "SystemError", { info: { errno: number; code: string; message: string; syscall: string; path?: string; dest?: string }; errno: number; syscall: "uv_recv_buffer_size" }>>;
25
+ /** `Socket#setSendBufferSize()` (node:dgram), with what it throws returned as an `Err`: `SystemError [ERR_SOCKET_BUFFER_SIZE] {info, errno, syscall: 'uv_send_buffer_size'}`. */
26
+ export declare function setSendBufferSize(socket: $dgram.Socket, size: number): Result<void, NodeError<"ERR_SOCKET_BUFFER_SIZE", "SystemError", { info: { errno: number; code: string; message: string; syscall: string; path?: string; dest?: string }; errno: number; syscall: "uv_send_buffer_size" }>>;
package/safe/dgram.js ADDED
@@ -0,0 +1,76 @@
1
+ // @safe-ts std
2
+ // Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
3
+ import { Err } from "@evobug_com/safe-ts-std/result";
4
+ export * from "node:dgram";
5
+
6
+ export function addMembership(self, ...args) {
7
+ try {
8
+ return self.addMembership(...args);
9
+ } catch (error) {
10
+ return new Err(error);
11
+ }
12
+ }
13
+
14
+ export function addSourceSpecificMembership(self, ...args) {
15
+ try {
16
+ return self.addSourceSpecificMembership(...args);
17
+ } catch (error) {
18
+ return new Err(error);
19
+ }
20
+ }
21
+
22
+ export function bindSync(self, ...args) {
23
+ try {
24
+ return self.bindSync(...args);
25
+ } catch (error) {
26
+ return new Err(error);
27
+ }
28
+ }
29
+
30
+ export function connectSync(self, ...args) {
31
+ try {
32
+ return self.connectSync(...args);
33
+ } catch (error) {
34
+ return new Err(error);
35
+ }
36
+ }
37
+
38
+ export function dropMembership(self, ...args) {
39
+ try {
40
+ return self.dropMembership(...args);
41
+ } catch (error) {
42
+ return new Err(error);
43
+ }
44
+ }
45
+
46
+ export function dropSourceSpecificMembership(self, ...args) {
47
+ try {
48
+ return self.dropSourceSpecificMembership(...args);
49
+ } catch (error) {
50
+ return new Err(error);
51
+ }
52
+ }
53
+
54
+ export function setMulticastInterface(self, ...args) {
55
+ try {
56
+ return self.setMulticastInterface(...args);
57
+ } catch (error) {
58
+ return new Err(error);
59
+ }
60
+ }
61
+
62
+ export function setRecvBufferSize(self, ...args) {
63
+ try {
64
+ return self.setRecvBufferSize(...args);
65
+ } catch (error) {
66
+ return new Err(error);
67
+ }
68
+ }
69
+
70
+ export function setSendBufferSize(self, ...args) {
71
+ try {
72
+ return self.setSendBufferSize(...args);
73
+ } catch (error) {
74
+ return new Err(error);
75
+ }
76
+ }
@@ -0,0 +1,136 @@
1
+ // Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
2
+ /// <reference types="node" />
3
+ import type { Result } from "@evobug_com/safe-ts-std/result";
4
+ import type { DnsCode, ErrnoCode, NodeError } from "../errors.js";
5
+ import type * as $dns from "node:dns";
6
+ import type * as $dnsPromises from "node:dns/promises";
7
+ export * from "node:dns/promises";
8
+
9
+ /** `lookup()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getaddrinfo', hostname}`. */
10
+ export declare function lookup(hostname: string, family: number): Promise<Result<$dns.LookupAddress, NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getaddrinfo"; hostname: string }>>>;
11
+ /** `lookup()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getaddrinfo', hostname}`. */
12
+ export declare function lookup(hostname: string, options: $dns.LookupOneOptions): Promise<Result<$dns.LookupAddress, NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getaddrinfo"; hostname: string }>>>;
13
+ /** `lookup()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getaddrinfo', hostname}`. */
14
+ export declare function lookup(hostname: string, options: $dns.LookupAllOptions): Promise<Result<$dns.LookupAddress[], NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getaddrinfo"; hostname: string }>>>;
15
+ /** `lookup()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getaddrinfo', hostname}`. */
16
+ export declare function lookup(hostname: string, options: $dns.LookupOptions): Promise<Result<$dns.LookupAddress | $dns.LookupAddress[], NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getaddrinfo"; hostname: string }>>>;
17
+ /** `lookup()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getaddrinfo', hostname}`. */
18
+ export declare function lookup(hostname: string): Promise<Result<$dns.LookupAddress, NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getaddrinfo"; hostname: string }>>>;
19
+ /** `lookupService()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [ENOTFOUND | EAI_*] {errno, syscall: 'getnameinfo'}`. */
20
+ export declare function lookupService(address: string, port: number): Promise<Result<{ hostname: string; service: string; }, NodeError<"ENOTFOUND" | Extract<ErrnoCode, `EAI_${string}`>, "Error", { errno: number; syscall: "getnameinfo" }>>>;
21
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
22
+ export declare function resolve(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
23
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
24
+ export declare function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
25
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
26
+ export declare function resolve(hostname: string, rrtype: "ANY"): Promise<Result<$dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
27
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
28
+ export declare function resolve(hostname: string, rrtype: "CAA"): Promise<Result<$dns.CaaRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
29
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
30
+ export declare function resolve(hostname: string, rrtype: "MX"): Promise<Result<$dns.MxRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
31
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
32
+ export declare function resolve(hostname: string, rrtype: "NAPTR"): Promise<Result<$dns.NaptrRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
33
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
34
+ export declare function resolve(hostname: string, rrtype: "SOA"): Promise<Result<$dns.SoaRecord, NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
35
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
36
+ export declare function resolve(hostname: string, rrtype: "SRV"): Promise<Result<$dns.SrvRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
37
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
38
+ export declare function resolve(hostname: string, rrtype: "TLSA"): Promise<Result<$dns.TlsaRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
39
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
40
+ export declare function resolve(hostname: string, rrtype: "TXT"): Promise<Result<string[][], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
41
+ /** `resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
42
+ export declare function resolve(hostname: string, rrtype: string): Promise<Result<string[] | $dns.CaaRecord[] | $dns.MxRecord[] | $dns.NaptrRecord[] | $dns.SoaRecord | $dns.SrvRecord[] | $dns.TlsaRecord[] | string[][] | $dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
43
+ /** `resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
44
+ export declare function resolve4(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
45
+ /** `resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
46
+ export declare function resolve4(hostname: string, options: $dns.ResolveWithTtlOptions): Promise<Result<$dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
47
+ /** `resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
48
+ export declare function resolve4(hostname: string, options: $dns.ResolveOptions): Promise<Result<string[] | $dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
49
+ /** `resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
50
+ export declare function resolve6(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
51
+ /** `resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
52
+ export declare function resolve6(hostname: string, options: $dns.ResolveWithTtlOptions): Promise<Result<$dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
53
+ /** `resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
54
+ export declare function resolve6(hostname: string, options: $dns.ResolveOptions): Promise<Result<string[] | $dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
55
+ /** `resolveAny()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAny', hostname}`. */
56
+ export declare function resolveAny(hostname: string): Promise<Result<$dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: "queryAny"; hostname: string }>>>;
57
+ /** `resolveCaa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryCaa', hostname}`. */
58
+ export declare function resolveCaa(hostname: string): Promise<Result<$dns.CaaRecord[], NodeError<DnsCode, "Error", { syscall: "queryCaa"; hostname: string }>>>;
59
+ /** `resolveCname()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryCname', hostname}`. */
60
+ export declare function resolveCname(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryCname"; hostname: string }>>>;
61
+ /** `resolveMx()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryMx', hostname}`. */
62
+ export declare function resolveMx(hostname: string): Promise<Result<$dns.MxRecord[], NodeError<DnsCode, "Error", { syscall: "queryMx"; hostname: string }>>>;
63
+ /** `resolveNaptr()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryNaptr', hostname}`. */
64
+ export declare function resolveNaptr(hostname: string): Promise<Result<$dns.NaptrRecord[], NodeError<DnsCode, "Error", { syscall: "queryNaptr"; hostname: string }>>>;
65
+ /** `resolveNs()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryNs', hostname}`. */
66
+ export declare function resolveNs(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryNs"; hostname: string }>>>;
67
+ /** `resolvePtr()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryPtr', hostname}`. */
68
+ export declare function resolvePtr(hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryPtr"; hostname: string }>>>;
69
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
70
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
71
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
72
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
73
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
74
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "ANY"): Promise<Result<$dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
75
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
76
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "CAA"): Promise<Result<$dns.CaaRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
77
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
78
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "MX"): Promise<Result<$dns.MxRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
79
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
80
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "NAPTR"): Promise<Result<$dns.NaptrRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
81
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
82
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "SOA"): Promise<Result<$dns.SoaRecord, NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
83
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
84
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "SRV"): Promise<Result<$dns.SrvRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
85
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
86
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "TLSA"): Promise<Result<$dns.TlsaRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
87
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
88
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: "TXT"): Promise<Result<string[][], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
89
+ /** `Resolver#resolve()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'query*', hostname}`. */
90
+ export declare function resolverResolve(resolver: $dnsPromises.Resolver, hostname: string, rrtype: string): Promise<Result<string[] | $dns.CaaRecord[] | $dns.MxRecord[] | $dns.NaptrRecord[] | $dns.SoaRecord | $dns.SrvRecord[] | $dns.TlsaRecord[] | string[][] | $dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: `query${string}`; hostname: string }>>>;
91
+ /** `Resolver#resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
92
+ export declare function resolverResolve4(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
93
+ /** `Resolver#resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
94
+ export declare function resolverResolve4(resolver: $dnsPromises.Resolver, hostname: string, options: $dns.ResolveWithTtlOptions): Promise<Result<$dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
95
+ /** `Resolver#resolve4()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryA', hostname}`. */
96
+ export declare function resolverResolve4(resolver: $dnsPromises.Resolver, hostname: string, options: $dns.ResolveOptions): Promise<Result<string[] | $dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryA"; hostname: string }>>>;
97
+ /** `Resolver#resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
98
+ export declare function resolverResolve6(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
99
+ /** `Resolver#resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
100
+ export declare function resolverResolve6(resolver: $dnsPromises.Resolver, hostname: string, options: $dns.ResolveWithTtlOptions): Promise<Result<$dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
101
+ /** `Resolver#resolve6()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAaaa', hostname}`. */
102
+ export declare function resolverResolve6(resolver: $dnsPromises.Resolver, hostname: string, options: $dns.ResolveOptions): Promise<Result<string[] | $dns.RecordWithTtl[], NodeError<DnsCode, "Error", { syscall: "queryAaaa"; hostname: string }>>>;
103
+ /** `Resolver#resolveAny()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryAny', hostname}`. */
104
+ export declare function resolverResolveAny(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.AnyRecord[], NodeError<DnsCode, "Error", { syscall: "queryAny"; hostname: string }>>>;
105
+ /** `Resolver#resolveCaa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryCaa', hostname}`. */
106
+ export declare function resolverResolveCaa(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.CaaRecord[], NodeError<DnsCode, "Error", { syscall: "queryCaa"; hostname: string }>>>;
107
+ /** `Resolver#resolveCname()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryCname', hostname}`. */
108
+ export declare function resolverResolveCname(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryCname"; hostname: string }>>>;
109
+ /** `Resolver#resolveMx()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryMx', hostname}`. */
110
+ export declare function resolverResolveMx(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.MxRecord[], NodeError<DnsCode, "Error", { syscall: "queryMx"; hostname: string }>>>;
111
+ /** `Resolver#resolveNaptr()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryNaptr', hostname}`. */
112
+ export declare function resolverResolveNaptr(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.NaptrRecord[], NodeError<DnsCode, "Error", { syscall: "queryNaptr"; hostname: string }>>>;
113
+ /** `Resolver#resolveNs()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryNs', hostname}`. */
114
+ export declare function resolverResolveNs(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryNs"; hostname: string }>>>;
115
+ /** `Resolver#resolvePtr()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryPtr', hostname}`. */
116
+ export declare function resolverResolvePtr(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "queryPtr"; hostname: string }>>>;
117
+ /** `Resolver#resolveSoa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'querySoa', hostname}`. */
118
+ export declare function resolverResolveSoa(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.SoaRecord, NodeError<DnsCode, "Error", { syscall: "querySoa"; hostname: string }>>>;
119
+ /** `Resolver#resolveSrv()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'querySrv', hostname}`. */
120
+ export declare function resolverResolveSrv(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.SrvRecord[], NodeError<DnsCode, "Error", { syscall: "querySrv"; hostname: string }>>>;
121
+ /** `Resolver#resolveTlsa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryTlsa', hostname}`. */
122
+ export declare function resolverResolveTlsa(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<$dns.TlsaRecord[], NodeError<DnsCode, "Error", { syscall: "queryTlsa"; hostname: string }>>>;
123
+ /** `Resolver#resolveTxt()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryTxt', hostname}`. */
124
+ export declare function resolverResolveTxt(resolver: $dnsPromises.Resolver, hostname: string): Promise<Result<string[][], NodeError<DnsCode, "Error", { syscall: "queryTxt"; hostname: string }>>>;
125
+ /** `Resolver#reverse()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'getHostByAddr', hostname} | Error [EINVAL] {errno, syscall: 'getHostByAddr', hostname}`. */
126
+ export declare function resolverReverse(resolver: $dnsPromises.Resolver, ip: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "getHostByAddr"; hostname: string }> | NodeError<"EINVAL", "Error", { errno: number; syscall: "getHostByAddr"; hostname: string }>>>;
127
+ /** `resolveSoa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'querySoa', hostname}`. */
128
+ export declare function resolveSoa(hostname: string): Promise<Result<$dns.SoaRecord, NodeError<DnsCode, "Error", { syscall: "querySoa"; hostname: string }>>>;
129
+ /** `resolveSrv()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'querySrv', hostname}`. */
130
+ export declare function resolveSrv(hostname: string): Promise<Result<$dns.SrvRecord[], NodeError<DnsCode, "Error", { syscall: "querySrv"; hostname: string }>>>;
131
+ /** `resolveTlsa()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryTlsa', hostname}`. */
132
+ export declare function resolveTlsa(hostname: string): Promise<Result<$dns.TlsaRecord[], NodeError<DnsCode, "Error", { syscall: "queryTlsa"; hostname: string }>>>;
133
+ /** `resolveTxt()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'queryTxt', hostname}`. */
134
+ export declare function resolveTxt(hostname: string): Promise<Result<string[][], NodeError<DnsCode, "Error", { syscall: "queryTxt"; hostname: string }>>>;
135
+ /** `reverse()` (node:dns/promises), with what it rejects with returned as an `Err`: `Error [dns.*] {syscall: 'getHostByAddr', hostname} | Error [EINVAL] {errno, syscall: 'getHostByAddr', hostname}`. */
136
+ export declare function reverse(ip: string): Promise<Result<string[], NodeError<DnsCode, "Error", { syscall: "getHostByAddr"; hostname: string }> | NodeError<"EINVAL", "Error", { errno: number; syscall: "getHostByAddr"; hostname: string }>>>;