omegon 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/extensions/cleave/dispatcher.ts +213 -20
  2. package/extensions/cleave/index.ts +24 -8
  3. package/extensions/cleave/rpc-child.ts +269 -0
  4. package/extensions/cleave/types.ts +52 -0
  5. package/extensions/openspec/spec.ts +3 -0
  6. package/node_modules/@types/node/README.md +3 -3
  7. package/node_modules/@types/node/assert/strict.d.ts +11 -5
  8. package/node_modules/@types/node/assert.d.ts +173 -50
  9. package/node_modules/@types/node/async_hooks.d.ts +8 -28
  10. package/node_modules/@types/node/buffer.buffer.d.ts +7 -1
  11. package/node_modules/@types/node/buffer.d.ts +168 -44
  12. package/node_modules/@types/node/child_process.d.ts +70 -27
  13. package/node_modules/@types/node/cluster.d.ts +332 -240
  14. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  15. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  16. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  17. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  18. package/node_modules/@types/node/console.d.ts +350 -49
  19. package/node_modules/@types/node/constants.d.ts +4 -3
  20. package/node_modules/@types/node/crypto.d.ts +1110 -630
  21. package/node_modules/@types/node/dgram.d.ts +51 -15
  22. package/node_modules/@types/node/diagnostics_channel.d.ts +6 -4
  23. package/node_modules/@types/node/dns/promises.d.ts +4 -4
  24. package/node_modules/@types/node/dns.d.ts +133 -132
  25. package/node_modules/@types/node/domain.d.ts +17 -13
  26. package/node_modules/@types/node/events.d.ts +663 -734
  27. package/node_modules/@types/node/fs/promises.d.ts +9 -43
  28. package/node_modules/@types/node/fs.d.ts +411 -628
  29. package/node_modules/@types/node/globals.d.ts +30 -8
  30. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  31. package/node_modules/@types/node/http.d.ts +265 -364
  32. package/node_modules/@types/node/http2.d.ts +715 -551
  33. package/node_modules/@types/node/https.d.ts +239 -65
  34. package/node_modules/@types/node/index.d.ts +6 -24
  35. package/node_modules/@types/node/inspector.d.ts +53 -69
  36. package/node_modules/@types/node/inspector.generated.d.ts +410 -759
  37. package/node_modules/@types/node/module.d.ts +186 -52
  38. package/node_modules/@types/node/net.d.ts +194 -70
  39. package/node_modules/@types/node/os.d.ts +11 -12
  40. package/node_modules/@types/node/package.json +3 -13
  41. package/node_modules/@types/node/path.d.ts +133 -120
  42. package/node_modules/@types/node/perf_hooks.d.ts +643 -318
  43. package/node_modules/@types/node/process.d.ts +132 -223
  44. package/node_modules/@types/node/punycode.d.ts +5 -5
  45. package/node_modules/@types/node/querystring.d.ts +4 -4
  46. package/node_modules/@types/node/readline/promises.d.ts +3 -3
  47. package/node_modules/@types/node/readline.d.ts +120 -68
  48. package/node_modules/@types/node/repl.d.ts +100 -87
  49. package/node_modules/@types/node/sea.d.ts +1 -10
  50. package/node_modules/@types/node/sqlite.d.ts +19 -363
  51. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  52. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  53. package/node_modules/@types/node/stream/web.d.ts +502 -176
  54. package/node_modules/@types/node/stream.d.ts +475 -581
  55. package/node_modules/@types/node/string_decoder.d.ts +4 -4
  56. package/node_modules/@types/node/test.d.ts +196 -308
  57. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  58. package/node_modules/@types/node/timers.d.ts +132 -4
  59. package/node_modules/@types/node/tls.d.ts +226 -110
  60. package/node_modules/@types/node/trace_events.d.ts +9 -9
  61. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -1
  62. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  63. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  64. package/node_modules/@types/node/tty.d.ts +16 -58
  65. package/node_modules/@types/node/url.d.ts +573 -130
  66. package/node_modules/@types/node/util.d.ts +1100 -181
  67. package/node_modules/@types/node/v8.d.ts +8 -76
  68. package/node_modules/@types/node/vm.d.ts +72 -280
  69. package/node_modules/@types/node/wasi.d.ts +4 -25
  70. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  71. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  72. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  73. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  74. package/node_modules/@types/node/worker_threads.d.ts +335 -268
  75. package/node_modules/@types/node/zlib.d.ts +74 -9
  76. package/node_modules/undici-types/agent.d.ts +12 -13
  77. package/node_modules/undici-types/api.d.ts +26 -26
  78. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  79. package/node_modules/undici-types/client.d.ts +19 -19
  80. package/node_modules/undici-types/connector.d.ts +2 -2
  81. package/node_modules/undici-types/cookies.d.ts +0 -2
  82. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  83. package/node_modules/undici-types/dispatcher.d.ts +103 -123
  84. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  85. package/node_modules/undici-types/errors.d.ts +54 -66
  86. package/node_modules/undici-types/eventsource.d.ts +4 -9
  87. package/node_modules/undici-types/fetch.d.ts +20 -22
  88. package/node_modules/undici-types/file.d.ts +39 -0
  89. package/node_modules/undici-types/filereader.d.ts +54 -0
  90. package/node_modules/undici-types/formdata.d.ts +7 -7
  91. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  92. package/node_modules/undici-types/global-origin.d.ts +5 -5
  93. package/node_modules/undici-types/handlers.d.ts +8 -8
  94. package/node_modules/undici-types/header.d.ts +1 -157
  95. package/node_modules/undici-types/index.d.ts +47 -64
  96. package/node_modules/undici-types/interceptors.d.ts +8 -64
  97. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  98. package/node_modules/undici-types/mock-client.d.ts +4 -6
  99. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  100. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  101. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  102. package/node_modules/undici-types/package.json +1 -1
  103. package/node_modules/undici-types/patch.d.ts +4 -0
  104. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  105. package/node_modules/undici-types/pool.d.ts +13 -15
  106. package/node_modules/undici-types/proxy-agent.d.ts +4 -5
  107. package/node_modules/undici-types/readable.d.ts +16 -19
  108. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  109. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  110. package/node_modules/undici-types/util.d.ts +3 -3
  111. package/node_modules/undici-types/webidl.d.ts +29 -142
  112. package/node_modules/undici-types/websocket.d.ts +10 -46
  113. package/package.json +2 -1
  114. package/skills/cleave/SKILL.md +62 -2
  115. package/node_modules/@types/node/inspector/promises.d.ts +0 -41
  116. package/node_modules/@types/node/path/posix.d.ts +0 -8
  117. package/node_modules/@types/node/path/win32.d.ts +0 -8
  118. package/node_modules/@types/node/quic.d.ts +0 -910
  119. package/node_modules/@types/node/test/reporters.d.ts +0 -96
  120. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  121. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  122. package/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  123. package/node_modules/@types/node/util/types.d.ts +0 -558
  124. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  125. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  126. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  127. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  128. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  129. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  130. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  131. package/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  132. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  133. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  134. package/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  135. package/node_modules/undici-types/client-stats.d.ts +0 -15
  136. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  137. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  138. package/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  139. package/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  140. package/node_modules/undici-types/utility.d.ts +0 -7
