@scriptc/compiler 0.1.3 → 0.1.5

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 (217) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +275 -62
  2. package/dist/backend/c/async.d.ts +25 -0
  3. package/dist/backend/c/async.js +167 -0
  4. package/dist/backend/c/async.js.map +1 -1
  5. package/dist/backend/c/c-emitter.d.ts +15 -1
  6. package/dist/backend/c/c-emitter.js +36 -11
  7. package/dist/backend/c/c-emitter.js.map +1 -1
  8. package/dist/backend/c/exprs.d.ts +2 -2
  9. package/dist/backend/c/exprs.js +556 -71
  10. package/dist/backend/c/exprs.js.map +1 -1
  11. package/dist/backend/c/stmts.js +5 -3
  12. package/dist/backend/c/stmts.js.map +1 -1
  13. package/dist/backend/c/types.d.ts +2 -3
  14. package/dist/backend/c/types.js +10 -1
  15. package/dist/backend/c/types.js.map +1 -1
  16. package/dist/backend/c/walkers.js +1 -1
  17. package/dist/backend/c/walkers.js.map +1 -1
  18. package/dist/backend/link-plan.d.ts +3 -1
  19. package/dist/backend/link-plan.js +3 -1
  20. package/dist/backend/link-plan.js.map +1 -1
  21. package/dist/backend/llvm/dyn.js +1 -1
  22. package/dist/backend/llvm/dyn.js.map +1 -1
  23. package/dist/backend/llvm/emitter.js +42 -12
  24. package/dist/backend/llvm/emitter.js.map +1 -1
  25. package/dist/backend/llvm/expr-bytes.d.ts +1 -2
  26. package/dist/backend/llvm/expr-bytes.js +28 -23
  27. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  28. package/dist/backend/llvm/expr-callbacks.d.ts +9 -0
  29. package/dist/backend/llvm/expr-callbacks.js +125 -0
  30. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  31. package/dist/backend/llvm/expr-containers.d.ts +1 -0
  32. package/dist/backend/llvm/expr-containers.js +32 -4
  33. package/dist/backend/llvm/expr-containers.js.map +1 -1
  34. package/dist/backend/llvm/expr-context.d.ts +19 -3
  35. package/dist/backend/llvm/expr-dispatch.js +1 -0
  36. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  37. package/dist/backend/llvm/expr-primitives.d.ts +1 -1
  38. package/dist/backend/llvm/expr-primitives.js +49 -13
  39. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  40. package/dist/backend/llvm/expr-primitives.test.d.ts +1 -0
  41. package/dist/backend/llvm/expr-primitives.test.js +38 -0
  42. package/dist/backend/llvm/expr-primitives.test.js.map +1 -0
  43. package/dist/backend/llvm/expr-stream-callbacks.d.ts +3 -0
  44. package/dist/backend/llvm/expr-stream-callbacks.js +69 -0
  45. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  46. package/dist/backend/llvm/lib-filesystem.js +80 -10
  47. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  48. package/dist/backend/llvm/lib-network.js +69 -10
  49. package/dist/backend/llvm/lib-network.js.map +1 -1
  50. package/dist/backend/llvm/lib-process.js +156 -6
  51. package/dist/backend/llvm/lib-process.js.map +1 -1
  52. package/dist/backend/llvm/lib-shared.js +100 -0
  53. package/dist/backend/llvm/lib-shared.js.map +1 -1
  54. package/dist/backend/llvm/lib-stream.js +23 -0
  55. package/dist/backend/llvm/lib-stream.js.map +1 -1
  56. package/dist/backend/native-toolchain.d.ts +5 -0
  57. package/dist/backend/native-toolchain.js +4 -1
  58. package/dist/backend/native-toolchain.js.map +1 -1
  59. package/dist/backend/runtime-pack.test.js +28 -10
  60. package/dist/backend/runtime-pack.test.js.map +1 -1
  61. package/dist/backend/targets.d.ts +7 -0
  62. package/dist/backend/targets.js +26 -0
  63. package/dist/backend/targets.js.map +1 -1
  64. package/dist/backend/targets.test.js +8 -1
  65. package/dist/backend/targets.test.js.map +1 -1
  66. package/dist/coverage/surface-manifest.js +14 -4
  67. package/dist/coverage/surface-manifest.js.map +1 -1
  68. package/dist/diagnostics/diagnostic.js +1 -1
  69. package/dist/diagnostics/diagnostic.js.map +1 -1
  70. package/dist/executable/executable-cache.d.ts +4 -0
  71. package/dist/executable/executable-cache.js +6 -1
  72. package/dist/executable/executable-cache.js.map +1 -1
  73. package/dist/executable/executable-cache.test.js +3 -3
  74. package/dist/executable/executable-cache.test.js.map +1 -1
  75. package/dist/frontend/fork-target.d.ts +17 -0
  76. package/dist/frontend/fork-target.js +256 -0
  77. package/dist/frontend/fork-target.js.map +1 -0
  78. package/dist/frontend/lowering/abstract-equality.d.ts +6 -0
  79. package/dist/frontend/lowering/abstract-equality.js +250 -0
  80. package/dist/frontend/lowering/abstract-equality.js.map +1 -0
  81. package/dist/frontend/lowering/containers/bytes.d.ts +1 -1
  82. package/dist/frontend/lowering/containers/bytes.js +6 -5
  83. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  84. package/dist/frontend/lowering/containers/string-and-regexp.d.ts +7 -6
  85. package/dist/frontend/lowering/containers/string-and-regexp.js +237 -28
  86. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  87. package/dist/frontend/lowering/expressions/object-literals.js +8 -0
  88. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  89. package/dist/frontend/lowering/lower-assert.js +71 -2
  90. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  91. package/dist/frontend/lowering/lower-builtins.d.ts +54 -28
  92. package/dist/frontend/lowering/lower-builtins.js +957 -116
  93. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  94. package/dist/frontend/lowering/lower-calls.d.ts +32 -23
  95. package/dist/frontend/lowering/lower-calls.js +835 -206
  96. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  97. package/dist/frontend/lowering/lower-classes.js +41 -10
  98. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  99. package/dist/frontend/lowering/lower-containers.d.ts +7 -9
  100. package/dist/frontend/lowering/lower-containers.js +293 -51
  101. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  102. package/dist/frontend/lowering/lower-event-emitter.js +212 -21
  103. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  104. package/dist/frontend/lowering/lower-exprs.d.ts +12 -0
  105. package/dist/frontend/lowering/lower-exprs.js +263 -93
  106. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  107. package/dist/frontend/lowering/lower-inspect.d.ts +4 -0
  108. package/dist/frontend/lowering/lower-inspect.js +1 -1
  109. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  110. package/dist/frontend/lowering/lower-island.d.ts +6 -3
  111. package/dist/frontend/lowering/lower-island.js +182 -12
  112. package/dist/frontend/lowering/lower-island.js.map +1 -1
  113. package/dist/frontend/lowering/lower-modules.d.ts +6 -0
  114. package/dist/frontend/lowering/lower-modules.js +184 -38
  115. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  116. package/dist/frontend/lowering/lower-namespaces.js +7 -0
  117. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  118. package/dist/frontend/lowering/lower-server.d.ts +3 -5
  119. package/dist/frontend/lowering/lower-server.js +413 -54
  120. package/dist/frontend/lowering/lower-server.js.map +1 -1
  121. package/dist/frontend/lowering/lower-stmts.js +122 -19
  122. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  123. package/dist/frontend/lowering/lower-stream.d.ts +3 -0
  124. package/dist/frontend/lowering/lower-stream.js +7 -0
  125. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  126. package/dist/frontend/lowering/lowerer.d.ts +86 -9
  127. package/dist/frontend/lowering/lowerer.js +449 -74
  128. package/dist/frontend/lowering/lowerer.js.map +1 -1
  129. package/dist/frontend/lowering/optional-arguments.d.ts +9 -1
  130. package/dist/frontend/lowering/optional-arguments.js +67 -1
  131. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  132. package/dist/frontend/lowering/pairs-snapshot.d.ts +3 -1
  133. package/dist/frontend/lowering/pairs-snapshot.js +12 -4
  134. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  135. package/dist/frontend/lowering/surfaces.d.ts +34 -14
  136. package/dist/frontend/lowering/surfaces.js +177 -104
  137. package/dist/frontend/lowering/surfaces.js.map +1 -1
  138. package/dist/frontend/npm-static-declarations.d.ts +4 -0
  139. package/dist/frontend/npm-static-declarations.js +56 -0
  140. package/dist/frontend/npm-static-declarations.js.map +1 -1
  141. package/dist/frontend/npm-static-declarations.test.js +23 -2
  142. package/dist/frontend/npm-static-declarations.test.js.map +1 -1
  143. package/dist/frontend/npm-static-prune.d.ts +6 -0
  144. package/dist/frontend/npm-static-prune.js +203 -0
  145. package/dist/frontend/npm-static-prune.js.map +1 -0
  146. package/dist/frontend/npm-static-prune.test.d.ts +1 -0
  147. package/dist/frontend/npm-static-prune.test.js +48 -0
  148. package/dist/frontend/npm-static-prune.test.js.map +1 -0
  149. package/dist/frontend/npm-static.js +6 -5
  150. package/dist/frontend/npm-static.js.map +1 -1
  151. package/dist/frontend/npm.d.ts +15 -3
  152. package/dist/frontend/npm.js +87 -14
  153. package/dist/frontend/npm.js.map +1 -1
  154. package/dist/frontend/npm.test.js +76 -9
  155. package/dist/frontend/npm.test.js.map +1 -1
  156. package/dist/frontend/program.js +107 -14
  157. package/dist/frontend/program.js.map +1 -1
  158. package/dist/frontend/provenance.js +8 -3
  159. package/dist/frontend/provenance.js.map +1 -1
  160. package/dist/frontend/resolve.d.ts +6 -0
  161. package/dist/frontend/resolve.js +7 -4
  162. package/dist/frontend/resolve.js.map +1 -1
  163. package/dist/frontend/type-mapper.d.ts +5 -0
  164. package/dist/frontend/type-mapper.js +80 -29
  165. package/dist/frontend/type-mapper.js.map +1 -1
  166. package/dist/index.d.ts +8 -3
  167. package/dist/index.js +34 -41
  168. package/dist/index.js.map +1 -1
  169. package/dist/ir/analysis.d.ts +5 -3
  170. package/dist/ir/analysis.js +25 -11
  171. package/dist/ir/analysis.js.map +1 -1
  172. package/dist/ir/analysis.test.js +50 -2
  173. package/dist/ir/analysis.test.js.map +1 -1
  174. package/dist/ir/constant-tables.d.ts +17 -0
  175. package/dist/ir/constant-tables.js +99 -0
  176. package/dist/ir/constant-tables.js.map +1 -0
  177. package/dist/ir/constant-tables.test.d.ts +1 -0
  178. package/dist/ir/constant-tables.test.js +78 -0
  179. package/dist/ir/constant-tables.test.js.map +1 -0
  180. package/dist/ir/integer-ranges.d.ts +13 -0
  181. package/dist/ir/integer-ranges.js +122 -0
  182. package/dist/ir/integer-ranges.js.map +1 -0
  183. package/dist/ir/integer-ranges.test.d.ts +1 -0
  184. package/dist/ir/integer-ranges.test.js +63 -0
  185. package/dist/ir/integer-ranges.test.js.map +1 -0
  186. package/dist/ir/ir.d.ts +130 -76
  187. package/dist/ir/ir.js +69 -4
  188. package/dist/ir/ir.js.map +1 -1
  189. package/dist/ir/ir.test.js +20 -1
  190. package/dist/ir/ir.test.js.map +1 -1
  191. package/dist/ir/scalar-records.d.ts +8 -0
  192. package/dist/ir/scalar-records.js +216 -0
  193. package/dist/ir/scalar-records.js.map +1 -0
  194. package/dist/ir/scalar-records.test.d.ts +1 -0
  195. package/dist/ir/scalar-records.test.js +142 -0
  196. package/dist/ir/scalar-records.test.js.map +1 -0
  197. package/dist/ir/serialize.d.ts +1 -1
  198. package/dist/ir/serialize.js +1 -1
  199. package/dist/ir/serialize.js.map +1 -1
  200. package/dist/ir/validate.js +256 -20
  201. package/dist/ir/validate.js.map +1 -1
  202. package/dist/ir/validate.test.d.ts +1 -0
  203. package/dist/ir/validate.test.js +31 -0
  204. package/dist/ir/validate.test.js.map +1 -0
  205. package/dist/library/cache-primitives.d.ts +1 -1
  206. package/dist/library/cache-primitives.js +3 -3
  207. package/dist/library/cache-primitives.js.map +1 -1
  208. package/dist/library/fence-eval.js +11 -4
  209. package/dist/library/fence-eval.js.map +1 -1
  210. package/dist/library/int-infer.test.js +4 -4
  211. package/dist/library/int-infer.test.js.map +1 -1
  212. package/dist/library/library-cache.js +0 -1
  213. package/dist/library/library-cache.js.map +1 -1
  214. package/dist/library/library-cache.test.js +8 -8
  215. package/dist/library/library-cache.test.js.map +1 -1
  216. package/package.json +17 -17
  217. package/surface-manifest.json +186 -79
