@scriptc/compiler 0.3.3 → 0.3.4

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 (213) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +713 -26
  2. package/dist/backend/cycle-mutability.d.ts +5 -0
  3. package/dist/backend/cycle-mutability.js +62 -3
  4. package/dist/backend/cycle-mutability.js.map +1 -1
  5. package/dist/backend/executable-features.js +1 -0
  6. package/dist/backend/executable-features.js.map +1 -1
  7. package/dist/backend/library-pack.js +1 -0
  8. package/dist/backend/library-pack.js.map +1 -1
  9. package/dist/backend/llvm/call-lifetimes.d.ts +5 -1
  10. package/dist/backend/llvm/call-lifetimes.js +11 -3
  11. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  12. package/dist/backend/llvm/call-lifetimes.test.js +31 -1
  13. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  14. package/dist/backend/llvm/common.d.ts +5 -0
  15. package/dist/backend/llvm/common.js +7 -0
  16. package/dist/backend/llvm/common.js.map +1 -1
  17. package/dist/backend/llvm/dense-array-access.js +2 -2
  18. package/dist/backend/llvm/dense-array-access.js.map +1 -1
  19. package/dist/backend/llvm/dyn.d.ts +40 -1
  20. package/dist/backend/llvm/dyn.js +178 -27
  21. package/dist/backend/llvm/dyn.js.map +1 -1
  22. package/dist/backend/llvm/emitter.d.ts +12 -0
  23. package/dist/backend/llvm/emitter.js +164 -27
  24. package/dist/backend/llvm/emitter.js.map +1 -1
  25. package/dist/backend/llvm/expr-bytes.d.ts +9 -0
  26. package/dist/backend/llvm/expr-bytes.js +158 -63
  27. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  28. package/dist/backend/llvm/expr-calls.d.ts +3 -1
  29. package/dist/backend/llvm/expr-calls.js +49 -1
  30. package/dist/backend/llvm/expr-calls.js.map +1 -1
  31. package/dist/backend/llvm/expr-containers.js +16 -5
  32. package/dist/backend/llvm/expr-containers.js.map +1 -1
  33. package/dist/backend/llvm/intern-tables.test.d.ts +1 -0
  34. package/dist/backend/llvm/intern-tables.test.js +77 -0
  35. package/dist/backend/llvm/intern-tables.test.js.map +1 -0
  36. package/dist/backend/llvm/lib-datagram.js +10 -0
  37. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  38. package/dist/backend/llvm/lib-dispatch.js +92 -1
  39. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  40. package/dist/backend/llvm/lib-filesystem.js +51 -0
  41. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  42. package/dist/backend/llvm/lib-network.js +16 -0
  43. package/dist/backend/llvm/lib-network.js.map +1 -1
  44. package/dist/backend/llvm/lib-shared.d.ts +5 -0
  45. package/dist/backend/llvm/lib-shared.js +80 -1
  46. package/dist/backend/llvm/lib-shared.js.map +1 -1
  47. package/dist/backend/llvm/lib-stream.js +87 -0
  48. package/dist/backend/llvm/lib-stream.js.map +1 -1
  49. package/dist/backend/llvm/lib-test.js +9 -0
  50. package/dist/backend/llvm/lib-test.js.map +1 -1
  51. package/dist/backend/llvm/map-number-lookup.d.ts +4 -0
  52. package/dist/backend/llvm/map-number-lookup.js +22 -0
  53. package/dist/backend/llvm/map-number-lookup.js.map +1 -1
  54. package/dist/backend/llvm/map-number-lookup.test.js +56 -0
  55. package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
  56. package/dist/backend/llvm/map-read-lifetimes.d.ts +9 -0
  57. package/dist/backend/llvm/map-read-lifetimes.js +89 -1
  58. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  59. package/dist/backend/llvm/map-read-lifetimes.test.js +129 -1
  60. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  61. package/dist/backend/llvm/publish.d.ts +5 -0
  62. package/dist/backend/llvm/publish.js +22 -3
  63. package/dist/backend/llvm/publish.js.map +1 -1
  64. package/dist/backend/llvm/reference-writes.js +5 -2
  65. package/dist/backend/llvm/reference-writes.js.map +1 -1
  66. package/dist/backend/llvm/regions.d.ts +4 -1
  67. package/dist/backend/llvm/regions.js +12 -3
  68. package/dist/backend/llvm/regions.js.map +1 -1
  69. package/dist/backend/llvm/string-reads.js +2 -2
  70. package/dist/backend/llvm/string-reads.js.map +1 -1
  71. package/dist/backend/llvm/string-slices.js +2 -2
  72. package/dist/backend/llvm/string-slices.js.map +1 -1
  73. package/dist/backend/may-throw.js +4 -0
  74. package/dist/backend/may-throw.js.map +1 -1
  75. package/dist/backend/native/contracts.d.ts +3 -0
  76. package/dist/backend/native/executable.js +13 -5
  77. package/dist/backend/native/executable.js.map +1 -1
  78. package/dist/backend/native/runtime-inputs.d.ts +1 -1
  79. package/dist/backend/native/runtime-inputs.js +1 -0
  80. package/dist/backend/native/runtime-inputs.js.map +1 -1
  81. package/dist/backend/native-codegen-core.d.ts +4 -4
  82. package/dist/backend/native-codegen-core.js +4 -6
  83. package/dist/backend/native-codegen-core.js.map +1 -1
  84. package/dist/backend/native-codegen.test.js +7 -8
  85. package/dist/backend/native-codegen.test.js.map +1 -1
  86. package/dist/backend/native-link-info-core.d.ts +3 -0
  87. package/dist/backend/native-link-info-core.js.map +1 -1
  88. package/dist/backend/publication.js +3 -1
  89. package/dist/backend/publication.js.map +1 -1
  90. package/dist/backend/runtime-pack-targets.test.js +1 -0
  91. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  92. package/dist/backend/runtime-pack.test.js +1 -0
  93. package/dist/backend/runtime-pack.test.js.map +1 -1
  94. package/dist/backend/target-diagnostics.js +7 -0
  95. package/dist/backend/target-diagnostics.js.map +1 -1
  96. package/dist/backend/warm-cache.js +1 -0
  97. package/dist/backend/warm-cache.js.map +1 -1
  98. package/dist/executable/executable-cache.d.ts +1 -0
  99. package/dist/executable/executable-cache.js +1 -0
  100. package/dist/executable/executable-cache.js.map +1 -1
  101. package/dist/executable/executable-cache.test.js +1 -0
  102. package/dist/executable/executable-cache.test.js.map +1 -1
  103. package/dist/frontend/experimental-import.d.ts +5 -1
  104. package/dist/frontend/experimental-import.js +28 -3
  105. package/dist/frontend/experimental-import.js.map +1 -1
  106. package/dist/frontend/lowering/assert-instances.d.ts +38 -0
  107. package/dist/frontend/lowering/assert-instances.js +269 -0
  108. package/dist/frontend/lowering/assert-instances.js.map +1 -0
  109. package/dist/frontend/lowering/builtins/compression.d.ts +18 -0
  110. package/dist/frontend/lowering/builtins/compression.js +175 -2
  111. package/dist/frontend/lowering/builtins/compression.js.map +1 -1
  112. package/dist/frontend/lowering/builtins/constants.js +7 -2
  113. package/dist/frontend/lowering/builtins/constants.js.map +1 -1
  114. package/dist/frontend/lowering/builtins/crypto.d.ts +6 -0
  115. package/dist/frontend/lowering/builtins/crypto.js +111 -1
  116. package/dist/frontend/lowering/builtins/crypto.js.map +1 -1
  117. package/dist/frontend/lowering/builtins/errors.js +23 -0
  118. package/dist/frontend/lowering/builtins/errors.js.map +1 -1
  119. package/dist/frontend/lowering/builtins/timers.d.ts +3 -0
  120. package/dist/frontend/lowering/builtins/timers.js +109 -23
  121. package/dist/frontend/lowering/builtins/timers.js.map +1 -1
  122. package/dist/frontend/lowering/call-signatures.js +6 -0
  123. package/dist/frontend/lowering/call-signatures.js.map +1 -1
  124. package/dist/frontend/lowering/class-dynamic-dispatch.js +66 -12
  125. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  126. package/dist/frontend/lowering/intern-tables.d.ts +13 -0
  127. package/dist/frontend/lowering/intern-tables.js +536 -0
  128. package/dist/frontend/lowering/intern-tables.js.map +1 -0
  129. package/dist/frontend/lowering/lower-assert.js +700 -61
  130. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  131. package/dist/frontend/lowering/lower-async-iteration.js +11 -2
  132. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  133. package/dist/frontend/lowering/lower-calls.js +17 -3
  134. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  135. package/dist/frontend/lowering/lower-classes.d.ts +3 -0
  136. package/dist/frontend/lowering/lower-classes.js +36 -0
  137. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  138. package/dist/frontend/lowering/lower-dgram.js +77 -52
  139. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  140. package/dist/frontend/lowering/lower-exprs.js +12 -0
  141. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  142. package/dist/frontend/lowering/lower-inspect.d.ts +6 -0
  143. package/dist/frontend/lowering/lower-inspect.js +112 -39
  144. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  145. package/dist/frontend/lowering/lower-mock.d.ts +11 -0
  146. package/dist/frontend/lowering/lower-mock.js +504 -0
  147. package/dist/frontend/lowering/lower-mock.js.map +1 -0
  148. package/dist/frontend/lowering/lower-modules.js +7 -0
  149. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  150. package/dist/frontend/lowering/lower-server.d.ts +3 -0
  151. package/dist/frontend/lowering/lower-server.js +380 -30
  152. package/dist/frontend/lowering/lower-server.js.map +1 -1
  153. package/dist/frontend/lowering/lower-stmts.js +23 -2
  154. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  155. package/dist/frontend/lowering/lower-stream.d.ts +10 -6
  156. package/dist/frontend/lowering/lower-stream.js +786 -27
  157. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  158. package/dist/frontend/lowering/lower-test.js +86 -8
  159. package/dist/frontend/lowering/lower-test.js.map +1 -1
  160. package/dist/frontend/lowering/lowerer.d.ts +22 -0
  161. package/dist/frontend/lowering/lowerer.js +72 -7
  162. package/dist/frontend/lowering/lowerer.js.map +1 -1
  163. package/dist/frontend/lowering/pairs-snapshot.d.ts +6 -0
  164. package/dist/frontend/lowering/pairs-snapshot.js +49 -0
  165. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  166. package/dist/frontend/lowering/surfaces.d.ts +4 -0
  167. package/dist/frontend/lowering/surfaces.js +61 -15
  168. package/dist/frontend/lowering/surfaces.js.map +1 -1
  169. package/dist/frontend/lowering/zlib-constants.d.ts +1 -0
  170. package/dist/frontend/lowering/zlib-constants.js +181 -0
  171. package/dist/frontend/lowering/zlib-constants.js.map +1 -0
  172. package/dist/frontend/mock-shapes.d.ts +10 -0
  173. package/dist/frontend/mock-shapes.js +76 -0
  174. package/dist/frontend/mock-shapes.js.map +1 -0
  175. package/dist/frontend/pipeline.js +5 -3
  176. package/dist/frontend/pipeline.js.map +1 -1
  177. package/dist/frontend/program.js +6 -1
  178. package/dist/frontend/program.js.map +1 -1
  179. package/dist/frontend/resolve.d.ts +4 -0
  180. package/dist/frontend/resolve.js +14 -0
  181. package/dist/frontend/resolve.js.map +1 -1
  182. package/dist/frontend/tsc-codes.js +1 -0
  183. package/dist/frontend/tsc-codes.js.map +1 -1
  184. package/dist/frontend/type-mapper.d.ts +5 -0
  185. package/dist/frontend/type-mapper.js +102 -9
  186. package/dist/frontend/type-mapper.js.map +1 -1
  187. package/dist/index.js +2 -1
  188. package/dist/index.js.map +1 -1
  189. package/dist/ir/builtin-effects.js +36 -0
  190. package/dist/ir/builtin-effects.js.map +1 -1
  191. package/dist/ir/builtin-signatures.d.ts +1 -1
  192. package/dist/ir/builtin-signatures.js +147 -8
  193. package/dist/ir/builtin-signatures.js.map +1 -1
  194. package/dist/ir/ir.d.ts +20 -1
  195. package/dist/ir/ir.js +17 -0
  196. package/dist/ir/ir.js.map +1 -1
  197. package/dist/ir/runtime-features.d.ts +1 -0
  198. package/dist/ir/runtime-features.js +29 -2
  199. package/dist/ir/runtime-features.js.map +1 -1
  200. package/dist/ir/validate.js +195 -5
  201. package/dist/ir/validate.js.map +1 -1
  202. package/dist/library/ir-policy.js +1 -0
  203. package/dist/library/ir-policy.js.map +1 -1
  204. package/dist/native/cli.js +1 -0
  205. package/dist/native/cli.js.map +1 -1
  206. package/dist/native/compiler.js +1 -3
  207. package/dist/native/compiler.js.map +1 -1
  208. package/dist/native/prepare.js +1 -0
  209. package/dist/native/prepare.js.map +1 -1
  210. package/dist/native/sanitizer.test.js +1 -0
  211. package/dist/native/sanitizer.test.js.map +1 -1
  212. package/package.json +20 -20
  213. package/surface-manifest.json +869 -48
