typenative 0.3.1 → 0.4.1

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 (170) hide show
  1. package/.github/workflows/ci.yml +2 -0
  2. package/CHANGELOG.md +258 -0
  3. package/CONTRIBUTION.md +1 -1
  4. package/README.md +17 -1
  5. package/bin/cli.js +26 -11
  6. package/bin/go/bridge.js +74 -14
  7. package/bin/go/convert.js +59 -1
  8. package/bin/go/metadata.js +13 -4
  9. package/bin/go/overrides.js +4 -6
  10. package/bin/go/stdlib.generated.js +2 -0
  11. package/bin/index.js +338 -47
  12. package/bin/main.js +36 -14
  13. package/bin/node/assert.js +2 -2
  14. package/bin/node/buffer.js +9 -0
  15. package/bin/node/child_process.js +51 -3
  16. package/bin/node/cluster.js +41 -3
  17. package/bin/node/core.js +1 -1
  18. package/bin/node/crypto.js +205 -4
  19. package/bin/node/dgram.js +230 -6
  20. package/bin/node/dns.js +471 -8
  21. package/bin/node/errno_tables.js +445 -0
  22. package/bin/node/events.js +1 -1
  23. package/bin/node/fs.js +22 -15
  24. package/bin/node/fs_watch.js +407 -0
  25. package/bin/node/http.js +128 -30
  26. package/bin/node/http2.js +37 -7
  27. package/bin/node/module_v8.js +142 -0
  28. package/bin/node/net.js +9 -6
  29. package/bin/node/process.js +242 -0
  30. package/bin/node/readline.js +272 -1
  31. package/bin/node/registry.js +3 -1
  32. package/bin/node/sqlite.js +60 -12
  33. package/bin/node/stream.js +145 -10
  34. package/bin/node/test.js +311 -19
  35. package/bin/node/timers.js +1 -1
  36. package/bin/node/typed_arrays.js +608 -0
  37. package/bin/node/url.js +23 -5
  38. package/bin/node/util.js +21 -1
  39. package/bin/node/util_extra.js +6 -30
  40. package/bin/node/worker_threads.js +79 -19
  41. package/bin/node/zlib.js +131 -16
  42. package/bin/transpiler.js +4729 -616
  43. package/bin/typecheck-node.js +1 -0
  44. package/bin/version.js +1 -1
  45. package/conformance.md +1030 -877
  46. package/examples/README.md +54 -0
  47. package/examples/fibonacci/README.md +89 -0
  48. package/examples/fibonacci/bench.mjs +87 -0
  49. package/examples/fibonacci/main.ts +21 -0
  50. package/examples/hello-world/README.md +62 -0
  51. package/examples/hello-world/bench.mjs +66 -0
  52. package/examples/hello-world/main.ts +7 -0
  53. package/examples/json-server/README.md +127 -0
  54. package/examples/json-server/bench.mjs +263 -0
  55. package/examples/json-server/main.ts +67 -0
  56. package/govendor/github.com/andybalholm/brotli/LICENSE +19 -0
  57. package/govendor/github.com/andybalholm/brotli/README.md +19 -0
  58. package/govendor/github.com/andybalholm/brotli/backward_references.go +185 -0
  59. package/govendor/github.com/andybalholm/brotli/backward_references_hq.go +796 -0
  60. package/govendor/github.com/andybalholm/brotli/bit_cost.go +436 -0
  61. package/govendor/github.com/andybalholm/brotli/bit_reader.go +266 -0
  62. package/govendor/github.com/andybalholm/brotli/bitwriter.go +56 -0
  63. package/govendor/github.com/andybalholm/brotli/block_splitter.go +144 -0
  64. package/govendor/github.com/andybalholm/brotli/block_splitter_command.go +434 -0
  65. package/govendor/github.com/andybalholm/brotli/block_splitter_distance.go +433 -0
  66. package/govendor/github.com/andybalholm/brotli/block_splitter_literal.go +433 -0
  67. package/govendor/github.com/andybalholm/brotli/brotli_bit_stream.go +1435 -0
  68. package/govendor/github.com/andybalholm/brotli/cluster.go +30 -0
  69. package/govendor/github.com/andybalholm/brotli/cluster_command.go +164 -0
  70. package/govendor/github.com/andybalholm/brotli/cluster_distance.go +326 -0
  71. package/govendor/github.com/andybalholm/brotli/cluster_literal.go +326 -0
  72. package/govendor/github.com/andybalholm/brotli/command.go +254 -0
  73. package/govendor/github.com/andybalholm/brotli/compress_fragment.go +834 -0
  74. package/govendor/github.com/andybalholm/brotli/compress_fragment_two_pass.go +775 -0
  75. package/govendor/github.com/andybalholm/brotli/constants.go +77 -0
  76. package/govendor/github.com/andybalholm/brotli/context.go +2176 -0
  77. package/govendor/github.com/andybalholm/brotli/decode.go +2570 -0
  78. package/govendor/github.com/andybalholm/brotli/dictionary.go +122890 -0
  79. package/govendor/github.com/andybalholm/brotli/dictionary_hash.go +32779 -0
  80. package/govendor/github.com/andybalholm/brotli/encode.go +1220 -0
  81. package/govendor/github.com/andybalholm/brotli/encoder.go +177 -0
  82. package/govendor/github.com/andybalholm/brotli/encoder_dict.go +22 -0
  83. package/govendor/github.com/andybalholm/brotli/encoder_fast.go +201 -0
  84. package/govendor/github.com/andybalholm/brotli/entropy_encode.go +592 -0
  85. package/govendor/github.com/andybalholm/brotli/entropy_encode_static.go +4399 -0
  86. package/govendor/github.com/andybalholm/brotli/fast_log.go +290 -0
  87. package/govendor/github.com/andybalholm/brotli/find_match_length.go +45 -0
  88. package/govendor/github.com/andybalholm/brotli/go.mod +3 -0
  89. package/govendor/github.com/andybalholm/brotli/h10.go +287 -0
  90. package/govendor/github.com/andybalholm/brotli/h5.go +214 -0
  91. package/govendor/github.com/andybalholm/brotli/h6.go +216 -0
  92. package/govendor/github.com/andybalholm/brotli/hash.go +342 -0
  93. package/govendor/github.com/andybalholm/brotli/hash_composite.go +93 -0
  94. package/govendor/github.com/andybalholm/brotli/hash_forgetful_chain.go +252 -0
  95. package/govendor/github.com/andybalholm/brotli/hash_longest_match_quickly.go +214 -0
  96. package/govendor/github.com/andybalholm/brotli/hash_rolling.go +168 -0
  97. package/govendor/github.com/andybalholm/brotli/histogram.go +226 -0
  98. package/govendor/github.com/andybalholm/brotli/http.go +201 -0
  99. package/govendor/github.com/andybalholm/brotli/huffman.go +653 -0
  100. package/govendor/github.com/andybalholm/brotli/literal_cost.go +182 -0
  101. package/govendor/github.com/andybalholm/brotli/matchfinder/bargain1.go +212 -0
  102. package/govendor/github.com/andybalholm/brotli/matchfinder/bargain2.go +248 -0
  103. package/govendor/github.com/andybalholm/brotli/matchfinder/bargain3.go +278 -0
  104. package/govendor/github.com/andybalholm/brotli/matchfinder/emitter.go +34 -0
  105. package/govendor/github.com/andybalholm/brotli/matchfinder/m0.go +175 -0
  106. package/govendor/github.com/andybalholm/brotli/matchfinder/m4.go +339 -0
  107. package/govendor/github.com/andybalholm/brotli/matchfinder/matchfinder.go +103 -0
  108. package/govendor/github.com/andybalholm/brotli/matchfinder/pathfinder.go +328 -0
  109. package/govendor/github.com/andybalholm/brotli/matchfinder/textencoder.go +53 -0
  110. package/govendor/github.com/andybalholm/brotli/matchfinder/trio.go +327 -0
  111. package/govendor/github.com/andybalholm/brotli/matchfinder/zdfast.go +258 -0
  112. package/govendor/github.com/andybalholm/brotli/matchfinder/zfast.go +206 -0
  113. package/govendor/github.com/andybalholm/brotli/matchfinder/zm.go +302 -0
  114. package/govendor/github.com/andybalholm/brotli/memory.go +66 -0
  115. package/govendor/github.com/andybalholm/brotli/metablock.go +574 -0
  116. package/govendor/github.com/andybalholm/brotli/metablock_command.go +165 -0
  117. package/govendor/github.com/andybalholm/brotli/metablock_distance.go +165 -0
  118. package/govendor/github.com/andybalholm/brotli/metablock_literal.go +165 -0
  119. package/govendor/github.com/andybalholm/brotli/params.go +37 -0
  120. package/govendor/github.com/andybalholm/brotli/platform.go +103 -0
  121. package/govendor/github.com/andybalholm/brotli/prefix.go +30 -0
  122. package/govendor/github.com/andybalholm/brotli/prefix_dec.go +723 -0
  123. package/govendor/github.com/andybalholm/brotli/quality.go +196 -0
  124. package/govendor/github.com/andybalholm/brotli/reader.go +127 -0
  125. package/govendor/github.com/andybalholm/brotli/ringbuffer.go +134 -0
  126. package/govendor/github.com/andybalholm/brotli/state.go +313 -0
  127. package/govendor/github.com/andybalholm/brotli/static_dict.go +662 -0
  128. package/govendor/github.com/andybalholm/brotli/static_dict_lut.go +75094 -0
  129. package/govendor/github.com/andybalholm/brotli/symbol_list.go +22 -0
  130. package/govendor/github.com/andybalholm/brotli/transform.go +641 -0
  131. package/govendor/github.com/andybalholm/brotli/utf8_util.go +70 -0
  132. package/govendor/github.com/andybalholm/brotli/util.go +7 -0
  133. package/govendor/github.com/andybalholm/brotli/write_bits.go +52 -0
  134. package/govendor/github.com/andybalholm/brotli/writer.go +162 -0
  135. package/govendor/github.com/fsnotify/fsnotify/.mailmap +2 -0
  136. package/govendor/github.com/fsnotify/fsnotify/CHANGELOG.md +651 -0
  137. package/govendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md +147 -0
  138. package/govendor/github.com/fsnotify/fsnotify/LICENSE +25 -0
  139. package/govendor/github.com/fsnotify/fsnotify/README.md +214 -0
  140. package/govendor/github.com/fsnotify/fsnotify/backend_fen.go +469 -0
  141. package/govendor/github.com/fsnotify/fsnotify/backend_inotify.go +597 -0
  142. package/govendor/github.com/fsnotify/fsnotify/backend_kqueue.go +735 -0
  143. package/govendor/github.com/fsnotify/fsnotify/backend_other.go +22 -0
  144. package/govendor/github.com/fsnotify/fsnotify/backend_windows.go +702 -0
  145. package/govendor/github.com/fsnotify/fsnotify/fsnotify.go +526 -0
  146. package/govendor/github.com/fsnotify/fsnotify/go.mod +3 -0
  147. package/govendor/github.com/fsnotify/fsnotify/internal/darwin.go +20 -0
  148. package/govendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go +15 -0
  149. package/govendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go +15 -0
  150. package/govendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go +20 -0
  151. package/govendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go +32 -0
  152. package/govendor/github.com/fsnotify/fsnotify/internal/debug_linux.go +56 -0
  153. package/govendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go +15 -0
  154. package/govendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go +16 -0
  155. package/govendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go +45 -0
  156. package/govendor/github.com/fsnotify/fsnotify/internal/debug_windows.go +40 -0
  157. package/govendor/github.com/fsnotify/fsnotify/internal/freebsd.go +20 -0
  158. package/govendor/github.com/fsnotify/fsnotify/internal/internal.go +2 -0
  159. package/govendor/github.com/fsnotify/fsnotify/internal/unix.go +20 -0
  160. package/govendor/github.com/fsnotify/fsnotify/internal/unix2.go +25 -0
  161. package/govendor/github.com/fsnotify/fsnotify/internal/windows.go +40 -0
  162. package/govendor/github.com/fsnotify/fsnotify/shared.go +64 -0
  163. package/govendor/github.com/fsnotify/fsnotify/staticcheck.conf +3 -0
  164. package/govendor/github.com/fsnotify/fsnotify/system_bsd.go +7 -0
  165. package/govendor/github.com/fsnotify/fsnotify/system_darwin.go +8 -0
  166. package/govendor/manifest.txt +3 -1
  167. package/package.json +1 -1
  168. package/types/typenative-go.d.ts +23 -0
  169. package/types/typenative-npm.d.ts +241 -5
  170. package/types/typenative.d.ts +302 -12