@@ -62,15 +62,14 @@ declare namespace NodeJS {
62
62
  * keeps the loop alive. */
63
63
  interface ReadableStream {
64
64
  on(event: "data", listener: (chunk: Buffer) => void): void;
65
+ on(event: "data", listener: (chunk: string) => void): void;
65
66
  on(event: "end", listener: () => void): void;
66
67
  once(event: "data", listener: (chunk: Buffer) => void): void;
68
+ once(event: "data", listener: (chunk: string) => void): void;
67
69
  once(event: "end", listener: () => void): void;
68
- /* Declared surface without a lowering (chunks stay bytes; decode
69
- * with TextDecoder) — string-mode consumers typecheck and fence at
70
- * the reached site. With setEncoding in force Node hands strings to
71
- * 'data', hence the string arm on the listener above being absent:
72
- * the lowered surface is bytes-only. */
73
- setEncoding(encoding: string): void;
70
+ /* setEncoding('utf8') makes subsequent data chunks strings, including
71
+ * multibyte sequences split across native pipe reads. */
72
+ setEncoding(encoding: string): this;
74
73
  }
75
74
  }
76
75
 
@@ -181,11 +180,13 @@ declare var process: {
181
180
  * callers forward a `string | null` result field. */
182
181
  kill(pid: number, signal?: string | number | null): true;
183
182
  env: { [name: string]: string | undefined };
183
+ /** Numeric writes set the status returned by ordinary program exit. */
184
+ exitCode?: number;
184
185
  /* `never`, like @types/node: code behind an early-exit guard narrows
185
186
  * (`if (!x) process.exit(1)` proves x afterwards) — typed `void` the
186
187
  * guard narrows nothing and correct programs fail preflight. The
187
- * lowering already handles the optional code (bare exit() is exit(0),
188
- * Node's behavior when exitCode was never set). */
188
+ * lowering already handles the optional code (bare exit() uses exitCode,
189
+ * or zero when it was never set). */
189
190
  exit(code?: number | null): never;
190
191
  cwd(): string;
191
192
  /* The user tick queue: callbacks run before promise jobs at every loop
@@ -280,6 +281,14 @@ declare var process: {
280
281
  /* emitWarning — Node's full grammar (string or Error warning; type/
281
282
  * ctor/options second; code/ctor third). */
282
283
  emitWarning(warning: string | Error, ...args: any[]): void;
284
+ /** Present in a child created by child_process.fork(). */
285
+ readonly connected: boolean;
286
+ send?(message: object, callback?: (error: Error | null) => void): boolean;
287
+ disconnect(): void;
288
+ on(event: "message", listener: (message: any) => void): void;
289
+ on(event: "disconnect", listener: () => void): void;
290
+ once(event: "message", listener: (message: any) => void): void;
291
+ once(event: "disconnect", listener: () => void): void;
283
292
  };