@@ -992,14 +992,22 @@ declare module "timers" {
992
992
  }
993
993
 
994
994
  /* node:timers/promises — the promisified pair the Node test harness leans
995
- * on (`await setTimeout(ms)` as a sleep). setTimeout's delay-only form and
996
- * setImmediate's bare form lower (a void promise the shared timer heap
997
- * settles); setInterval(delay, value) lowers to a typed async iterator.
998
- * Resolve values on the one-shot pair and AbortSignal options remain
999
- * declared surface that fences per site. */
995
+ * on (`await setTimeout(ms)` as a sleep). setTimeout and setImmediate
996
+ * settle with their resolve value (undefined without one) from the shared
997
+ * timer heap and the immediate queue; setInterval(delay, value) lowers to a
998
+ * typed async iterator. The options object takes `ref`; AbortSignal
999
+ * options remain declared surface that fences per site. */
1000
1000
  declare module "node:timers/promises" {
1001
- export function setTimeout(delay?: number): Promise<void>;
1002
- export function setImmediate(): Promise<void>;
1001
+ export interface TimerOptions {
1002
+ ref?: boolean;
1003
+ signal?: AbortSignal;
1004
+ }
1005
+ export function setTimeout<T = void>(
1006
+ delay?: number,
1007
+ value?: T,
1008
+ options?: TimerOptions,
1009
+ ): Promise<T>;
1010
+ export function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
1003
1011
  export function setInterval<T = unknown>(
1004
1012
  delay?: number,
1005
1013
  value?: T,
@@ -2442,6 +2450,95 @@ declare module "crypto" {
2442
2450
  callback: (error: Error | null, buffer: Buffer) => void,
2443
2451
  ): void;
2444
2452
  export type BinaryLike = string | ArrayBuffer | ArrayBufferView;
2453
+ /* Cipheriv/Decipheriv: aes-128/192/256 in cbc, ctr, and gcm modes and
2454
+ * chacha20-poly1305. The stream.Transform members are not declared. */
2455
+ export type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
2456
+ export type CipherChaCha20Poly1305Types = "chacha20-poly1305";
2457
+ export type CipherKey = BinaryLike | KeyObject;
2458
+ export interface CipherGCMOptions {
2459
+ authTagLength?: number;
2460
+ }
2461
+ export interface CipherChaCha20Poly1305Options {
2462
+ authTagLength?: number;
2463
+ }
2464
+ export interface Cipheriv {
2465
+ update(data: string | ArrayBufferView): Buffer;
2466
+ update(data: string, inputEncoding: BufferEncoding): Buffer;
2467
+ update(data: ArrayBufferView, inputEncoding: undefined, outputEncoding: BufferEncoding): string;
2468
+ update(
2469
+ data: string,
2470
+ inputEncoding: BufferEncoding | undefined,
2471
+ outputEncoding: BufferEncoding,
2472
+ ): string;
2473
+ final(): Buffer;
2474
+ final(outputEncoding: BufferEncoding): string;
2475
+ setAutoPadding(autoPadding?: boolean): this;
2476
+ }
2477
+ export interface CipherGCM extends Cipheriv {
2478
+ setAAD(buffer: ArrayBufferView, options?: { plaintextLength: number }): this;
2479
+ getAuthTag(): Buffer;
2480
+ }
2481
+ export interface CipherChaCha20Poly1305 extends Cipheriv {
2482
+ setAAD(buffer: ArrayBufferView, options?: { plaintextLength: number }): this;
2483
+ getAuthTag(): Buffer;
2484
+ }
2485
+ export interface Decipheriv {
2486
+ update(data: ArrayBufferView): Buffer;
2487
+ update(data: string, inputEncoding: BufferEncoding): Buffer;
2488
+ update(data: ArrayBufferView, inputEncoding: undefined, outputEncoding: BufferEncoding): string;
2489
+ update(
2490
+ data: string,
2491
+ inputEncoding: BufferEncoding | undefined,
2492
+ outputEncoding: BufferEncoding,
2493
+ ): string;
2494
+ final(): Buffer;
2495
+ final(outputEncoding: BufferEncoding): string;
2496
+ setAutoPadding(autoPadding?: boolean): this;
2497
+ }
2498
+ export interface DecipherGCM extends Decipheriv {
2499
+ setAuthTag(buffer: ArrayBufferView): this;
2500
+ setAAD(buffer: ArrayBufferView, options?: { plaintextLength: number }): this;
2501
+ }
2502
+ export interface DecipherChaCha20Poly1305 extends Decipheriv {
2503
+ setAuthTag(buffer: ArrayBufferView): this;
2504
+ setAAD(buffer: ArrayBufferView, options?: { plaintextLength: number }): this;
2505
+ }
2506
+ export function createCipheriv(
2507
+ algorithm: CipherGCMTypes,
2508
+ key: CipherKey,
2509
+ iv: BinaryLike,
2510
+ options?: CipherGCMOptions,
2511
+ ): CipherGCM;
2512
+ export function createCipheriv(
2513
+ algorithm: CipherChaCha20Poly1305Types,
2514
+ key: CipherKey,
2515
+ iv: BinaryLike,
2516
+ options?: CipherChaCha20Poly1305Options,
2517
+ ): CipherChaCha20Poly1305;
2518
+ export function createCipheriv(
2519
+ algorithm: string,
2520
+ key: CipherKey,
2521
+ iv: BinaryLike | null,
2522
+ options?: { authTagLength?: number },
2523
+ ): Cipheriv;
2524
+ export function createDecipheriv(
2525
+ algorithm: CipherGCMTypes,
2526
+ key: CipherKey,
2527
+ iv: BinaryLike,
2528
+ options?: CipherGCMOptions,
2529
+ ): DecipherGCM;
2530
+ export function createDecipheriv(
2531
+ algorithm: CipherChaCha20Poly1305Types,
2532
+ key: CipherKey,
2533
+ iv: BinaryLike,
2534
+ options?: CipherChaCha20Poly1305Options,
2535
+ ): DecipherChaCha20Poly1305;
2536
+ export function createDecipheriv(
2537
+ algorithm: string,
2538
+ key: CipherKey,
2539
+ iv: BinaryLike | null,
2540
+ options?: { authTagLength?: number },
2541
+ ): Decipheriv;
2445
2542
  export interface ScryptOptions {
2446
2543
  N?: number;
2447
2544
  r?: number;
@@ -3019,7 +3116,9 @@ declare module "node:test" {
3019
3116
  }
3020
3117
  interface TestContext {
3021
3118
  readonly name: string;
3119
+ readonly fullName: string;
3022
3120
  readonly assert: TestContextAssert;
3121
+ readonly mock: MockTracker;
3023
3122
  test(name: string, fn?: TestFn): Promise<void>;
3024
3123
  test(name: string, options: TestOptions, fn?: TestFn): Promise<void>;
3025
3124
  skip(message?: string): void;
@@ -3069,10 +3168,45 @@ declare module "node:test" {
3069
3168
  function after(fn: HookFn): void;
3070
3169
  function beforeEach(fn: HookFn): void;
3071
3170
  function afterEach(fn: HookFn): void;
3171
+ /* The mock function surface: mock.fn and t.mock.fn, with the calls log
3172
+ * and the implementation controls on fn.mock. */
3173
+ interface MockFunctionCall<
3174
+ F extends Function,
3175
+ ReturnType = F extends (...args: any) => infer T ? T : unknown,
3176
+ Args = F extends (...args: infer Y) => any ? Y : unknown[],
3177
+ > {
3178
+ arguments: Args;
3179
+ error: unknown | undefined;
3180
+ result: ReturnType | undefined;
3181
+ this: unknown;
3182
+ }
3183
+ interface MockFunctionContext<F extends Function> {
3184
+ readonly calls: MockFunctionCall<F>[];
3185
+ callCount(): number;
3186
+ mockImplementation(implementation: F): void;
3187
+ mockImplementationOnce(implementation: F, onCall?: number): void;
3188
+ resetCalls(): void;
3189
+ restore(): void;
3190
+ }
3191
+ type Mock<F extends Function> = F & { mock: MockFunctionContext<F> };
3192
+ interface MockTracker {
3193
+ fn<F extends Function = (...args: any[]) => undefined>(original?: F): Mock<F>;
3194
+ fn<F extends Function = (...args: any[]) => undefined, Implementation extends Function = F>(
3195
+ original?: F,
3196
+ implementation?: Implementation,
3197
+ ): Mock<F | Implementation>;
3198
+ method<MockedObject extends object>(
3199
+ object: MockedObject,
3200
+ methodName: keyof MockedObject,
3201
+ implementation?: Function,
3202
+ ): Mock<Function>;
3203
+ reset(): void;
3204
+ restoreAll(): void;
3205
+ }
3206
+ const mock: MockTracker;
3072
3207
  /* Declared for typechecking only — every use fences (no lowering).
3073
3208
  * `assert` is the module-level custom-assertion registry (v24's
3074
3209
  * `const { assert } = require('node:test')`), not TestContext.assert. */
3075
- const mock: unknown;
3076
3210
  const assert: { register(name: string, fn: (...args: unknown[]) => unknown): void };
3077
3211
  function run(options?: unknown): unknown;
3078
3212
  function snapshot(...args: unknown[]): unknown;
@@ -3091,6 +3225,10 @@ declare module "node:test" {
3091
3225
  snapshot,
3092
3226
  TestContext,
3093
3227
  TestOptions,
3228
+ Mock,
3229
+ MockFunctionContext,
3230
+ MockFunctionCall,
3231
+ MockTracker,
3094
3232
  };
3095
3233
  export default test;
3096
3234
  }
@@ -3098,11 +3236,28 @@ declare module "node:test" {
3098
3236
  declare module "assert" {
3099
3237
  function assert(value: unknown, message?: string): void;
3100
3238
  namespace assert {
3239
+ interface AssertionErrorOptions {
3240
+ message?: string | undefined;
3241
+ actual?: unknown;
3242
+ expected?: unknown;
3243
+ operator?: string | undefined;
3244
+ stackStartFn?: Function | undefined;
3245
+ diff?: "simple" | "full" | undefined;
3246
+ }
3247
+ class AssertionError extends Error {
3248
+ constructor(options: AssertionErrorOptions);
3249
+ actual: unknown;
3250
+ expected: unknown;
3251
+ generatedMessage: boolean;
3252
+ code: "ERR_ASSERTION";
3253
+ operator: string;
3254
+ }
3101
3255
  function ok(value: unknown, message?: string): void;
3102
3256
  function strictEqual(actual: unknown, expected: unknown, message?: string): void;
3103
3257
  function notStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3104
3258
  function deepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3105
3259
  function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3260
+ function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3106
3261
  function equal(actual: unknown, expected: unknown, message?: string): void;
3107
3262
  function notEqual(actual: unknown, expected: unknown, message?: string): void;
3108
3263
  function deepEqual(actual: unknown, expected: unknown, message?: string): void;
@@ -3124,6 +3279,36 @@ declare module "assert" {
3124
3279
  function doesNotMatch(value: string, regExp: RegExp, message?: string): void;
3125
3280
  function ifError(value: unknown): void;
3126
3281
  const strict: typeof import("assert/strict");
3282
+ interface AssertOptions {
3283
+ diff?: "simple" | "full" | undefined;
3284
+ strict?: boolean | undefined;
3285
+ skipPrototype?: boolean | undefined;
3286
+ }
3287
+ type AssertMethodNames =
3288
+ | "deepEqual"
3289
+ | "deepStrictEqual"
3290
+ | "doesNotMatch"
3291
+ | "doesNotReject"
3292
+ | "doesNotThrow"
3293
+ | "equal"
3294
+ | "fail"
3295
+ | "ifError"
3296
+ | "match"
3297
+ | "notDeepEqual"
3298
+ | "notDeepStrictEqual"
3299
+ | "notEqual"
3300
+ | "notStrictEqual"
3301
+ | "ok"
3302
+ | "partialDeepStrictEqual"
3303
+ | "rejects"
3304
+ | "strictEqual"
3305
+ | "throws";
3306
+ interface Assert extends Pick<typeof assert, AssertMethodNames> {}
3307
+ interface AssertStrict extends Pick<typeof strict, AssertMethodNames> {}
3308
+ const Assert: {
3309
+ new (options?: AssertOptions & { strict?: true | undefined }): AssertStrict;
3310
+ new (options: AssertOptions): Assert;
3311
+ };
3127
3312
  }
3128
3313
  export = assert;
3129
3314
  }
@@ -3146,6 +3331,7 @@ declare module "assert/strict" {
3146
3331
  function notStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3147
3332
  function deepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3148
3333
  function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3334
+ function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string): void;
3149
3335
  function fail(message?: string): never;
3150
3336
  function throws(fn: () => unknown, expected?: unknown, message?: string): void;
3151
3337
  function doesNotThrow(fn: () => unknown, expected?: unknown, message?: string): void;
@@ -3163,6 +3349,10 @@ declare module "assert/strict" {
3163
3349
  function doesNotMatch(value: string, regExp: RegExp, message?: string): void;
3164
3350
  function ifError(value: unknown): void;
3165
3351
  const strict: typeof import("assert/strict");
3352
+ type AssertOptions = import("assert").AssertOptions;
3353
+ type Assert = import("assert").Assert;
3354
+ type AssertStrict = import("assert").AssertStrict;
3355
+ const Assert: typeof import("assert").Assert;
3166
3356
  }
3167
3357
  export = strict;
3168
3358
  }
@@ -3332,9 +3522,12 @@ declare module "node:readline/promises" {
3332
3522
  /* node:zlib — the one-shot zlib/raw/gzip codecs lower for string/Buffer
3333
3523
  * inputs with Node's default options; libz links only into zlib-using
3334
3524
  * binaries. Callback forms use the executable worker pool. Options stay
3335
- * declared so reached uses receive a named SC2020 refusal; Brotli,
3336
- * streaming, and Zstd remain outside the lowered surface. */
3525
+ * declared so reached uses receive a named SC2020 refusal. The Deflate,
3526
+ * Inflate, Gzip, Gunzip, DeflateRaw, InflateRaw and Unzip streams are
3527
+ * runtime Transform streams; Brotli and Zstd remain outside the lowered
3528
+ * surface. */
3337
3529
  declare module "zlib" {
3530
+ import { Transform } from "stream";
3338
3531
  export interface ZlibOptions {
3339
3532
  [option: string]: unknown;
3340
3533
  }
@@ -3391,6 +3584,340 @@ declare module "zlib" {
3391
3584
  export function crc32(data: string | Uint8Array, value?: number): number;
3392
3585
  export function brotliCompressSync(data: string | Uint8Array): Buffer;
3393
3586
  export function brotliDecompressSync(data: Uint8Array): Buffer;
3587
+ /* Brotli needs a codec the static runtime does not vendor: these are
3588
+ * declared so their uses receive the named refusal. */
3589
+ export function brotliCompress(data: string | Uint8Array, callback: ZlibCallback): void;
3590
+ export function brotliDecompress(data: Uint8Array, callback: ZlibCallback): void;
3591
+ export function createBrotliCompress(options?: ZlibOptions): Transform;
3592
+ export function createBrotliDecompress(options?: ZlibOptions): Transform;
3593
+ export class BrotliCompress extends Transform {
3594
+ constructor(options?: ZlibOptions);
3595
+ }
3596
+ export class BrotliDecompress extends Transform {
3597
+ constructor(options?: ZlibOptions);
3598
+ }
3599
+ /* The stream classes: runtime Transform streams over the zlib engine
3600
+ * (scr_zlib_stream.c). createGzip(options) and new Gzip(options) build
3601
+ * the same stream; options are validated at runtime with Node's rules. */
3602
+ class ZlibBase extends Transform {
3603
+ readonly bytesWritten: number;
3604
+ flush(kind?: number, callback?: () => void): void;
3605
+ flush(callback: () => void): void;
3606
+ params(level: number, strategy: number, callback?: () => void): void;
3607
+ close(callback?: () => void): void;
3608
+ reset(): void;
3609
+ }
3610
+ export class Deflate extends ZlibBase {
3611
+ constructor(options?: ZlibOptions);
3612
+ }
3613
+ export class Inflate extends ZlibBase {
3614
+ constructor(options?: ZlibOptions);
3615
+ }
3616
+ export class Gzip extends ZlibBase {
3617
+ constructor(options?: ZlibOptions);
3618
+ }
3619
+ export class Gunzip extends ZlibBase {
3620
+ constructor(options?: ZlibOptions);
3621
+ }
3622
+ export class DeflateRaw extends ZlibBase {
3623
+ constructor(options?: ZlibOptions);
3624
+ }
3625
+ export class InflateRaw extends ZlibBase {
3626
+ constructor(options?: ZlibOptions);
3627
+ }
3628
+ export class Unzip extends ZlibBase {
3629
+ constructor(options?: ZlibOptions);
3630
+ }
3631
+ export function createDeflate(options?: ZlibOptions): Deflate;
3632
+ export function createInflate(options?: ZlibOptions): Inflate;
3633
+ export function createGzip(options?: ZlibOptions): Gzip;
3634
+ export function createGunzip(options?: ZlibOptions): Gunzip;
3635
+ export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
3636
+ export function createInflateRaw(options?: ZlibOptions): InflateRaw;
3637
+ export function createUnzip(options?: ZlibOptions): Unzip;
3638
+ /* Node v24 zlib.constants, literal-typed (the CryptoConstants stance):
3639
+ * every access bakes as its literal; the object never materializes. The
3640
+ * members outside BROTLI_* are also module properties (zlib.Z_SYNC_FLUSH). */
3641
+ export interface ZlibConstants {
3642
+ readonly Z_NO_FLUSH: 0;
3643
+ readonly Z_PARTIAL_FLUSH: 1;
3644
+ readonly Z_SYNC_FLUSH: 2;
3645
+ readonly Z_FULL_FLUSH: 3;
3646
+ readonly Z_FINISH: 4;
3647
+ readonly Z_BLOCK: 5;
3648
+ readonly Z_OK: 0;
3649
+ readonly Z_STREAM_END: 1;
3650
+ readonly Z_NEED_DICT: 2;
3651
+ readonly Z_ERRNO: -1;
3652
+ readonly Z_STREAM_ERROR: -2;
3653
+ readonly Z_DATA_ERROR: -3;
3654
+ readonly Z_MEM_ERROR: -4;
3655
+ readonly Z_BUF_ERROR: -5;
3656
+ readonly Z_VERSION_ERROR: -6;
3657
+ readonly Z_NO_COMPRESSION: 0;
3658
+ readonly Z_BEST_SPEED: 1;
3659
+ readonly Z_BEST_COMPRESSION: 9;
3660
+ readonly Z_DEFAULT_COMPRESSION: -1;
3661
+ readonly Z_FILTERED: 1;
3662
+ readonly Z_HUFFMAN_ONLY: 2;
3663
+ readonly Z_RLE: 3;
3664
+ readonly Z_FIXED: 4;
3665
+ readonly Z_DEFAULT_STRATEGY: 0;
3666
+ readonly ZLIB_VERNUM: 4897;
3667
+ readonly DEFLATE: 1;
3668
+ readonly INFLATE: 2;
3669
+ readonly GZIP: 3;
3670
+ readonly GUNZIP: 4;
3671
+ readonly DEFLATERAW: 5;
3672
+ readonly INFLATERAW: 6;
3673
+ readonly UNZIP: 7;
3674
+ readonly BROTLI_DECODE: 8;
3675
+ readonly BROTLI_ENCODE: 9;
3676
+ readonly ZSTD_DECOMPRESS: 11;
3677
+ readonly ZSTD_COMPRESS: 10;
3678
+ readonly Z_MIN_WINDOWBITS: 8;
3679
+ readonly Z_MAX_WINDOWBITS: 15;
3680
+ readonly Z_DEFAULT_WINDOWBITS: 15;
3681
+ readonly Z_MIN_CHUNK: 64;
3682
+ readonly Z_MAX_CHUNK: number;
3683
+ readonly Z_DEFAULT_CHUNK: 16384;
3684
+ readonly Z_MIN_MEMLEVEL: 1;
3685
+ readonly Z_MAX_MEMLEVEL: 9;
3686
+ readonly Z_DEFAULT_MEMLEVEL: 8;
3687
+ readonly Z_MIN_LEVEL: -1;
3688
+ readonly Z_MAX_LEVEL: 9;
3689
+ readonly Z_DEFAULT_LEVEL: -1;
3690
+ readonly BROTLI_OPERATION_PROCESS: 0;
3691
+ readonly BROTLI_OPERATION_FLUSH: 1;
3692
+ readonly BROTLI_OPERATION_FINISH: 2;
3693
+ readonly BROTLI_OPERATION_EMIT_METADATA: 3;
3694
+ readonly BROTLI_PARAM_MODE: 0;
3695
+ readonly BROTLI_MODE_GENERIC: 0;
3696
+ readonly BROTLI_MODE_TEXT: 1;
3697
+ readonly BROTLI_MODE_FONT: 2;
3698
+ readonly BROTLI_DEFAULT_MODE: 0;
3699
+ readonly BROTLI_PARAM_QUALITY: 1;
3700
+ readonly BROTLI_MIN_QUALITY: 0;
3701
+ readonly BROTLI_MAX_QUALITY: 11;
3702
+ readonly BROTLI_DEFAULT_QUALITY: 11;
3703
+ readonly BROTLI_PARAM_LGWIN: 2;
3704
+ readonly BROTLI_MIN_WINDOW_BITS: 10;
3705
+ readonly BROTLI_MAX_WINDOW_BITS: 24;
3706
+ readonly BROTLI_LARGE_MAX_WINDOW_BITS: 30;
3707
+ readonly BROTLI_DEFAULT_WINDOW: 22;
3708
+ readonly BROTLI_PARAM_LGBLOCK: 3;
3709
+ readonly BROTLI_MIN_INPUT_BLOCK_BITS: 16;
3710
+ readonly BROTLI_MAX_INPUT_BLOCK_BITS: 24;
3711
+ readonly BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4;
3712
+ readonly BROTLI_PARAM_SIZE_HINT: 5;
3713
+ readonly BROTLI_PARAM_LARGE_WINDOW: 6;
3714
+ readonly BROTLI_PARAM_NPOSTFIX: 7;
3715
+ readonly BROTLI_PARAM_NDIRECT: 8;
3716
+ readonly BROTLI_DECODER_RESULT_ERROR: 0;
3717
+ readonly BROTLI_DECODER_RESULT_SUCCESS: 1;
3718
+ readonly BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2;
3719
+ readonly BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3;
3720
+ readonly BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0;
3721
+ readonly BROTLI_DECODER_PARAM_LARGE_WINDOW: 1;
3722
+ readonly BROTLI_DECODER_NO_ERROR: 0;
3723
+ readonly BROTLI_DECODER_SUCCESS: 1;
3724
+ readonly BROTLI_DECODER_NEEDS_MORE_INPUT: 2;
3725
+ readonly BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3;
3726
+ readonly BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1;
3727
+ readonly BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2;
3728
+ readonly BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3;
3729
+ readonly BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4;
3730
+ readonly BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5;
3731
+ readonly BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6;
3732
+ readonly BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7;
3733
+ readonly BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8;
3734
+ readonly BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9;
3735
+ readonly BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10;
3736
+ readonly BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11;
3737
+ readonly BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12;
3738
+ readonly BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13;
3739
+ readonly BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14;
3740
+ readonly BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15;
3741
+ readonly BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16;
3742
+ readonly BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19;
3743
+ readonly BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20;
3744
+ readonly BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21;
3745
+ readonly BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22;
3746
+ readonly BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25;
3747
+ readonly BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26;
3748
+ readonly BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27;
3749
+ readonly BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30;
3750
+ readonly BROTLI_DECODER_ERROR_UNREACHABLE: -31;
3751
+ readonly ZSTD_e_continue: 0;
3752
+ readonly ZSTD_e_flush: 1;
3753
+ readonly ZSTD_e_end: 2;
3754
+ readonly ZSTD_fast: 1;
3755
+ readonly ZSTD_dfast: 2;
3756
+ readonly ZSTD_greedy: 3;
3757
+ readonly ZSTD_lazy: 4;
3758
+ readonly ZSTD_lazy2: 5;
3759
+ readonly ZSTD_btlazy2: 6;
3760
+ readonly ZSTD_btopt: 7;
3761
+ readonly ZSTD_btultra: 8;
3762
+ readonly ZSTD_btultra2: 9;
3763
+ readonly ZSTD_c_compressionLevel: 100;
3764
+ readonly ZSTD_c_windowLog: 101;
3765
+ readonly ZSTD_c_hashLog: 102;
3766
+ readonly ZSTD_c_chainLog: 103;
3767
+ readonly ZSTD_c_searchLog: 104;
3768
+ readonly ZSTD_c_minMatch: 105;
3769
+ readonly ZSTD_c_targetLength: 106;
3770
+ readonly ZSTD_c_strategy: 107;
3771
+ readonly ZSTD_c_enableLongDistanceMatching: 160;
3772
+ readonly ZSTD_c_ldmHashLog: 161;
3773
+ readonly ZSTD_c_ldmMinMatch: 162;
3774
+ readonly ZSTD_c_ldmBucketSizeLog: 163;
3775
+ readonly ZSTD_c_ldmHashRateLog: 164;
3776
+ readonly ZSTD_c_contentSizeFlag: 200;
3777
+ readonly ZSTD_c_checksumFlag: 201;
3778
+ readonly ZSTD_c_dictIDFlag: 202;
3779
+ readonly ZSTD_c_nbWorkers: 400;
3780
+ readonly ZSTD_c_jobSize: 401;
3781
+ readonly ZSTD_c_overlapLog: 402;
3782
+ readonly ZSTD_d_windowLogMax: 100;
3783
+ readonly ZSTD_CLEVEL_DEFAULT: 3;
3784
+ readonly ZSTD_error_no_error: 0;
3785
+ readonly ZSTD_error_GENERIC: 1;
3786
+ readonly ZSTD_error_prefix_unknown: 10;
3787
+ readonly ZSTD_error_version_unsupported: 12;
3788
+ readonly ZSTD_error_frameParameter_unsupported: 14;
3789
+ readonly ZSTD_error_frameParameter_windowTooLarge: 16;
3790
+ readonly ZSTD_error_corruption_detected: 20;
3791
+ readonly ZSTD_error_checksum_wrong: 22;
3792
+ readonly ZSTD_error_literals_headerWrong: 24;
3793
+ readonly ZSTD_error_dictionary_corrupted: 30;
3794
+ readonly ZSTD_error_dictionary_wrong: 32;
3795
+ readonly ZSTD_error_dictionaryCreation_failed: 34;
3796
+ readonly ZSTD_error_parameter_unsupported: 40;
3797
+ readonly ZSTD_error_parameter_combination_unsupported: 41;
3798
+ readonly ZSTD_error_parameter_outOfBound: 42;
3799
+ readonly ZSTD_error_tableLog_tooLarge: 44;
3800
+ readonly ZSTD_error_maxSymbolValue_tooLarge: 46;
3801
+ readonly ZSTD_error_maxSymbolValue_tooSmall: 48;
3802
+ readonly ZSTD_error_stabilityCondition_notRespected: 50;
3803
+ readonly ZSTD_error_stage_wrong: 60;
3804
+ readonly ZSTD_error_init_missing: 62;
3805
+ readonly ZSTD_error_memory_allocation: 64;
3806
+ readonly ZSTD_error_workSpace_tooSmall: 66;
3807
+ readonly ZSTD_error_dstSize_tooSmall: 70;
3808
+ readonly ZSTD_error_srcSize_wrong: 72;
3809
+ readonly ZSTD_error_dstBuffer_null: 74;
3810
+ readonly ZSTD_error_noForwardProgress_destFull: 80;
3811
+ readonly ZSTD_error_noForwardProgress_inputEmpty: 82;
3812
+ }
3813
+ export const constants: ZlibConstants;
3814
+ export const Z_NO_FLUSH: 0;
3815
+ export const Z_PARTIAL_FLUSH: 1;
3816
+ export const Z_SYNC_FLUSH: 2;
3817
+ export const Z_FULL_FLUSH: 3;
3818
+ export const Z_FINISH: 4;
3819
+ export const Z_BLOCK: 5;
3820
+ export const Z_OK: 0;
3821
+ export const Z_STREAM_END: 1;
3822
+ export const Z_NEED_DICT: 2;
3823
+ export const Z_ERRNO: -1;
3824
+ export const Z_STREAM_ERROR: -2;
3825
+ export const Z_DATA_ERROR: -3;
3826
+ export const Z_MEM_ERROR: -4;
3827
+ export const Z_BUF_ERROR: -5;
3828
+ export const Z_VERSION_ERROR: -6;
3829
+ export const Z_NO_COMPRESSION: 0;
3830
+ export const Z_BEST_SPEED: 1;
3831
+ export const Z_BEST_COMPRESSION: 9;
3832
+ export const Z_DEFAULT_COMPRESSION: -1;
3833
+ export const Z_FILTERED: 1;
3834
+ export const Z_HUFFMAN_ONLY: 2;
3835
+ export const Z_RLE: 3;
3836
+ export const Z_FIXED: 4;
3837
+ export const Z_DEFAULT_STRATEGY: 0;
3838
+ export const ZLIB_VERNUM: 4897;
3839
+ export const DEFLATE: 1;
3840
+ export const INFLATE: 2;
3841
+ export const GZIP: 3;
3842
+ export const GUNZIP: 4;
3843
+ export const DEFLATERAW: 5;
3844
+ export const INFLATERAW: 6;
3845
+ export const UNZIP: 7;
3846
+ export const ZSTD_DECOMPRESS: 11;
3847
+ export const ZSTD_COMPRESS: 10;
3848
+ export const Z_MIN_WINDOWBITS: 8;
3849
+ export const Z_MAX_WINDOWBITS: 15;
3850
+ export const Z_DEFAULT_WINDOWBITS: 15;
3851
+ export const Z_MIN_CHUNK: 64;
3852
+ export const Z_MAX_CHUNK: number;
3853
+ export const Z_DEFAULT_CHUNK: 16384;
3854
+ export const Z_MIN_MEMLEVEL: 1;
3855
+ export const Z_MAX_MEMLEVEL: 9;
3856
+ export const Z_DEFAULT_MEMLEVEL: 8;
3857
+ export const Z_MIN_LEVEL: -1;
3858
+ export const Z_MAX_LEVEL: 9;
3859
+ export const Z_DEFAULT_LEVEL: -1;
3860
+ export const ZSTD_e_continue: 0;
3861
+ export const ZSTD_e_flush: 1;
3862
+ export const ZSTD_e_end: 2;
3863
+ export const ZSTD_fast: 1;
3864
+ export const ZSTD_dfast: 2;
3865
+ export const ZSTD_greedy: 3;
3866
+ export const ZSTD_lazy: 4;
3867
+ export const ZSTD_lazy2: 5;
3868
+ export const ZSTD_btlazy2: 6;
3869
+ export const ZSTD_btopt: 7;
3870
+ export const ZSTD_btultra: 8;
3871
+ export const ZSTD_btultra2: 9;
3872
+ export const ZSTD_c_compressionLevel: 100;
3873
+ export const ZSTD_c_windowLog: 101;
3874
+ export const ZSTD_c_hashLog: 102;
3875
+ export const ZSTD_c_chainLog: 103;
3876
+ export const ZSTD_c_searchLog: 104;
3877
+ export const ZSTD_c_minMatch: 105;
3878
+ export const ZSTD_c_targetLength: 106;
3879
+ export const ZSTD_c_strategy: 107;
3880
+ export const ZSTD_c_enableLongDistanceMatching: 160;
3881
+ export const ZSTD_c_ldmHashLog: 161;
3882
+ export const ZSTD_c_ldmMinMatch: 162;
3883
+ export const ZSTD_c_ldmBucketSizeLog: 163;
3884
+ export const ZSTD_c_ldmHashRateLog: 164;
3885
+ export const ZSTD_c_contentSizeFlag: 200;
3886
+ export const ZSTD_c_checksumFlag: 201;
3887
+ export const ZSTD_c_dictIDFlag: 202;
3888
+ export const ZSTD_c_nbWorkers: 400;
3889
+ export const ZSTD_c_jobSize: 401;
3890
+ export const ZSTD_c_overlapLog: 402;
3891
+ export const ZSTD_d_windowLogMax: 100;
3892
+ export const ZSTD_CLEVEL_DEFAULT: 3;
3893
+ export const ZSTD_error_no_error: 0;
3894
+ export const ZSTD_error_GENERIC: 1;
3895
+ export const ZSTD_error_prefix_unknown: 10;
3896
+ export const ZSTD_error_version_unsupported: 12;
3897
+ export const ZSTD_error_frameParameter_unsupported: 14;
3898
+ export const ZSTD_error_frameParameter_windowTooLarge: 16;
3899
+ export const ZSTD_error_corruption_detected: 20;
3900
+ export const ZSTD_error_checksum_wrong: 22;
3901
+ export const ZSTD_error_literals_headerWrong: 24;
3902
+ export const ZSTD_error_dictionary_corrupted: 30;
3903
+ export const ZSTD_error_dictionary_wrong: 32;
3904
+ export const ZSTD_error_dictionaryCreation_failed: 34;
3905
+ export const ZSTD_error_parameter_unsupported: 40;
3906
+ export const ZSTD_error_parameter_combination_unsupported: 41;
3907
+ export const ZSTD_error_parameter_outOfBound: 42;
3908
+ export const ZSTD_error_tableLog_tooLarge: 44;
3909
+ export const ZSTD_error_maxSymbolValue_tooLarge: 46;
3910
+ export const ZSTD_error_maxSymbolValue_tooSmall: 48;
3911
+ export const ZSTD_error_stabilityCondition_notRespected: 50;
3912
+ export const ZSTD_error_stage_wrong: 60;
3913
+ export const ZSTD_error_init_missing: 62;
3914
+ export const ZSTD_error_memory_allocation: 64;
3915
+ export const ZSTD_error_workSpace_tooSmall: 66;
3916
+ export const ZSTD_error_dstSize_tooSmall: 70;
3917
+ export const ZSTD_error_srcSize_wrong: 72;
3918
+ export const ZSTD_error_dstBuffer_null: 74;
3919
+ export const ZSTD_error_noForwardProgress_destFull: 80;
3920
+ export const ZSTD_error_noForwardProgress_inputEmpty: 82;
3394
3921
  }
3395
3922
  declare module "node:zlib" {
3396
3923
  export * from "zlib";
@@ -3415,6 +3942,17 @@ declare module "net" {
3415
3942
  ref(): void;
3416
3943
  unref(): void;
3417
3944
  readonly remoteAddress: string | undefined;
3945
+ /* The peer's fields are cached at first read, like remoteAddress; the
3946
+ * local ones are undefined while connecting and after close. */
3947
+ readonly remotePort: number | undefined;
3948
+ readonly remoteFamily: string | undefined;
3949
+ readonly localAddress: string | undefined;
3950
+ readonly localPort: number | undefined;
3951
+ readonly localFamily: string | undefined;
3952
+ readonly bytesRead: number;
3953
+ readonly connecting: boolean;
3954
+ readonly pending: boolean;
3955
+ readonly readyState: "opening" | "open" | "readOnly" | "writeOnly" | "closed";
3418
3956
  /* true once the fd is gone (destroy() or full close) — Node's flag. */
3419
3957
  readonly destroyed: boolean;
3420
3958
  /* the write half is open: no end() yet, no FIN sent, fd alive. */
@@ -3424,8 +3962,11 @@ declare module "net" {
3424
3962
  /* every byte the write paths accepted (buffered included — Node
3425
3963
  * counts those too; plaintext on TLS sockets). */
3426
3964
  readonly bytesWritten: number;
3427
- write(data: string | Uint8Array): void;
3428
- end(data?: string | Uint8Array): void;
3965
+ /* write's callback runs once the data is flushed, with null; end's
3966
+ * once the socket finishes. */
3967
+ write(data: string | Uint8Array, callback?: (err?: Error | null) => void): void;
3968
+ end(callback?: () => void): void;
3969
+ end(data: string | Uint8Array, callback?: () => void): void;
3429
3970
  destroy(): void;
3430
3971
  /* Flow control: pause holds reads off (kernel/TCP backpressure is
3431
3972
  * the buffer); resume flows — and discards without listeners, so
@@ -3434,6 +3975,8 @@ declare module "net" {
3434
3975
  resume(): Socket;
3435
3976
  /* TCP_NODELAY on the live fd; missing means true. Chains. */
3436
3977
  setNoDelay(noDelay?: boolean): Socket;
3978
+ /* SO_KEEPALIVE with the initial delay in ms. Chains. */
3979
+ setKeepAlive(enable?: boolean, initialDelay?: number): Socket;
3437
3980
  /* end() now, destroy once the FIN actually flushed. */
3438
3981
  destroySoon(): void;
3439
3982
  /* setEncoding('utf8'): 'data' delivers strings — the IncomingMessage
@@ -3444,7 +3987,8 @@ declare module "net" {
3444
3987
  pipe(
3445
3988
  destination: Socket | import("http").ServerResponse | import("http2").Http2ServerResponse,
3446
3989
  ): void;
3447
- setTimeout(ms: number): void;
3990
+ /* The callback is a once('timeout') listener (removed again by 0). */
3991
+ setTimeout(ms: number, callback?: () => void): void;
3448
3992
  /* The paused-mode demux surface: once('readable') + read(1) +
3449
3993
  * unshift — read answers exactly n buffered bytes or null. */
3450
3994
  read(size?: number): Buffer | null;
@@ -3455,25 +3999,34 @@ declare module "net" {
3455
3999
  * registration never fires — Node's exact split. 'session' fires
3456
4000
  * once with the serialized session (the received-ticket event). */
3457
4001
  on(event: "data", listener: (chunk: Buffer) => void): void;
4002
+ /* After setEncoding the chunk is a string. */
4003
+ on(event: "data", listener: (chunk: string) => void): void;
3458
4004
  on(
3459
- event: "end" | "close" | "connect" | "timeout" | "readable" | "finish" | "secureConnect",
4005
+ event: "end" | "connect" | "ready" | "timeout" | "readable" | "finish" | "secureConnect",
3460
4006
  listener: () => void,
3461
4007
  ): void;
4008
+ on(event: "close", listener: (hadError: boolean) => void): void;
3462
4009
  on(event: "error", listener: (err: Error) => void): void;
3463
4010
  on(event: "session", listener: (session: Buffer) => void): void;
3464
4011
  /* addListener IS on (Node aliases them) — the suite spells both. */
3465
4012
  addListener(event: "data", listener: (chunk: Buffer) => void): void;
4013
+ /* After setEncoding the chunk is a string. */
4014
+ addListener(event: "data", listener: (chunk: string) => void): void;
3466
4015
  addListener(
3467
- event: "end" | "close" | "connect" | "timeout" | "readable" | "finish" | "secureConnect",
4016
+ event: "end" | "connect" | "ready" | "timeout" | "readable" | "finish" | "secureConnect",
3468
4017
  listener: () => void,
3469
4018
  ): void;
4019
+ addListener(event: "close", listener: (hadError: boolean) => void): void;
3470
4020
  addListener(event: "error", listener: (err: Error) => void): void;
3471
4021
  addListener(event: "session", listener: (session: Buffer) => void): void;
3472
4022
  once(event: "data", listener: (chunk: Buffer) => void): void;
4023
+ /* After setEncoding the chunk is a string. */
4024
+ once(event: "data", listener: (chunk: string) => void): void;
3473
4025
  once(
3474
- event: "end" | "close" | "connect" | "timeout" | "readable" | "finish" | "secureConnect",
4026
+ event: "end" | "connect" | "ready" | "timeout" | "readable" | "finish" | "secureConnect",
3475
4027
  listener: () => void,
3476
4028
  ): void;
4029
+ once(event: "close", listener: (hadError: boolean) => void): void;
3477
4030
  once(event: "error", listener: (err: Error) => void): void;
3478
4031
  once(event: "session", listener: (session: Buffer) => void): void;
3479
4032
  }
@@ -3482,6 +4035,11 @@ declare module "net" {
3482
4035
  ref(): void;
3483
4036
  unref(): void;
3484
4037
  readonly listening: boolean;
4038
+ /* Connections past this many are closed with a 'drop' event;
4039
+ * undefined (the default) or null lifts the cap. */
4040
+ maxConnections: number | undefined;
4041
+ /* cb(null, count) on the next tick. */
4042
+ getConnections(callback: (error: Error | null, count: number) => void): Server;
3485
4043
  /* Node answers the server itself (`return this` chaining). */
3486
4044
  listen(port: number, callback?: () => void): Server;
3487
4045
  /* The positional bind address (the options form's host in argument
@@ -3503,6 +4061,7 @@ declare module "net" {
3503
4061
  emit(event: "connection", socket: Socket): boolean;
3504
4062
  on(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
3505
4063
  on(event: "close" | "listening", listener: () => void): void;
4064
+ on(event: "drop", listener: (data?: DropArgument) => void): void;
3506
4065
  on(event: "timeout", listener: (socket: Socket) => void): void;
3507
4066
  on(event: "error", listener: (err: Error) => void): void;
3508
4067
  /* The WebSocket handover: fires INSTEAD of 'request' for
@@ -3520,6 +4079,7 @@ declare module "net" {
3520
4079
  /* addListener IS on (Node aliases them) — the suite spells both. */
3521
4080
  addListener(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
3522
4081
  addListener(event: "close" | "listening", listener: () => void): void;
4082
+ addListener(event: "drop", listener: (data?: DropArgument) => void): void;
3523
4083
  addListener(event: "timeout", listener: (socket: Socket) => void): void;
3524
4084
  addListener(event: "error", listener: (err: Error) => void): void;
3525
4085
  addListener(
@@ -3532,6 +4092,7 @@ declare module "net" {
3532
4092
  ): void;
3533
4093
  once(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
3534
4094
  once(event: "close" | "listening", listener: () => void): void;
4095
+ once(event: "drop", listener: (data?: DropArgument) => void): void;
3535
4096
  once(event: "timeout", listener: (socket: Socket) => void): void;
3536
4097
  once(event: "error", listener: (err: Error) => void): void;
3537
4098
  once(
@@ -3543,6 +4104,20 @@ declare module "net" {
3543
4104
  listener: (req: import("http").IncomingMessage, res: import("http").ServerResponse) => void,
3544
4105
  ): void;
3545
4106
  }
4107
+ /* The 'drop' payload: the turned-away connection's addresses. */
4108
+ export interface DropArgument {
4109
+ localAddress?: string;
4110
+ localPort?: number;
4111
+ localFamily?: string;
4112
+ remoteAddress?: string;
4113
+ remotePort?: number;
4114
+ remoteFamily?: string;
4115
+ }
4116
+ export type AddressInfo = import("node:dgram").AddressInfo;
4117
+ /* Node's IPv4Reg and IPv6Reg tests: 4, 6, or 0 for isIP. */
4118
+ export function isIP(input: string): number;
4119
+ export function isIPv4(input: string): boolean;
4120
+ export function isIPv6(input: string): boolean;
3546
4121
  /* The Socket VALUE — the `x instanceof net.Socket` narrowing target
3547
4122
  * (the h2 compat 'connect' listener's test). Constructing bare sockets
3548
4123
  * has no lowering; the construct signature exists for instanceof. */
@@ -3708,8 +4283,11 @@ declare module "http" {
3708
4283
  /* Node's writable head properties: the implicit head reads them. */
3709
4284
  statusCode: number;
3710
4285
  statusMessage: string | undefined;
3711
- setHeader(name: string, value: string | number): void;
3712
- getHeader(name: string): string | undefined;
4286
+ /* The value keeps its type: getHeader answers the number, string or
4287
+ * array that was set. */
4288
+ setHeader(name: string, value: number | string | readonly string[]): void;
4289
+ appendHeader(name: string, value: string | readonly string[]): void;
4290
+ getHeader(name: string): number | string | string[] | undefined;
3713
4291
  getHeaderNames(): string[];
3714
4292
  getRawHeaderNames(): string[];
3715
4293
  getHeaders(): OutgoingHttpHeaders;
@@ -4771,14 +5349,55 @@ declare module "node:dgram" {
4771
5349
  * ENOTFOUND <hostname>") as the callback's Error argument, with "" for
4772
5350
  * the address where Node passes undefined. */
4773
5351
  declare module "dns" {
5352
+ export interface LookupAddress {
5353
+ address: string;
5354
+ family: number;
5355
+ }
5356
+ export interface LookupOptions {
5357
+ family?: number | "IPv4" | "IPv6";
5358
+ hints?: number;
5359
+ all?: boolean;
5360
+ order?: "ipv4first" | "ipv6first" | "verbatim";
5361
+ verbatim?: boolean;
5362
+ }
5363
+ export interface LookupOneOptions extends LookupOptions {
5364
+ all?: false;
5365
+ }
5366
+ export interface LookupAllOptions extends LookupOptions {
5367
+ all: true;
5368
+ }
5369
+ /* The callback comes with the other lookup deliveries (literal
5370
+ * addresses on the next tick); the options follow lib/dns.js. */
5371
+ export function lookup(
5372
+ hostname: string,
5373
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
5374
+ ): void;
5375
+ export function lookup(
5376
+ hostname: string,
5377
+ family: number,
5378
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
5379
+ ): void;
4774
5380
  export function lookup(
4775
5381
  hostname: string,
4776
- /* The options-record stance (see http.RequestOptions): family is the
4777
- * lowered option ({ family: 4 }); hints/all/order/verbatim fence by
4778
- * name; undocumented keys drop like Node. */
4779
- options: { family: number; [option: string]: unknown },
4780
- callback: (err: Error | null, address: string, family: number) => void,
5382
+ options: LookupOneOptions,
5383
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
4781
5384
  ): void;
5385
+ export function lookup(
5386
+ hostname: string,
5387
+ options: LookupAllOptions,
5388
+ callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
5389
+ ): void;
5390
+ /* getnameinfo with NI_NAMEREQD: the host's name and the port's service
5391
+ * name (the number when it has none). */
5392
+ export function lookupService(
5393
+ address: string,
5394
+ port: number,
5395
+ callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
5396
+ ): void;
5397
+ /* The nameservers /etc/resolv.conf lists. */
5398
+ export function getServers(): string[];
5399
+ export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
5400
+ export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
4782
5401
  }
4783
5402
  declare module "node:dns" {
4784
5403
  export * from "dns";
@@ -5101,6 +5720,14 @@ declare module "stream" {
5101
5720
  signal?: AbortSignal;
5102
5721
  }
5103
5722
 
5723
+ /* The operators' options: concurrency and highWaterMark bound map's
5724
+ * in-flight callbacks and queued results. */
5725
+ interface ArrayOptions {
5726
+ concurrency?: number;
5727
+ highWaterMark?: number;
5728
+ signal?: AbortSignal;
5729
+ }
5730
+
5104
5731
  class Readable extends EventEmitter {
5105
5732
  constructor(opts?: ReadableOptions);
5106
5733
  /* The underscore-method surface (@types/node declares these on the
@@ -5131,6 +5758,51 @@ declare module "stream" {
5131
5758
  readonly destroyed: boolean;
5132
5759
  readonly errored: Error | null;
5133
5760
  static from(iterable: unknown, options?: ReadableOptions): Readable;
5761
+ /* The Readable operators: chunks are strings or Buffers, map and
5762
+ * flatMap callbacks return strings or Buffers (flatMap: arrays of
5763
+ * them, or strings), and callbacks that declare the options argument
5764
+ * are refused. */
5765
+ map(
5766
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any,
5767
+ options?: ArrayOptions,
5768
+ ): Readable;
5769
+ filter(
5770
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
5771
+ options?: ArrayOptions,
5772
+ ): Readable;
5773
+ forEach(
5774
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
5775
+ options?: ArrayOptions,
5776
+ ): Promise<void>;
5777
+ toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
5778
+ some(
5779
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
5780
+ options?: ArrayOptions,
5781
+ ): Promise<boolean>;
5782
+ find(
5783
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
5784
+ options?: ArrayOptions,
5785
+ ): Promise<any>;
5786
+ every(
5787
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
5788
+ options?: ArrayOptions,
5789
+ ): Promise<boolean>;
5790
+ flatMap(
5791
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any,
5792
+ options?: ArrayOptions,
5793
+ ): Readable;
5794
+ drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
5795
+ take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
5796
+ reduce<T = any>(
5797
+ fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
5798
+ initial?: undefined,
5799
+ options?: Pick<ArrayOptions, "signal">,
5800
+ ): Promise<T>;
5801
+ reduce<T = any>(
5802
+ fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
5803
+ initial: T,
5804
+ options?: Pick<ArrayOptions, "signal">,
5805
+ ): Promise<T>;
5134
5806
  on(event: "data", listener: (chunk: any) => void): this;
5135
5807
  on(event: "end" | "close" | "readable" | "pause" | "resume", listener: () => void): this;
5136
5808
  on(event: "error", listener: (err: Error) => void): this;
@@ -5347,6 +6019,9 @@ declare module "stream" {
5347
6019
  function addAbortSignal<T extends Readable | Writable>(signal: AbortSignal, stream: T): T;
5348
6020
  /* Declared so requires typecheck; each fences at its use site. */
5349
6021
  function pipeline(...streams: unknown[]): unknown;
6022
+ /* compose(...streams): a Duplex that writes to the first stream and
6023
+ * reads from the last, with the streams running as a pipeline. */
6024
+ function compose(...streams: Array<Readable | Writable>): Duplex;
5350
6025
  /* finished's options: readable/writable choose which ends count,
5351
6026
  * error: false ignores 'error' events, signal aborts the wait. */
5352
6027
  interface FinishedOptions {
@@ -5364,8 +6039,16 @@ declare module "stream" {
5364
6039
  /* Folds to the TARGET platform's default at compile time (win32 16384,
5365
6040
  * else 65536 — Node's own state.js split); literal argument only. */
5366
6041
  function getDefaultHighWaterMark(objectMode: boolean): number;
6042
+ /* The promise pipeline's result: a last stage that is an async
6043
+ * function resolves the promise with its value. */
6044
+ type PipelinePromise<T extends unknown[]> = T extends [
6045
+ ...unknown[],
6046
+ (...args: any[]) => Promise<infer P>,
6047
+ ]
6048
+ ? Promise<P>
6049
+ : Promise<void>;
5367
6050
  namespace promises {
5368
- function pipeline(...streams: unknown[]): Promise<void>;
6051
+ function pipeline<T extends unknown[]>(...streams: T): PipelinePromise<T>;
5369
6052
  function finished(
5370
6053
  stream: unknown,
5371
6054
  options?: FinishedOptions & { cleanup?: boolean },
@@ -5382,6 +6065,7 @@ declare module "stream" {
5382
6065
  Stream,
5383
6066
  addAbortSignal,
5384
6067
  pipeline,
6068
+ compose,
5385
6069
  finished,
5386
6070
  getDefaultHighWaterMark,
5387
6071
  promises,
@@ -5404,8 +6088,11 @@ declare module "stream/promises" {
5404
6088
  * ERR_STREAM_PREMATURE_CLOSE on an early close). Stream arguments are
5405
6089
  * the lowered surface — iterables/generators/functions fence per site.
5406
6090
  * pipeline's trailing { signal, end } object and finished's options
5407
- * (readable, writable, error, cleanup, signal) are supported. */
5408
- function pipeline(...streams: unknown[]): Promise<void>;
6091
+ * (readable, writable, error, cleanup, signal) are supported. A last
6092
+ * stage that is an async function resolves the promise with its value. */
6093
+ function pipeline<T extends unknown[]>(
6094
+ ...streams: T
6095
+ ): T extends [...unknown[], (...args: any[]) => Promise<infer P>] ? Promise<P> : Promise<void>;
5409
6096
  function finished(
5410
6097
  stream: unknown,
5411
6098
  options?: {