@@ -238,6 +238,36 @@ declare module 'node:fs' {
238
238
  function createReadStream(path: PathLike, options?: BufferEncoding | { encoding?: BufferEncoding; start?: number; end?: number; highWaterMark?: number }): ReadStream;
239
239
  function createWriteStream(path: PathLike, options?: BufferEncoding | { flags?: string; encoding?: BufferEncoding }): WriteStream;
240
240
 
241
+ // --- watching: fs.watch on the OS's notifications (fsnotify), watchFile polls stat() ---
242
+ type WatchEventType = 'rename' | 'change';
243
+ type WatchListener = (event: WatchEventType, filename: string) => void;
244
+ interface WatchOptions {
245
+ persistent?: boolean;
246
+ recursive?: boolean;
247
+ encoding?: BufferEncoding;
248
+ signal?: AbortSignal;
249
+ }
250
+ interface FSWatcher extends import('node:events').EventEmitter {
251
+ close(): void;
252
+ ref(): this;
253
+ unref(): this;
254
+ on(event: 'change', listener: WatchListener): this;
255
+ on(event: 'error', listener: (error: Error) => void): this;
256
+ on(event: 'close', listener: () => void): this;
257
+ once(event: 'change', listener: WatchListener): this;
258
+ once(event: 'error', listener: (error: Error) => void): this;
259
+ once(event: 'close', listener: () => void): this;
260
+ }
261
+ interface StatWatcher extends import('node:events').EventEmitter {
262
+ ref(): this;
263
+ unref(): this;
264
+ }
265
+ function watch(filename: PathLike, listener?: WatchListener): FSWatcher;
266
+ function watch(filename: PathLike, options: WatchOptions | BufferEncoding, listener?: WatchListener): FSWatcher;
267
+ function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher;
268
+ function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number }, listener: (curr: Stats, prev: Stats) => void): StatWatcher;
269
+ function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void;
270
+
241
271
  const promises: typeof import('node:fs/promises');