284
293
 
285
294
  /* Node's process module default export is the global process object. These
@@ -770,6 +779,7 @@ interface Request {
770
779
  arrayBuffer(): Promise<ArrayBuffer>;
771
780
  bytes(): Promise<Uint8Array>;
772
781
  }
782
+ type RequestInfo = string | URL | Request;
773
783
  interface RequestInit {
774
784
  method?: string;
775
785
  headers?:
@@ -782,7 +792,7 @@ interface RequestInit {
782
792
  signal?: AbortSignal;
783
793
  }
784
794
  declare var Request: {
785
- new (input: string | URL | Request, init?: RequestInit): Request;
795
+ new (input: RequestInfo, init?: RequestInit): Request;
786
796
  readonly prototype: Request;
787
797
  };
788
798
  declare function fetch(input: string | URL, init?: RequestInit): Promise<Response>;
@@ -947,15 +957,19 @@ declare var performance: import("node:perf_hooks").Performance;
947
957
  * createRequire(import.meta.url) (or __filename) whose require calls
948
958
  * take STATIC string literals — the indirection erases at compile time.
949
959
  * A builtin spec makes the binding a namespace import in const clothing;
950
- * a relative .json document bakes and parses (JSON.parse's `unknown`
951
- * stance — validate with a checked cast); an installed npm package loads
952
- * through the island's require-condition entry under --dynamic; a bare
953
- * name nothing installed resolves compiles to Node's catchable
954
- * MODULE_NOT_FOUND throw (the optional-dependency try/require pattern).
960
+ * relative and package-import program modules use the compiled module
961
+ * graph; a relative .json document bakes and parses (JSON.parse's
962
+ * `unknown` stance — validate with a checked cast); an installed npm
963
+ * package loads through the island's require-condition entry under
964
+ * --dynamic, or through the compiled graph under --npm-static; a bare name
965
+ * nothing installed resolves compiles to Node's catchable MODULE_NOT_FOUND
966
+ * throw (the optional-dependency try/require pattern).
955
967
  * Dynamic specifiers fence: a compiled binary's module graph is fixed at
956
968
  * build time. builtinModules is the baked Node v24 list (a fresh
957
969
  * mutable array per read where Node ships one frozen singleton);
958
- * isBuiltin and syncBuiltinESMExports fence per site. Both spellings
970
+ * isBuiltin checks runtime strings against that pinned list, and
971
+ * syncBuiltinESMExports is a no-op because the static builtin surface is
972
+ * immutable. Both spellings
959
973
  * name the builtin, like in Node (the builtin wins over the npm package
960
974
  * named "module" for the bare specifier there too). */