@@ -9,7 +9,7 @@
9
9
  * ```
10
10
  *
11
11
  * Compression and decompression are built around the Node.js
12
- * [Streams API](https://nodejs.org/docs/latest-v25.x/api/stream.html).
12
+ * [Streams API](https://nodejs.org/docs/latest-v22.x/api/stream.html).
13
13
  *
14
14
  * Compressing or decompressing a stream (such as a file) can be accomplished by
15
15
  * piping the source stream through a `zlib` `Transform` stream into a destination
@@ -89,9 +89,9 @@
89
89
  * });
90
90
  * ```
91
91
  * @since v0.5.8
92
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/zlib.js)
92
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/zlib.js)
93
93
  */
94
- declare module "node:zlib" {
94
+ declare module "zlib" {
95
95
  import { NonSharedBuffer } from "node:buffer";
96
96
  import * as stream from "node:stream";
97
97
  interface ZlibOptions {
@@ -148,7 +148,7 @@ declare module "node:zlib" {
148
148
  }
149
149
  | undefined;
150
150
  /**
151
- * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v25.x/api/zlib.html#convenience-methods).
151
+ * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
152
152
  * @default buffer.kMaxLength
153
153
  */
154
154
  maxOutputLength?: number | undefined;
@@ -172,12 +172,12 @@ declare module "node:zlib" {
172
172
  chunkSize?: number | undefined;
173
173
  /**
174
174
  * Key-value object containing indexed
175
- * [Zstd parameters](https://nodejs.org/docs/latest-v25.x/api/zlib.html#zstd-constants).
175
+ * [Zstd parameters](https://nodejs.org/docs/latest-v22.x/api/zlib.html#zstd-constants).
176
176
  */
177
177
  params?: { [key: number]: number | boolean } | undefined;
178
178
  /**
179
179
  * Limits output size when using
180
- * [convenience methods](https://nodejs.org/docs/latest-v25.x/api/zlib.html#convenience-methods).
180
+ * [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
181
181
  * @default buffer.kMaxLength
182
182
  */
183
183
  maxOutputLength?: number | undefined;
@@ -188,11 +188,13 @@ declare module "node:zlib" {
188
188
  /**
189
189
  * Optional dictionary used to improve compression efficiency when compressing or decompressing data that
190
190
  * shares common patterns with the dictionary.
191
- * @since v24.6.0
191
+ * @since v22.19.0
192
192
  */
193
193
  dictionary?: NodeJS.ArrayBufferView | undefined;
194
194
  }
195
195
  interface Zlib {
196
+ /** @deprecated Use bytesWritten instead. */
197
+ readonly bytesRead: number;
196
198
  readonly bytesWritten: number;
197
199
  shell?: boolean | string | undefined;
198
200
  close(callback?: () => void): void;
@@ -676,7 +678,70 @@ declare module "node:zlib" {
676
678
  const Z_SYNC_FLUSH: number;
677
679
  const Z_VERSION_ERROR: number;
678
680
  }
681
+ // Allowed flush values.
682
+ /** @deprecated Use `constants.Z_NO_FLUSH` */
683
+ const Z_NO_FLUSH: number;
684
+ /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */
685
+ const Z_PARTIAL_FLUSH: number;
686
+ /** @deprecated Use `constants.Z_SYNC_FLUSH` */
687
+ const Z_SYNC_FLUSH: number;
688
+ /** @deprecated Use `constants.Z_FULL_FLUSH` */
689
+ const Z_FULL_FLUSH: number;
690
+ /** @deprecated Use `constants.Z_FINISH` */
691
+ const Z_FINISH: number;
692
+ /** @deprecated Use `constants.Z_BLOCK` */
693
+ const Z_BLOCK: number;
694
+ // Return codes for the compression/decompression functions.
695
+ // Negative values are errors, positive values are used for special but normal events.
696
+ /** @deprecated Use `constants.Z_OK` */
697
+ const Z_OK: number;
698
+ /** @deprecated Use `constants.Z_STREAM_END` */
699
+ const Z_STREAM_END: number;
700
+ /** @deprecated Use `constants.Z_NEED_DICT` */
701
+ const Z_NEED_DICT: number;
702
+ /** @deprecated Use `constants.Z_ERRNO` */
703
+ const Z_ERRNO: number;
704
+ /** @deprecated Use `constants.Z_STREAM_ERROR` */
705
+ const Z_STREAM_ERROR: number;
706
+ /** @deprecated Use `constants.Z_DATA_ERROR` */
707
+ const Z_DATA_ERROR: number;
708
+ /** @deprecated Use `constants.Z_MEM_ERROR` */
709
+ const Z_MEM_ERROR: number;
710
+ /** @deprecated Use `constants.Z_BUF_ERROR` */
711
+ const Z_BUF_ERROR: number;
712
+ /** @deprecated Use `constants.Z_VERSION_ERROR` */
713
+ const Z_VERSION_ERROR: number;
714
+ // Compression levels.
715
+ /** @deprecated Use `constants.Z_NO_COMPRESSION` */
716
+ const Z_NO_COMPRESSION: number;
717
+ /** @deprecated Use `constants.Z_BEST_SPEED` */
718
+ const Z_BEST_SPEED: number;
719
+ /** @deprecated Use `constants.Z_BEST_COMPRESSION` */
720
+ const Z_BEST_COMPRESSION: number;
721
+ /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */
722
+ const Z_DEFAULT_COMPRESSION: number;
723
+ // Compression strategy.
724
+ /** @deprecated Use `constants.Z_FILTERED` */
725
+ const Z_FILTERED: number;
726
+ /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */
727
+ const Z_HUFFMAN_ONLY: number;
728
+ /** @deprecated Use `constants.Z_RLE` */
729
+ const Z_RLE: number;
730
+ /** @deprecated Use `constants.Z_FIXED` */
731
+ const Z_FIXED: number;
732
+ /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */
733
+ const Z_DEFAULT_STRATEGY: number;
734
+ /** @deprecated */
735
+ const Z_BINARY: number;
736
+ /** @deprecated */
737
+ const Z_TEXT: number;
738
+ /** @deprecated */
739
+ const Z_ASCII: number;
740
+ /** @deprecated */
741
+ const Z_UNKNOWN: number;
742
+ /** @deprecated */
743
+ const Z_DEFLATED: number;
679
744
  }
680
- declare module "zlib" {
681
- export * from "node:zlib";
745
+ declare module "node:zlib" {
746
+ export * from "zlib";
682
747
  }
@@ -1,32 +1,31 @@
1
- import { URL } from 'node:url'
1
+ import { URL } from 'url'
2
2
  import Pool from './pool'
3
- import Dispatcher from './dispatcher'
4
- import TClientStats from './client-stats'
5
- import TPoolStats from './pool-stats'
3
+ import Dispatcher from "./dispatcher";
6
4
 
7
5
  export default Agent
8
6
 
9
- declare class Agent extends Dispatcher {
10
- constructor (opts?: Agent.Options)
7
+ declare class Agent extends Dispatcher{
8
+ constructor(opts?: Agent.Options)
11
9
  /** `true` after `dispatcher.close()` has been called. */
12
- closed: boolean
10
+ closed: boolean;
13
11
  /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
14
- destroyed: boolean
12
+ destroyed: boolean;
15
13
  /** Dispatches a request. */
16
- dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
17
- /** Aggregate stats for a Agent by origin. */
18
- readonly stats: Record<string, TClientStats | TPoolStats>
14
+ dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
19
15
  }
20
16
 
21
17
  declare namespace Agent {
22
18
  export interface Options extends Pool.Options {
23
19
  /** Default: `(origin, opts) => new Pool(origin, opts)`. */
24
20
  factory?(origin: string | URL, opts: Object): Dispatcher;
21
+ /** Integer. Default: `0` */
22
+ maxRedirections?: number;
25
23
 
26
- interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
27
- maxOrigins?: number
24
+ interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"]
28
25
  }
29
26
 
30
27
  export interface DispatchOptions extends Dispatcher.DispatchOptions {
28
+ /** Integer. */
29
+ maxRedirections?: number;
31
30
  }
32
31
  }
@@ -1,43 +1,43 @@
1
- import { URL, UrlObject } from 'node:url'
2
- import { Duplex } from 'node:stream'
1
+ import { URL, UrlObject } from 'url'
2
+ import { Duplex } from 'stream'
3
3
  import Dispatcher from './dispatcher'
4
4
 
5
+ export {
6
+ request,
7
+ stream,
8
+ pipeline,
9
+ connect,
10
+ upgrade,
11
+ }
12
+
5
13
  /** Performs an HTTP request. */
6
- declare function request<TOpaque = null> (
14
+ declare function request(
7
15
  url: string | URL | UrlObject,
8
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
9
- ): Promise<Dispatcher.ResponseData<TOpaque>>
16
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
17
+ ): Promise<Dispatcher.ResponseData>;
10
18
 
11
19
  /** A faster version of `request`. */
12
- declare function stream<TOpaque = null> (
20
+ declare function stream(
13
21
  url: string | URL | UrlObject,
14
- options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path'>,
15
- factory: Dispatcher.StreamFactory<TOpaque>
16
- ): Promise<Dispatcher.StreamData<TOpaque>>
22
+ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path'>,
23
+ factory: Dispatcher.StreamFactory
24
+ ): Promise<Dispatcher.StreamData>;
17
25
 
18
26
  /** For easy use with `stream.pipeline`. */
19
- declare function pipeline<TOpaque = null> (
27
+ declare function pipeline(
20
28
  url: string | URL | UrlObject,
21
- options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions<TOpaque>, 'origin' | 'path'>,
22
- handler: Dispatcher.PipelineHandler<TOpaque>
23
- ): Duplex
29
+ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions, 'origin' | 'path'>,
30
+ handler: Dispatcher.PipelineHandler
31
+ ): Duplex;
24
32
 
25
33
  /** Starts two-way communications with the requested resource. */
26
- declare function connect<TOpaque = null> (
34
+ declare function connect(
27
35
  url: string | URL | UrlObject,
28
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin' | 'path'>
29
- ): Promise<Dispatcher.ConnectData<TOpaque>>
36
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
37
+ ): Promise<Dispatcher.ConnectData>;
30
38
 
31
39
  /** Upgrade to a different protocol. */
32
- declare function upgrade (
40
+ declare function upgrade(
33
41
  url: string | URL | UrlObject,
34
42
  options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
35
- ): Promise<Dispatcher.UpgradeData>
36
-
37
- export {
38
- request,
39
- stream,
40
- pipeline,
41
- connect,
42
- upgrade
43
- }
43
+ ): Promise<Dispatcher.UpgradeData>;
@@ -1,30 +1,29 @@
1
1
  import Pool from './pool'
2
2
  import Dispatcher from './dispatcher'
3
- import { URL } from 'node:url'
3
+ import { URL } from 'url'
4
4
 
5
5
  export default BalancedPool
6
6
 
7
- type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
7
+ type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
8
8
 
9
9
  declare class BalancedPool extends Dispatcher {
10
- constructor (url: string | string[] | URL | URL[], options?: Pool.Options)
10
+ constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
11
11
 
12
- addUpstream (upstream: string | URL): BalancedPool
13
- removeUpstream (upstream: string | URL): BalancedPool
14
- getUpstream (upstream: string | URL): Pool | undefined
15
- upstreams: Array<string>
12
+ addUpstream(upstream: string | URL): BalancedPool;
13
+ removeUpstream(upstream: string | URL): BalancedPool;
14
+ upstreams: Array<string>;
16
15
 
17
16
  /** `true` after `pool.close()` has been called. */
18
- closed: boolean
17
+ closed: boolean;
19
18
  /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
20
- destroyed: boolean
19
+ destroyed: boolean;
21
20
 
22
21
  // Override dispatcher APIs.
23
- override connect (
22
+ override connect(
24
23
  options: BalancedPoolConnectOptions
25
- ): Promise<Dispatcher.ConnectData>
26
- override connect (
24
+ ): Promise<Dispatcher.ConnectData>;
25
+ override connect(
27
26
  options: BalancedPoolConnectOptions,
28
27
  callback: (err: Error | null, data: Dispatcher.ConnectData) => void
29
- ): void
28
+ ): void;
30
29
  }
@@ -1,32 +1,30 @@
1
- import { URL } from 'node:url'
1
+ import { URL } from 'url'
2
+ import { TlsOptions } from 'tls'
2
3
  import Dispatcher from './dispatcher'
3
- import buildConnector from './connector'
4
- import TClientStats from './client-stats'
4
+ import buildConnector from "./connector";
5
5
 
6
- type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
6
+ type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
7
7
 
8
8
  /**
9
9
  * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
10
10
  */
11
11
  export class Client extends Dispatcher {
12
- constructor (url: string | URL, options?: Client.Options)
12
+ constructor(url: string | URL, options?: Client.Options);
13
13
  /** Property to get and set the pipelining factor. */
14
- pipelining: number
14
+ pipelining: number;
15
15
  /** `true` after `client.close()` has been called. */
16
- closed: boolean
16
+ closed: boolean;
17
17
  /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
18
- destroyed: boolean
19
- /** Aggregate stats for a Client. */
20
- readonly stats: TClientStats
18
+ destroyed: boolean;
21
19
 
22
20
  // Override dispatcher APIs.
23
- override connect (
21
+ override connect(
24
22
  options: ClientConnectOptions
25
- ): Promise<Dispatcher.ConnectData>
26
- override connect (
23
+ ): Promise<Dispatcher.ConnectData>;
24
+ override connect(
27
25
  options: ClientConnectOptions,
28
26
  callback: (err: Error | null, data: Dispatcher.ConnectData) => void
29
- ): void
27
+ ): void;
30
28
  }
31
29
 
32
30
  export declare namespace Client {
@@ -71,7 +69,9 @@ export declare namespace Client {
71
69
  /** TODO */
72
70
  maxCachedSessions?: number;
73
71
  /** TODO */
74
- connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
72
+ maxRedirections?: number;
73
+ /** TODO */
74
+ connect?: buildConnector.BuildOptions | buildConnector.connector;
75
75
  /** TODO */
76
76
  maxRequestsPerClient?: number;
77
77
  /** TODO */
@@ -85,13 +85,13 @@ export declare namespace Client {
85
85
  /**
86
86
  * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
87
87
  * @default false
88
- */
88
+ */
89
89
  allowH2?: boolean;
90
90
  /**
91
91
  * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
92
92
  * @default 100
93
- */
94
- maxConcurrentStreams?: number;
93
+ */
94
+ maxConcurrentStreams?: number
95
95
  }
96
96
  export interface SocketInfo {
97
97
  localAddress?: string
@@ -105,4 +105,4 @@ export declare namespace Client {
105
105
  }
106
106
  }
107
107
 
108
- export default Client
108
+ export default Client;
@@ -1,5 +1,5 @@
1
- import { TLSSocket, ConnectionOptions } from 'node:tls'
2
- import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'node:net'
1
+ import { TLSSocket, ConnectionOptions } from 'tls'
2
+ import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'net'
3
3
 
4
4
  export default buildConnector
5
5
  declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector
@@ -26,5 +26,3 @@ export function getCookies (headers: Headers): Record<string, string>
26
26
  export function getSetCookies (headers: Headers): Cookie[]
27
27
 
28
28
  export function setCookie (headers: Headers, cookie: Cookie): void
29
-
30
- export function parseCookie (cookie: string): Cookie | null
@@ -1,7 +1,7 @@
1
- import { Socket } from 'node:net'
2
- import { URL } from 'node:url'
3
- import buildConnector from './connector'
4
- import Dispatcher from './dispatcher'
1
+ import { Socket } from "net";
2
+ import { URL } from "url";
3
+ import Connector from "./connector";
4
+ import Dispatcher from "./dispatcher";
5
5
 
6
6
  declare namespace DiagnosticsChannel {
7
7
  interface Request {
@@ -16,29 +16,21 @@ declare namespace DiagnosticsChannel {
16
16
  statusText: string;
17
17
  headers: Array<Buffer>;
18
18
  }
19
+ type Error = unknown;
19
20
  interface ConnectParams {
20
- host: URL['host'];
21
- hostname: URL['hostname'];
22
- protocol: URL['protocol'];
23
- port: URL['port'];
21
+ host: URL["host"];
22
+ hostname: URL["hostname"];
23
+ protocol: URL["protocol"];
24
+ port: URL["port"];
24
25
  servername: string | null;
25
26
  }
26
- type Connector = buildConnector.connector
27
+ type Connector = Connector.connector;
27
28
  export interface RequestCreateMessage {
28
29
  request: Request;
29
30
  }
30
31
  export interface RequestBodySentMessage {
31
32
  request: Request;
32
33
  }
33
-
34
- export interface RequestBodyChunkSentMessage {
35
- request: Request;
36
- chunk: Uint8Array | string;
37
- }
38
- export interface RequestBodyChunkReceivedMessage {
39
- request: Request;
40
- chunk: Buffer;
41
- }
42
34
  export interface RequestHeadersMessage {
43
35
  request: Request;
44
36
  response: Response;