242
272
  }
243
273
  export = fs;
@@ -285,6 +315,11 @@ declare module 'node:fs/promises' {
285
315
  function readlink(path: fs.PathLike): Promise<string>;
286
316
  function link(existingPath: fs.PathLike, newPath: fs.PathLike): Promise<void>;
287
317
  function open(path: fs.PathLike, flags?: string, mode?: number | string): Promise<FileHandle>;
318
+ interface FileChangeInfo<T extends string> {
319
+ eventType: fs.WatchEventType;
320
+ filename: T;
321
+ }
322
+ function watch(filename: fs.PathLike, options?: { recursive?: boolean; signal?: AbortSignal; persistent?: boolean }): AsyncIterable<FileChangeInfo<string>>;
288
323
  }
289
324
  export = promises;
290
325
  }
@@ -574,16 +609,18 @@ declare module 'node:assert/strict' {
574
609
  }
575
610
 
576
611
  declare module 'node:crypto' {
612
+ import { Transform } from 'node:stream';
577
613
  namespace crypto {
578
614
  type BinaryLike = string | Uint8Array;
579
615
  type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';
580
- interface Hash {
616
+ /** Hash / Hmac are also Transform streams: write, then read or pipe the digest */
617
+ interface Hash extends Transform {
581
618
  update(data: BinaryLike, inputEncoding?: BufferEncoding): Hash;
582
619
  digest(): Buffer;
583
620
  digest(encoding: BinaryToTextEncoding | BufferEncoding): string;
584
621
  copy(): Hash;
585
622
  }
586
- interface Hmac {
623
+ interface Hmac extends Transform {
587
624
  update(data: BinaryLike, inputEncoding?: BufferEncoding): Hmac;
588
625
  digest(): Buffer;
589
626
  digest(encoding: BinaryToTextEncoding | BufferEncoding): string;
@@ -965,6 +1002,20 @@ declare module 'node:zlib' {
965
1002
  function createDeflateRaw(options?: ZlibOptions): import('node:stream').Transform;
966
1003
  function createInflateRaw(options?: ZlibOptions): import('node:stream').Transform;
967
1004
  function createUnzip(options?: ZlibOptions): import('node:stream').Transform;
1005
+ // Brotli: params keyed by constants.BROTLI_PARAM_QUALITY / BROTLI_PARAM_LGWIN
1006
+ interface BrotliOptions {
1007
+ params?: { [key: number]: number };
1008
+ }
1009
+ function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
1010
+ function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
1011
+ function brotliCompress(buf: InputType, callback: CompressCallback): void;
1012
+ function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
1013
+ function brotliDecompress(buf: InputType, callback: CompressCallback): void;
1014
+ function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
1015
+ namespace brotliCompress { function __promisify__(buf: InputType, options?: BrotliOptions): Promise<Buffer>; }
1016
+ namespace brotliDecompress { function __promisify__(buf: InputType, options?: BrotliOptions): Promise<Buffer>; }
1017
+ function createBrotliCompress(options?: BrotliOptions): import('node:stream').Transform;
1018
+ function createBrotliDecompress(options?: BrotliOptions): import('node:stream').Transform;
968
1019
  const constants: {
969
1020
  readonly Z_NO_FLUSH: number;
970
1021
  readonly Z_SYNC_FLUSH: number;
@@ -978,6 +1029,29 @@ declare module 'node:zlib' {
978
1029
  readonly Z_BEST_SPEED: number;
979
1030
  readonly Z_BEST_COMPRESSION: number;
980
1031
  readonly Z_DEFAULT_COMPRESSION: number;
1032
+ readonly BROTLI_DECODE: number;
1033
+ readonly BROTLI_ENCODE: number;
1034
+ readonly BROTLI_OPERATION_PROCESS: number;
1035
+ readonly BROTLI_OPERATION_FLUSH: number;
1036
+ readonly BROTLI_OPERATION_FINISH: number;
1037
+ readonly BROTLI_OPERATION_EMIT_METADATA: number;
1038
+ readonly BROTLI_PARAM_MODE: number;
1039
+ readonly BROTLI_MODE_GENERIC: number;
1040
+ readonly BROTLI_MODE_TEXT: number;
1041
+ readonly BROTLI_MODE_FONT: number;
1042
+ readonly BROTLI_DEFAULT_MODE: number;
1043
+ readonly BROTLI_PARAM_QUALITY: number;
1044
+ readonly BROTLI_MIN_QUALITY: number;
1045
+ readonly BROTLI_MAX_QUALITY: number;
1046
+ readonly BROTLI_DEFAULT_QUALITY: number;
1047
+ readonly BROTLI_PARAM_LGWIN: number;
1048
+ readonly BROTLI_MIN_WINDOW_BITS: number;
1049
+ readonly BROTLI_MAX_WINDOW_BITS: number;
1050
+ readonly BROTLI_DEFAULT_WINDOW: number;
1051
+ readonly BROTLI_PARAM_LGBLOCK: number;
1052
+ readonly BROTLI_PARAM_SIZE_HINT: number;
1053
+ readonly BROTLI_DECODER_RESULT_ERROR: number;
1054
+ readonly BROTLI_DECODER_RESULT_SUCCESS: number;
981
1055
  };
982
1056
  }
983
1057
  export = zlib;
@@ -1492,6 +1566,8 @@ declare module 'node:child_process' {
1492
1566
  shell?: boolean | string;
1493
1567
  stdio?: StdioOption | StdioOption[];
1494
1568
  input?: string | Uint8Array;
1569
+ /** spawn: run the child in its own session / process group, so it can outlive the parent (with unref()) */
1570
+ detached?: boolean;
1495
1571
  }
1496
1572
  interface ExecException extends Error {
1497
1573
  code?: number;
@@ -1522,6 +1598,9 @@ declare module 'node:child_process' {
1522
1598
  readonly spawnfile: string;
1523
1599
  readonly connected: boolean;
1524
1600
  kill(signal?: string | number): boolean;
1601
+ /** The parent no longer waits for the child */
1602
+ unref(): void;
1603
+ ref(): void;
1525
1604
  send(message: any, callback?: (error: Error | null) => void): boolean;
1526
1605
  disconnect(): void;
1527
1606
  }
@@ -1584,6 +1663,17 @@ declare module 'node:readline' {
1584
1663
  function moveCursor(stream: Writable, dx: number, dy: number, callback?: () => void): boolean;
1585
1664
  function clearLine(stream: Writable, dir: Direction, callback?: () => void): boolean;
1586
1665
  function clearScreenDown(stream: Writable, callback?: () => void): boolean;
1666
+ /** A decoded key ('keypress' events); missing fields are "" */
1667
+ interface Key {
1668
+ sequence?: string;
1669
+ name?: string;
1670
+ ctrl?: boolean;
1671
+ meta?: boolean;
1672
+ shift?: boolean;
1673
+ code?: string;
1674
+ }
1675
+ /** Makes the stream emit 'keypress' (str, key) events (str is "" for escape sequences) */
1676
+ function emitKeypressEvents(stream: Readable, readlineInterface?: Interface): void;
1587
1677
  const promises: typeof import('node:readline/promises');
1588
1678
  }
1589
1679
  export = readline;
@@ -1610,6 +1700,58 @@ declare module 'node:readline/promises' {
1610
1700
  export = promises;
1611
1701
  }
1612
1702
 
1703
+ declare module 'node:module' {
1704
+ namespace Module {
1705
+ /** Node's built-in module names (without the node:-only ones such as node:test) */
1706
+ const builtinModules: string[];
1707
+ /** Whether the specifier names a built-in module ('fs', 'node:fs', 'node:test') */
1708
+ function isBuiltin(moduleName: string): boolean;
1709
+ interface Require {
1710
+ /** require('./data.json'): JSON files only, read at compile time */
1711
+ (id: string): any;
1712
+ }
1713
+ /** const require = createRequire(import.meta.url): its require() loads JSON files */
1714
+ function createRequire(path: string | URL): Require;
1715
+ }
1716
+ export = Module;
1717
+ }
1718
+
1719
+ declare module 'node:v8' {
1720
+ namespace v8 {
1721
+ interface HeapInfo {
1722
+ total_heap_size: number;
1723
+ total_heap_size_executable: number;
1724
+ total_physical_size: number;
1725
+ total_available_size: number;
1726
+ used_heap_size: number;
1727
+ heap_size_limit: number;
1728
+ malloced_memory: number;
1729
+ peak_malloced_memory: number;
1730
+ does_zap_garbage: number;
1731
+ number_of_native_contexts: number;
1732
+ number_of_detached_contexts: number;
1733
+ total_global_handles_size: number;
1734
+ used_global_handles_size: number;
1735
+ external_memory: number;
1736
+ }
1737
+ /** From Go's runtime.MemStats; the limit is GOMEMLIMIT, else 4 GiB */
1738
+ function getHeapStatistics(): HeapInfo;
1739
+ /** The structured-clone codec workers use (not V8's wire format) */
1740
+ function serialize(value: any): Buffer;
1741
+ function deserialize(buffer: Uint8Array): any;
1742
+ }
1743
+ export = v8;
1744
+ }
1745
+
1746
+ declare module 'node:sea' {
1747
+ /** Always true: a TypeNative program is a single executable */
1748
+ export function isSea(): boolean;
1749
+ /** TypeNative binaries carry no assets yet: throws ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND */
1750
+ export function getAsset(key: string): ArrayBuffer;
1751
+ export function getAsset(key: string, encoding: string): string;
1752
+ export function getRawAsset(key: string): ArrayBuffer;
1753
+ }
1754
+
1613
1755
  declare module 'node:diagnostics_channel' {
1614
1756
  namespace diagnostics_channel {
1615
1757
  type ChannelListener = (message: unknown, name: string | symbol) => void;
@@ -1811,6 +1953,47 @@ declare module 'node:dns' {
1811
1953
  priority: number;
1812
1954
  weight: number;
1813
1955
  }
1956
+ interface RecordWithTtl {
1957
+ address: string;
1958
+ ttl: number;
1959
+ }
1960
+ interface ResolveWithTtlOptions {
1961
+ ttl: true;
1962
+ }
1963
+ interface SoaRecord {
1964
+ nsname: string;
1965
+ hostmaster: string;
1966
+ serial: number;
1967
+ refresh: number;
1968
+ retry: number;
1969
+ expire: number;
1970
+ minttl: number;
1971
+ }
1972
+ interface NaptrRecord {
1973
+ flags: string;
1974
+ service: string;
1975
+ regexp: string;
1976
+ replacement: string;
1977
+ order: number;
1978
+ preference: number;
1979
+ }
1980
+ interface CaaRecord {
1981
+ critical: number;
1982
+ issue?: string;
1983
+ issuewild?: string;
1984
+ iodef?: string;
1985
+ contactemail?: string;
1986
+ contactphone?: string;
1987
+ }
1988
+ type AnyRecord =
1989
+ | (RecordWithTtl & { type: 'A' | 'AAAA' })
1990
+ | { type: 'CNAME' | 'NS' | 'PTR'; value: string }
1991
+ | (MxRecord & { type: 'MX' })
1992
+ | (SoaRecord & { type: 'SOA' })
1993
+ | { type: 'TXT'; entries: string[] }
1994
+ | (SrvRecord & { type: 'SRV' })
1995
+ | (NaptrRecord & { type: 'NAPTR' })
1996
+ | (CaaRecord & { type: 'CAA' });
1814
1997
  function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
1815
1998
  function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
1816
1999
  function lookup(hostname: string, options: LookupOptions & { all: true }, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
@@ -1820,6 +2003,17 @@ declare module 'node:dns' {
1820
2003
  function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
1821
2004
  function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
1822
2005
  function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
2006
+ function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2007
+ function resolve(hostname: string, rrtype: 'CAA', callback: (err: NodeJS.ErrnoException | null, addresses: CaaRecord[]) => void): void;
2008
+ function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2009
+ function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
2010
+ function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2011
+ function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2012
+ function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2013
+ function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
2014
+ function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2015
+ function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2016
+ function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
1823
2017
  function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
1824
2018
  function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
1825
2019
  function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
@@ -1833,6 +2027,7 @@ declare module 'node:dns' {
1833
2027
  function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
1834
2028
  interface ResolverOptions {
1835
2029
  timeout?: number;
2030
+ /** Rounds over the servers for record queries (default 4) */
1836
2031
  tries?: number;
1837
2032
  }
1838
2033
  class Resolver {
@@ -1846,6 +2041,17 @@ declare module 'node:dns' {
1846
2041
  resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
1847
2042
  resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
1848
2043
  resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
2044
+ resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2045
+ resolve(hostname: string, rrtype: 'CAA', callback: (err: NodeJS.ErrnoException | null, addresses: CaaRecord[]) => void): void;
2046
+ resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2047
+ resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
2048
+ resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2049
+ resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2050
+ resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2051
+ resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
2052
+ resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2053
+ resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2054
+ resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
1849
2055
  resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
1850
2056
  resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
1851
2057
  resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
@@ -1863,7 +2069,7 @@ declare module 'node:dns' {
1863
2069
  }
1864
2070
 
1865
2071
  declare module 'node:dns/promises' {
1866
- import { LookupOptions, LookupAddress, MxRecord, SrvRecord, ResolverOptions } from 'node:dns';
2072
+ import { LookupOptions, LookupAddress, MxRecord, SrvRecord, ResolverOptions, RecordWithTtl, ResolveWithTtlOptions, SoaRecord, NaptrRecord, CaaRecord, AnyRecord } from 'node:dns';
1867
2073
  namespace dnsPromises {
1868
2074
  function lookup(hostname: string, options: LookupOptions & { all: true }): Promise<LookupAddress[]>;
1869
2075
  function lookup(hostname: string, options?: number | LookupOptions): Promise<LookupAddress>;
@@ -1871,6 +2077,17 @@ declare module 'node:dns/promises' {
1871
2077
  function resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
1872
2078
  function resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
1873
2079
  function resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
2080
+ function resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
2081
+ function resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
2082
+ function resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
2083
+ function resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
2084
+ function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
2085
+ function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
2086
+ function resolveAny(hostname: string): Promise<AnyRecord[]>;
2087
+ function resolveCaa(hostname: string): Promise<CaaRecord[]>;
2088
+ function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
2089
+ function resolvePtr(hostname: string): Promise<string[]>;
2090
+ function resolveSoa(hostname: string): Promise<SoaRecord>;
1874
2091
  function resolve4(hostname: string): Promise<string[]>;
1875
2092
  function resolve6(hostname: string): Promise<string[]>;
1876
2093
  function resolveCname(hostname: string): Promise<string[]>;
@@ -1892,6 +2109,17 @@ declare module 'node:dns/promises' {
1892
2109
  resolve(hostname: string, rrtype: 'MX'): Promise<MxRecord[]>;
1893
2110
  resolve(hostname: string, rrtype: 'TXT'): Promise<string[][]>;
1894
2111
  resolve(hostname: string, rrtype: 'SRV'): Promise<SrvRecord[]>;
2112
+ resolve(hostname: string, rrtype: 'ANY'): Promise<AnyRecord[]>;
2113
+ resolve(hostname: string, rrtype: 'CAA'): Promise<CaaRecord[]>;
2114
+ resolve(hostname: string, rrtype: 'NAPTR'): Promise<NaptrRecord[]>;
2115
+ resolve(hostname: string, rrtype: 'SOA'): Promise<SoaRecord>;
2116
+ resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
2117
+ resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
2118
+ resolveAny(hostname: string): Promise<AnyRecord[]>;
2119
+ resolveCaa(hostname: string): Promise<CaaRecord[]>;
2120
+ resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
2121
+ resolvePtr(hostname: string): Promise<string[]>;
2122
+ resolveSoa(hostname: string): Promise<SoaRecord>;
1895
2123
  resolve4(hostname: string): Promise<string[]>;
1896
2124
  resolve6(hostname: string): Promise<string[]>;
1897
2125
  resolveCname(hostname: string): Promise<string[]>;
@@ -1956,6 +2184,8 @@ declare module 'node:http' {
1956
2184
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders | string[]): this;
1957
2185
  writeContinue(): void;
1958
2186
  setTimeout(msecs: number, callback?: () => void): this;
2187
+ /** Trailing headers, sent after a chunked body (not with a Content-Length) */
2188
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
1959
2189
  }
1960
2190
  class ClientRequest extends OutgoingMessage {
1961
2191
  readonly method: string;
@@ -2174,6 +2404,10 @@ declare module 'node:dgram' {
2174
2404
  setTTL(ttl: number): number;
2175
2405
  setMulticastTTL(ttl: number): number;
2176
2406
  setMulticastLoopback(flag: boolean): boolean;
2407
+ setMulticastInterface(multicastInterface: string): void;
2408
+ /** Joins a multicast group (an unbound socket binds first) */
2409
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
2410
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
2177
2411
  setRecvBufferSize(size: number): void;
2178
2412
  setSendBufferSize(size: number): void;
2179
2413
  }
@@ -2479,8 +2713,8 @@ declare module 'node:sqlite' {
2479
2713
  allowUnknownNamedParameters?: boolean;
2480
2714
  }
2481
2715
  // SQLite runs as Wasm inside the program (github.com/ncruces/go-sqlite3):
2482
- // loadExtension, createSession / applyChangeset and serialize / deserialize
2483
- // throw
2716
+ // loadExtension and createSession / applyChangeset throw; serialize /
2717
+ // deserialize go through a temporary file
2484
2718
  class DatabaseSync {
2485
2719
  constructor(path: string | Uint8Array | URL, options?: DatabaseSyncOptions);
2486
2720
  readonly isOpen: boolean;
@@ -2620,6 +2854,8 @@ declare module 'fs/promises' { import m = require('node:fs/promises'); export =
2620
2854
  declare module 'url' { import m = require('node:url'); export = m; }
2621
2855
  declare module 'querystring' { import m = require('node:querystring'); export = m; }
2622
2856
  declare module 'punycode' { import m = require('node:punycode'); export = m; }
2857
+ declare module 'module' { import m = require('node:module'); export = m; }
2858
+ declare module 'v8' { import m = require('node:v8'); export = m; }
2623
2859
  declare module 'string_decoder' { import m = require('node:string_decoder'); export = m; }
2624
2860
  declare module 'os' { import m = require('node:os'); export = m; }
2625
2861
  declare module 'process' { import m = require('node:process'); export = m; }