961
975
  declare module "node:module" {
@@ -1007,6 +1021,15 @@ declare module "node:fs" {
1007
1021
  export function readFileSync(fd: number): Buffer;
1008
1022
  /* The options-object spelling of the utf8 form. */
1009
1023
  export function readFileSync(path: string, options: { encoding: "utf8" | "utf-8" }): string;
1024
+ /* Error-first callback target used by the static util.promisify
1025
+ * projection. Its options stay unknown because direct calls remain
1026
+ * outside the typed fs slice; this also lets checked-JS validation
1027
+ * ladders observe invalid runtime encodings without contextual narrowing. */
1028
+ export function readFile(
1029
+ path: string,
1030
+ options: unknown,
1031
+ callback: (error: Error | null, data: string) => void,
1032
+ ): void;
1010
1033
  /* The options form carries the mode (applied at CREATION only, like
1011
1034
  * Node — an existing file keeps its permissions) and/or the utf8
1012
1035
  * encoding spelling. */
@@ -1026,6 +1049,9 @@ declare module "node:fs" {
1026
1049
  export function mkdirSync(path: string, options: { recursive?: boolean; mode?: number }): void;
1027
1050
  export function unlinkSync(path: string): void;
1028
1051
  export function chmodSync(path: string, mode: number): void;
1052
+ export function fchmodSync(fd: number, mode: number): void;
1053
+ export function fsyncSync(fd: number): void;
1054
+ export function linkSync(existingPath: string, newPath: string): void;
1029
1055
  export function chownSync(path: string, uid: number, gid: number): void;
1030
1056
  /* The 2-argument form only (Node's mode flags have no lowering). The
1031
1057
  * destination is created or truncated carrying the SOURCE's mode. */
@@ -1064,36 +1090,61 @@ declare module "node:fs" {
1064
1090
  readonly R_OK: number;
1065
1091
  readonly W_OK: number;
1066
1092
  readonly X_OK: number;
1093
+ readonly O_RDONLY: number;
1094
+ readonly O_WRONLY: number;
1095
+ readonly O_RDWR: number;
1096
+ readonly O_CREAT: number;
1097
+ readonly O_EXCL: number;
1098
+ readonly O_NOFOLLOW: number;
1099
+ readonly O_NONBLOCK: number;
1100
+ readonly O_TRUNC: number;
1101
+ readonly O_APPEND: number;
1067
1102
  };
1068
1103
  /* A stat(2) snapshot (statSync follows symlinks, lstatSync does not —
1069
1104
  * Node's split) — immutable; the supported surface is exactly these
1070
- * members. blocks is the allocated size in 512-byte units; the time
1071
- * fields are milliseconds with their sub-second fractions. */
1105
+ * members. dev/ino identify the filesystem entry, blocks is the allocated
1106
+ * size in 512-byte units, and the time fields are milliseconds with their
1107
+ * sub-second fractions. */
1072
1108
  export interface Stats {
1073
1109
  isFile(): boolean;
1074
1110
  isDirectory(): boolean;
1075
1111
  isSymbolicLink(): boolean;
1112
+ readonly dev: number;
1113
+ readonly ino: number;
1076
1114
  readonly size: number;
1077
1115
  readonly blocks: number;
1078
1116
  readonly nlink: number;
1079
1117
  readonly atimeMs: number;
1080
1118
  readonly mtimeMs: number;
1119
+ readonly ctimeMs: number;
1081
1120
  }
1082
1121
  export function statSync(path: string): Stats;
1083
1122
  export function lstatSync(path: string): Stats;
1084
1123
  /* The fd pair behind spawn's fd-stdio form: openSync(path, flags) →
1085
- * the raw fd (string flags only — "r", "w", "a" and the +/x/s
1086
- * variants), closeSync(fd). */
1124
+ * the raw fd. Numeric flags use an inline OR of the O_* constants. */
1087
1125
  export function openSync(path: string, flags: string): number;
1126
+ export function openSync(path: string, flags: number, mode?: number): number;
1088
1127
  export function closeSync(fd: number): void;
1089
1128
  /* Read into a caller buffer from the fd's current position when position
1090
1129
  * is omitted/null, or from a numeric byte position without advancing the
1091
1130
  * fd. Answers the byte count, 0 at EOF. */
1131
+ export interface ReadSyncOptions {
1132
+ offset?: number;
1133
+ length?: number;
1134
+ position?: number | null;
1135
+ }
1136
+ export function readSync(fd: number, buffer: Uint8Array, options?: ReadSyncOptions): number;
1092
1137
  export function readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position?: number | null): number;
1093
1138
  /* Write a caller-buffer window, or a utf8 string, at the fd's current
1094
1139
  * position when position is omitted/null (advancing it), or at a numeric
1095
1140
  * byte position without advancing it. Answers the byte count. */
1096
- export function writeSync(fd: number, buffer: Uint8Array, offset: number, length: number, position?: number | null): number;
1141
+ export interface WriteSyncOptions {
1142
+ offset?: number;
1143
+ length?: number;
1144
+ position?: number | null;
1145
+ }
1146
+ export function writeSync(fd: number, buffer: Uint8Array, options: WriteSyncOptions): number;
1147
+ export function writeSync(fd: number, buffer: Uint8Array, offset?: number, length?: number, position?: number | null): number;
1097
1148
  export function writeSync(fd: number, string: string, position?: number | null, encoding?: "utf8" | "utf-8"): number;
1098
1149
  /* statSync over an open fd — the same Stats snapshot. */
1099
1150
  export function fstatSync(fd: number): Stats;
@@ -1198,8 +1249,19 @@ declare module "fs/promises" {
1198
1249
  export function writeFile(path: string, data: string, encoding: "utf8" | "utf-8"): Promise<void>;
1199
1250
  export function mkdir(path: string, options?: { recursive?: boolean; mode?: number }): Promise<void>;
1200
1251
  export function readdir(path: string): Promise<string[]>;
1252
+ export function readdir(
1253
+ path: string,
1254
+ options: {
1255
+ encoding?: "utf8" | "utf-8";
1256
+ withFileTypes: true;
1257
+ recursive?: boolean;
1258
+ [option: string]: unknown;
1259
+ },
1260
+ ): Promise<import("node:fs").Dirent[]>;
1201
1261
  export function rm(path: string): Promise<void>;
1202
1262
  export function stat(path: string): Promise<import("node:fs").Stats>;
1263
+ export function realpath(path: string): Promise<string>;
1264
+ export function lstat(path: string): Promise<import("node:fs").Stats>;
1203
1265
  export function unlink(path: string): Promise<void>;
1204
1266
  export function chmod(path: string, mode: number): Promise<void>;
1205
1267
  export function rename(oldPath: string, newPath: string): Promise<void>;
@@ -1328,7 +1390,7 @@ declare module "node:os" {
1328
1390
  /* The WHATWG URL class (a Node global; the es2023 lib doesn't declare it),
1329
1391
  * typed as exactly the supported surface: construction from ONE absolute-
1330
1392
  * URL string (invalid input throws a catchable TypeError, like Node), the
1331
- * protocol/pathname/href/host/hostname/search getters, searchParams (the
1393
+ * protocol/origin/username/pathname/href/host/hostname/port/search/hash getters, searchParams (the
1332
1394
  * LIVE query view — mutations through it re-serialize into the URL, so
1333
1395
  * href reflects immediately; every read answers the same object, Node's
1334
1396
  * caching), and toString() (the href serialization).
@@ -1340,16 +1402,21 @@ declare module "node:os" {
1340
1402
  * documented in SEMANTICS.md. */
1341
1403
  interface URL {
1342
1404
  readonly protocol: string;
1405
+ readonly origin: string;
1406
+ readonly username: string;
1407
+ readonly password: string;
1343
1408
  readonly pathname: string;
1344
1409
  readonly href: string;
1345
1410
  readonly host: string;
1346
1411
  readonly hostname: string;
1412
+ readonly port: string;
1347
1413
  readonly search: string;
1414
+ readonly hash: string;
1348
1415
  readonly searchParams: URLSearchParams;
1349
1416
  toString(): string;
1350
1417
  }
1351
1418
  declare var URL: {
1352
- new (input: string): URL;
1419
+ new (input: string, base?: string | URL): URL;
1353
1420
  };
1354
1421
 
1355
1422
  /* URLSearchParams — the WHATWG application/x-www-form-urlencoded list.
@@ -1546,16 +1613,16 @@ declare module "child_process" {
1546
1613
 
1547
1614
  /* The asynchronous slice: spawn with stdio "ignore"/"inherit"/fd/"pipe"
1548
1615
  * tuples (piped stdin is writable through child.stdin; piped stdout/stderr
1549
- * deliver through child.stdout/stderr) and
1550
- * the two terminal events. "exit" fires once with the exit code, or
1616
+ * deliver through child.stdout/stderr) and the terminal events. "exit"
1617
+ * fires once with the exit code, or
1551
1618
  * null when the child died to a signal; "error" fires ONLY when the
1552
1619
  * child could not be spawned at all (Node's split: a spawn failure
1553
- * emits "error" and never "exit"). Listeners take at most one
1554
- * parameter; Node's second "exit" parameter (the signal name) has no
1555
- * lowering. `on` returns void here (Node returns the child; chaining
1556
- * is fenced). The event loop keeps the process alive until every
1557
- * spawned child is reaped, like Node — reaping polls at loop
1558
- * quiescence (SEMANTICS.md documents the divergence). An "error"
1620
+ * emits "error" and never "exit"). "close" fires after exit/error and
1621
+ * every piped stdio handle reaches EOF. Exit/close listeners may take
1622
+ * Node's code and signal parameters. `on`/`once` return void here (Node
1623
+ * returns the child; chaining is fenced). The event loop keeps the process
1624
+ * alive until every spawned child is reaped, like Node — reaping polls at
1625
+ * loop quiescence (SEMANTICS.md documents the divergence). An "error"
1559
1626
  * event with no registered listener prints the error and exits 1,
1560
1627
  * exactly the unhandled-'error' EventEmitter behavior. */
1561
1628
  export interface ChildStdin {
@@ -1573,7 +1640,15 @@ declare module "child_process" {
1573
1640
  /* The exit listener may also take Node's second parameter — the
1574
1641
  * terminating signal's name, null for a normal exit. */
1575
1642
  on(event: "exit", listener: (code: number | null, signal: string | null) => void): void;
1643
+ on(event: "close", listener: (code: number | null, signal: string | null) => void): void;
1576
1644
  on(event: "error", listener: (err: Error) => void): void;
1645
+ once(event: "exit", listener: (code: number | null, signal: string | null) => void): void;
1646
+ once(event: "close", listener: (code: number | null, signal: string | null) => void): void;
1647
+ once(event: "error", listener: (err: Error) => void): void;
1648
+ on(event: "message", listener: (message: any) => void): void;
1649
+ on(event: "disconnect", listener: () => void): void;
1650
+ once(event: "message", listener: (message: any) => void): void;
1651
+ once(event: "disconnect", listener: () => void): void;
1577
1652
  /* The lifecycle members, Node's exact shapes: pid is undefined exactly
1578
1653
  * when the spawn failed; exitCode is null while running, the code
1579
1654
  * after a normal exit, null for a signal death, and -errno once a
@@ -1589,6 +1664,9 @@ declare module "child_process" {
1589
1664
  readonly killed: boolean;
1590
1665
  kill(signal?: string | number): boolean;
1591
1666
  unref(): void;
1667
+ readonly connected: boolean;
1668
+ send(message: object, callback?: (error: Error | null) => void): boolean;
1669
+ disconnect(): void;
1592
1670
  [Symbol.dispose](): void;
1593
1671
  /* The piped streams — non-null exactly when the matching stdio slot
1594
1672
  * was "pipe" (Node's shape). */
@@ -1608,11 +1686,27 @@ declare module "child_process" {
1608
1686
  stdio: "ignore" | "inherit" | "pipe" | ("ignore" | "inherit" | "pipe" | number)[];
1609
1687
  /* detached gives the child its own session and process group
1610
1688
  * (POSIX_SPAWN_SETSID); env REPLACES the child environment; cwd
1611
- * sets its working directory; windowsHide is a POSIX no-op. */
1689
+ * sets its working directory; windowsHide is a POSIX no-op; shell
1690
+ * runs the complete command string through /bin/sh or cmd.exe. */
1612
1691
  detached?: boolean;
1613
1692
  env?: { [k: string]: string | undefined };
1614
1693
  cwd?: string;
1615
1694
  windowsHide?: boolean;
1695
+ shell?: boolean;
1696
+ },
1697
+ ): ChildProcess;
1698
+
1699
+ export function fork(
1700
+ modulePath: string | URL,
1701
+ args?: string[],
1702
+ options?: {
1703
+ cwd?: string;
1704
+ env?: { [k: string]: string | undefined };
1705
+ execArgv?: string[];
1706
+ silent?: boolean;
1707
+ stdio?: "pipe" | "ignore" | "inherit" | ("pipe" | "ignore" | "inherit" | "ipc")[];
1708
+ serialization?: "json" | "advanced";
1709
+ windowsHide?: boolean;
1616
1710
  },
1617
1711
  ): ChildProcess;
1618
1712
 
@@ -1657,9 +1751,13 @@ declare module "child_process" {
1657
1751
  }
1658
1752
  export function execFileSync(file: string, args?: string[], options?: ExecSyncOptions): string;
1659
1753
  export function execSync(command: string, options?: ExecSyncOptions): string;
1660
- /* The callback form exists to be PROMISIFIED — `const execFileAsync =
1661
- * promisify(execFile)` is the one lowered use (see "util"); calling it
1662
- * directly with a callback has no lowering and fences per site. */
1754
+ export type ExecFileCallback = (error: Error | null, stdout: string, stderr: string) => void;
1755
+ /* The callback form starts an asynchronous child and captures utf8
1756
+ * stdout/stderr. The no-callback overload remains for util.promisify's
1757
+ * static target recognition; reached no-callback calls still fence. */
1758
+ export function execFile(file: string, callback: ExecFileCallback): ChildProcess;
1759
+ export function execFile(file: string, args: string[] | null, callback: ExecFileCallback): ChildProcess;
1760
+ export function execFile(file: string, args: string[] | null, options: ExecSyncOptions, callback: ExecFileCallback): ChildProcess;
1663
1761
  export function execFile(
1664
1762
  file: string,
1665
1763
  args?: string[] | null,
@@ -1678,13 +1776,14 @@ declare module "node:child_process" {
1678
1776
  export * from "child_process";
1679
1777
  }
1680
1778
 
1681
- /* node:util — promisify, for exactly ONE target: child_process.execFile.
1682
- * `const execFileAsync = promisify(execFile)` binds an async exec whose
1683
- * calls run the file (no shell, PATH-searched) and settle with
1684
- * { stdout, stderr } — fulfilled on exit 0, rejected with Node's
1685
- * Command-failed / spawn-ENOENT errors otherwise. Other promisify
1686
- * targets and bare promisify values fence per site. */
1779
+ /* node:util — compile-time projections for child_process.execFile and
1780
+ * fs.readFile. The former retains Node's custom { stdout, stderr } result;
1781
+ * the latter resolves the callback's data argument. Other targets and bare
1782
+ * promisify values fence per site. */
1687
1783
  declare module "util" {
1784
+ export function promisify(
1785
+ fn: typeof import("node:fs").readFile,
1786
+ ): (path: string, encoding: "utf8" | "utf-8") => Promise<string>;
1688
1787
  export function promisify(
1689
1788
  fn: (file: string, args?: string[] | null, options?: object) => unknown,
1690
1789
  ): (
@@ -1781,9 +1880,10 @@ declare module "node:util/types" {
1781
1880
  * Object.is over scalars; deepStrictEqual compares composites
1782
1881
  * structurally per their static types. The messages here are plain
1783
1882
  * strings (Node accepts Errors — that form fences per site), and the
1784
- * loose-equality quartet (equal/notEqual/deepEqual/notDeepEqual) is
1785
- * declared so real code typechecks but fences at its use sites (== has
1786
- * no lowering; assert/strict's equal IS strictEqual and lowers). */
1883
+ * shallow legacy pair (equal/notEqual) follows Node's == coercions for
1884
+ * primitive and primitive-union operands, including Node v24's NaN
1885
+ * exception. deepEqual/notDeepEqual remain declared-but-fenced;
1886
+ * assert/strict's loose names alias the strict forms and lower. */
1787
1887
  /* node:test — the in-process test runner (prefix-only in Node too:
1788
1888
  * require("test") is MODULE_NOT_FOUND). test/it register tests (sync and
1789
1889
  * async bodies, skip/todo/only options and method twins), describe/suite
@@ -2023,14 +2123,38 @@ declare module "node:readline" {
2023
2123
  export * from "readline";
2024
2124
  }
2025
2125
 
2026
- /* node:zlib — deflateSync/inflateSync lower (Buffer in, Buffer out,
2027
- * Node's default options; libz links only into zlib-using binaries);
2028
- * gzip and friends typecheck and fence at their use sites. */
2126
+ /* node:zlib — the one-shot zlib/raw/gzip codecs lower for string/Buffer
2127
+ * inputs with Node's default options; libz links only into zlib-using
2128
+ * binaries. Callback forms use the executable worker pool. Options stay
2129
+ * declared so reached uses receive a named SC2020 refusal; Brotli,
2130
+ * streaming, and Zstd remain outside the lowered surface. */
2029
2131
  declare module "zlib" {
2030
- export function deflateSync(data: string | Uint8Array): Buffer;
2031
- export function inflateSync(data: Uint8Array): Buffer;
2032
- export function gzipSync(data: string | Uint8Array): Buffer;
2033
- export function gunzipSync(data: Uint8Array): Buffer;
2132
+ export interface ZlibOptions { [option: string]: unknown }
2133
+ export type ZlibCallback = (error: NodeJS.ErrnoException | null, result: Buffer) => void;
2134
+ export function deflate(data: string | Uint8Array, callback: ZlibCallback): void;
2135
+ export function deflate(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2136
+ export function deflateSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2137
+ export function inflate(data: string | Uint8Array, callback: ZlibCallback): void;
2138
+ export function inflate(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2139
+ export function inflateSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2140
+ export function deflateRaw(data: string | Uint8Array, callback: ZlibCallback): void;
2141
+ export function deflateRaw(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2142
+ export function deflateRawSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2143
+ export function inflateRaw(data: string | Uint8Array, callback: ZlibCallback): void;
2144
+ export function inflateRaw(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2145
+ export function inflateRawSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2146
+ export function gzip(data: string | Uint8Array, callback: ZlibCallback): void;
2147
+ export function gzip(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2148
+ export function gzipSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2149
+ export function gunzip(data: string | Uint8Array, callback: ZlibCallback): void;
2150
+ export function gunzip(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2151
+ export function gunzipSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2152
+ export function unzip(data: string | Uint8Array, callback: ZlibCallback): void;
2153
+ export function unzip(data: string | Uint8Array, options: ZlibOptions, callback: ZlibCallback): void;
2154
+ export function unzipSync(data: string | Uint8Array, options?: ZlibOptions): Buffer;
2155
+ export function crc32(data: string | Uint8Array, value?: number): number;
2156
+ export function brotliCompressSync(data: string | Uint8Array): Buffer;
2157
+ export function brotliDecompressSync(data: Uint8Array): Buffer;
2034
2158
  }
2035
2159
  declare module "node:zlib" {
2036
2160
  export * from "zlib";
@@ -2104,6 +2228,7 @@ declare module "net" {
2104
2228
  once(event: "session", listener: (session: Buffer) => void): void;
2105
2229
  }
2106
2230
  export interface Server {
2231
+ readonly listening: boolean;
2107
2232
  /* Node answers the server itself (`return this` chaining). */
2108
2233
  listen(port: number, callback?: () => void): Server;
2109
2234
  /* The positional bind address (the options form's host in argument
@@ -2122,6 +2247,7 @@ declare module "net" {
2122
2247
  emit(event: "connection", socket: Socket): boolean;
2123
2248
  on(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
2124
2249
  on(event: "close" | "listening", listener: () => void): void;
2250
+ on(event: "timeout", listener: (socket: Socket) => void): void;
2125
2251
  on(event: "error", listener: (err: Error) => void): void;
2126
2252
  /* The WebSocket handover: fires INSTEAD of 'request' for
2127
2253
  * Connection: upgrade requests, with the raw socket + head bytes. */
@@ -2132,11 +2258,13 @@ declare module "net" {
2132
2258
  /* addListener IS on (Node aliases them) — the suite spells both. */
2133
2259
  addListener(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
2134
2260
  addListener(event: "close" | "listening", listener: () => void): void;
2261
+ addListener(event: "timeout", listener: (socket: Socket) => void): void;
2135
2262
  addListener(event: "error", listener: (err: Error) => void): void;
2136
2263
  addListener(event: "upgrade", listener: (req: import("http").IncomingMessage, socket: Socket, head: Buffer) => void): void;
2137
2264
  addListener(event: "request", listener: (req: import("http").IncomingMessage, res: import("http").ServerResponse) => void): void;
2138
2265
  once(event: "connection" | "secureConnection", listener: (socket: Socket) => void): void;
2139
2266
  once(event: "close" | "listening", listener: () => void): void;
2267
+ once(event: "timeout", listener: (socket: Socket) => void): void;
2140
2268
  once(event: "error", listener: (err: Error) => void): void;
2141
2269
  once(event: "upgrade", listener: (req: import("http").IncomingMessage, socket: Socket, head: Buffer) => void): void;
2142
2270
  once(event: "request", listener: (req: import("http").IncomingMessage, res: import("http").ServerResponse) => void): void;
@@ -2193,8 +2321,14 @@ declare module "node:net" {
2193
2321
  * connection per call (no agent pooling) with Node's exact wire head. */
2194
2322
  declare module "http" {
2195
2323
  import { Server as NetServer, Socket } from "net";
2324
+ export const METHODS: string[];
2325
+ export const STATUS_CODES: { [status: number]: string | undefined };
2326
+ export const maxHeaderSize: number;
2196
2327
  export interface Server extends NetServer {
2197
2328
  timeout: number;
2329
+ setTimeout(msecs: number, callback?: (socket: Socket) => void): this;
2330
+ closeAllConnections(): void;
2331
+ closeIdleConnections(): void;
2198
2332
  keepAliveTimeout: number;
2199
2333
  keepAliveTimeoutBuffer: number;
2200
2334
  headersTimeout: number;
@@ -2232,53 +2366,82 @@ declare module "http" {
2232
2366
  export interface IncomingMessage {
2233
2367
  readonly url: string;
2234
2368
  readonly method: string;
2369
+ readonly httpVersion: string;
2370
+ readonly complete: boolean;
2371
+ readonly aborted: boolean;
2235
2372
  readonly statusCode: number | undefined;
2236
2373
  readonly statusMessage: string | undefined;
2237
2374
  readonly socket: Socket;
2375
+ readonly connection: Socket;
2238
2376
  readonly headers: { [name: string]: string | undefined };
2377
+ readonly headersDistinct: { [name: string]: string[] | undefined };
2239
2378
  readonly rawHeaders: string[];
2379
+ readonly trailers: { [name: string]: string | undefined };
2380
+ readonly trailersDistinct: { [name: string]: string[] | undefined };
2381
+ readonly rawTrailers: string[];
2240
2382
  resume(): void;
2241
2383
  destroy(): void;
2384
+ setTimeout(msecs: number, callback?: () => void): this;
2242
2385
  /* setEncoding('utf8'): 'data' delivers strings (other real encodings
2243
2386
  * fence loudly at runtime; unknown names throw ERR_UNKNOWN_ENCODING). */
2244
2387
  setEncoding(encoding: string): void;
2245
2388
  /* The proxy legs: the body streams into a ServerResponse, a
2246
2389
  * ClientRequest, or a raw Socket; natural end ends the destination. */
2247
- pipe(destination: ServerResponse | ClientRequest | Socket): void;
2390
+ pipe(destination: ServerResponse | import("http2").Http2ServerResponse | ClientRequest | Socket): void;
2248
2391
  on(event: "data", listener: (chunk: any) => void): void;
2249
- on(event: "end" | "close", listener: () => void): void;
2392
+ on(event: "end" | "close" | "aborted", listener: () => void): void;
2250
2393
  on(event: "error", listener: (err: Error) => void): void;
2251
2394
  /* addListener IS on (Node aliases them) — the suite spells both. */
2252
2395
  addListener(event: "data", listener: (chunk: any) => void): void;
2253
- addListener(event: "end" | "close", listener: () => void): void;
2396
+ addListener(event: "end" | "close" | "aborted", listener: () => void): void;
2254
2397
  addListener(event: "error", listener: (err: Error) => void): void;
2255
2398
  once(event: "data", listener: (chunk: any) => void): void;
2256
- once(event: "end" | "close", listener: () => void): void;
2399
+ once(event: "end" | "close" | "aborted", listener: () => void): void;
2257
2400
  once(event: "error", listener: (err: Error) => void): void;
2258
2401
  }
2259
2402
  export interface ServerResponse {
2260
2403
  readonly headersSent: boolean;
2404
+ readonly writableEnded: boolean;
2405
+ readonly finished: boolean;
2406
+ readonly writableFinished: boolean;
2407
+ readonly writableCorked: number;
2408
+ readonly req: IncomingMessage;
2409
+ readonly socket: Socket | null;
2410
+ readonly connection: Socket | null;
2411
+ sendDate: boolean;
2412
+ strictContentLength: boolean;
2261
2413
  /* Node's writable head properties: the implicit head reads them. */
2262
2414
  statusCode: number;
2263
- statusMessage: string;
2415
+ statusMessage: string | undefined;
2264
2416
  setHeader(name: string, value: string | number): void;
2265
2417
  getHeader(name: string): string | undefined;
2418
+ getHeaderNames(): string[];
2419
+ getRawHeaderNames(): string[];
2420
+ getHeaders(): OutgoingHttpHeaders;
2266
2421
  hasHeader(name: string): boolean;
2267
2422
  removeHeader(name: string): void;
2268
2423
  /* Both overloads answer the response (`return this` chaining); the
2269
2424
  * headers argument also takes Node's flat [name, value, ...] array. */
2270
2425
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders | string[]): ServerResponse;
2271
2426
  writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders | string[]): ServerResponse;
2427
+ writeContinue(callback?: () => void): void;
2428
+ writeProcessing(callback?: () => void): void;
2429
+ writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
2272
2430
  write(data: string | Uint8Array): void;
2431
+ flushHeaders(): void;
2432
+ cork(): void;
2433
+ uncork(): void;
2434
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
2435
+ setTimeout(msecs: number, callback?: () => void): this;
2273
2436
  /* end's callback forms fire once the body went out (the 'finish'
2274
2437
  * emit, deferred past the handler's synchronous tail). */
2275
2438
  end(data?: string | Uint8Array, callback?: () => void): void;
2276
2439
  end(callback: () => void): void;
2277
2440
  destroy(): void;
2278
- on(event: "close", listener: () => void): void;
2441
+ on(event: "close" | "finish", listener: () => void): void;
2279
2442
  /* addListener IS on (Node aliases them) — the suite spells both. */
2280
- addListener(event: "close", listener: () => void): void;
2281
- once(event: "close", listener: () => void): void;
2443
+ addListener(event: "close" | "finish", listener: () => void): void;
2444
+ once(event: "close" | "finish", listener: () => void): void;
2282
2445
  }
2283
2446
  /* The CLIENT slice (http.request/http.get): the options-object form
2284
2447
  * with hostname/host, port, path, method, timeout, and headers; the
@@ -2345,21 +2508,52 @@ declare module "http" {
2345
2508
  export const globalAgent: Agent;
2346
2509
  export interface ClientRequest {
2347
2510
  readonly destroyed: boolean;
2511
+ readonly aborted: boolean;
2512
+ readonly socket: Socket;
2513
+ readonly connection: Socket;
2514
+ readonly writableCorked: number;
2515
+ readonly method: string;
2516
+ readonly path: string;
2517
+ readonly host: string;
2518
+ readonly protocol: string;
2519
+ readonly headersSent: boolean;
2520
+ readonly writableEnded: boolean;
2521
+ readonly writableFinished: boolean;
2522
+ readonly finished: boolean;
2523
+ readonly reusedSocket: boolean;
2524
+ setHeader(name: string, value: string): void;
2525
+ getHeader(name: string): string | undefined;
2526
+ hasHeader(name: string): boolean;
2527
+ removeHeader(name: string): void;
2528
+ getHeaderNames(): string[];
2529
+ getRawHeaderNames(): string[];
2530
+ getHeaders(): OutgoingHttpHeaders;
2531
+ flushHeaders(): void;
2532
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
2533
+ cork(): void;
2534
+ uncork(): void;
2535
+ setNoDelay(noDelay?: boolean): void;
2536
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
2537
+ setTimeout(timeout: number, callback?: () => void): this;
2348
2538
  write(data: string | Uint8Array): void;
2349
2539
  end(data?: string | Uint8Array): void;
2350
2540
  destroy(): void;
2541
+ abort(): void;
2351
2542
  on(event: "response", listener: (res: IncomingMessage) => void): void;
2543
+ on(event: "socket", listener: (socket: Socket) => void): void;
2352
2544
  on(event: "upgrade", listener: (res: IncomingMessage, socket: Socket, head: Buffer) => void): void;
2353
- on(event: "timeout" | "close", listener: () => void): void;
2545
+ on(event: "timeout" | "close" | "finish" | "abort", listener: () => void): void;
2354
2546
  on(event: "error", listener: (err: Error) => void): void;
2355
2547
  /* addListener IS on (Node aliases them) — the suite spells both. */
2356
2548
  addListener(event: "response", listener: (res: IncomingMessage) => void): void;
2549
+ addListener(event: "socket", listener: (socket: Socket) => void): void;
2357
2550
  addListener(event: "upgrade", listener: (res: IncomingMessage, socket: Socket, head: Buffer) => void): void;
2358
- addListener(event: "timeout" | "close", listener: () => void): void;
2551
+ addListener(event: "timeout" | "close" | "finish" | "abort", listener: () => void): void;
2359
2552
  addListener(event: "error", listener: (err: Error) => void): void;
2360
2553
  once(event: "response", listener: (res: IncomingMessage) => void): void;
2554
+ once(event: "socket", listener: (socket: Socket) => void): void;
2361
2555
  once(event: "upgrade", listener: (res: IncomingMessage, socket: Socket, head: Buffer) => void): void;
2362
- once(event: "timeout" | "close", listener: () => void): void;
2556
+ once(event: "timeout" | "close" | "finish" | "abort", listener: () => void): void;
2363
2557
  once(event: "error", listener: (err: Error) => void): void;
2364
2558
  }
2365
2559
  export function createServer(
@@ -2390,6 +2584,8 @@ declare module "http" {
2390
2584
  target: RequestOptions | string | URL,
2391
2585
  callback?: (res: IncomingMessage) => void,
2392
2586
  ): ClientRequest;
2587
+ export function validateHeaderName(name: string, label?: string): void;
2588
+ export function validateHeaderValue(name: string, value: unknown): void;
2393
2589
  }
2394
2590
  declare module "node:http" {
2395
2591
  export * from "http";
@@ -2562,6 +2758,8 @@ declare module "http2" {
2562
2758
  }
2563
2759
  export interface Http2ServerResponse {
2564
2760
  readonly headersSent: boolean;
2761
+ readonly writableEnded: boolean;
2762
+ readonly writableCorked: number;
2565
2763
  /* The same lowered surface as http.ServerResponse — the allowHTTP1
2566
2764
  * lowering serves every connection as HTTP/1.1, where the compat
2567
2765
  * response IS this parser's response handle. */
@@ -2569,11 +2767,20 @@ declare module "http2" {
2569
2767
  statusMessage: string;
2570
2768
  setHeader(name: string, value: string | number): void;
2571
2769
  getHeader(name: string): string | undefined;
2770
+ getHeaderNames(): string[];
2771
+ getRawHeaderNames(): string[];
2772
+ getHeaders(): import("http").OutgoingHttpHeaders;
2572
2773
  hasHeader(name: string): boolean;
2573
2774
  removeHeader(name: string): void;
2574
2775
  writeHead(statusCode: number, headers?: import("http").OutgoingHttpHeaders | string[]): Http2ServerResponse;
2575
2776
  writeHead(statusCode: number, statusMessage: string, headers?: import("http").OutgoingHttpHeaders | string[]): Http2ServerResponse;
2777
+ writeContinue(): void;
2778
+ writeEarlyHints(hints: Record<string, string | string[]>): void;
2576
2779
  write(data: string | Uint8Array): void;
2780
+ flushHeaders(): void;
2781
+ cork(): void;
2782
+ uncork(): void;
2783
+ addTrailers(headers: import("http").OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
2577
2784
  end(data?: string | Uint8Array, callback?: () => void): void;
2578
2785
  end(callback: () => void): void;
2579
2786
  destroy(): void;
@@ -3162,8 +3369,14 @@ declare module "node:cluster" {
3162
3369
  export = cluster;
3163
3370
  }
3164
3371
 
3165
- /* node:tty — the fd probe (the same isatty(3) behind process.*.isTTY). */
3372
+ /* node:tty — the fd probe (the same isatty(3) behind process.*.isTTY)
3373
+ * and the supported structural view of a process output stream. */
3166
3374
  declare module "tty" {
3375
+ export interface WriteStream {
3376
+ write(data: string | Uint8Array, callback?: (error?: Error | null) => void): boolean;
3377
+ write(data: string | Uint8Array, encoding: BufferEncoding, callback?: (error?: Error | null) => void): boolean;
3378
+ readonly isTTY: boolean;
3379
+ }
3167
3380
  export function isatty(fd: number): boolean;
3168
3381
  }
3169
3382
  declare module "node:tty" {