undici-types 7.24.7 → 8.0.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.
- package/dispatcher.d.ts +5 -21
- package/dispatcher1-wrapper.d.ts +7 -0
- package/index.d.ts +3 -1
- package/package.json +1 -1
package/dispatcher.d.ts
CHANGED
|
@@ -212,6 +212,8 @@ declare namespace Dispatcher {
|
|
|
212
212
|
get aborted(): boolean
|
|
213
213
|
get paused(): boolean
|
|
214
214
|
get reason(): Error | null
|
|
215
|
+
rawHeaders?: Buffer[] | string[] | null
|
|
216
|
+
rawTrailers?: Buffer[] | string[] | null
|
|
215
217
|
abort(reason: Error): void
|
|
216
218
|
pause(): void
|
|
217
219
|
resume(): void
|
|
@@ -225,30 +227,12 @@ declare namespace Dispatcher {
|
|
|
225
227
|
onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
|
|
226
228
|
onResponseError?(controller: DispatchController, error: Error): void;
|
|
227
229
|
|
|
228
|
-
/** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
|
|
229
|
-
/** @deprecated */
|
|
230
|
-
onConnect?(abort: (err?: Error) => void): void;
|
|
231
|
-
/** Invoked when an error has occurred. */
|
|
232
|
-
/** @deprecated */
|
|
233
|
-
onError?(err: Error): void;
|
|
234
|
-
/** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
|
|
235
|
-
/** @deprecated */
|
|
236
|
-
onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
|
|
237
230
|
/** Invoked when response is received, before headers have been read. **/
|
|
238
|
-
/** @deprecated */
|
|
239
231
|
onResponseStarted?(): void;
|
|
240
|
-
/** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
|
|
241
|
-
/** @deprecated */
|
|
242
|
-
onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
|
|
243
|
-
/** Invoked when response payload data is received. */
|
|
244
|
-
/** @deprecated */
|
|
245
|
-
onData?(chunk: Buffer): boolean;
|
|
246
|
-
/** Invoked when response payload and trailers have been received and the request has completed. */
|
|
247
|
-
/** @deprecated */
|
|
248
|
-
onComplete?(trailers: string[] | null): void;
|
|
249
232
|
/** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
|
|
250
|
-
|
|
251
|
-
|
|
233
|
+
onBodySent?(chunk: Buffer): void;
|
|
234
|
+
/** Invoked after the request body is fully sent. */
|
|
235
|
+
onRequestSent?(): void;
|
|
252
236
|
}
|
|
253
237
|
export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable
|
|
254
238
|
export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>
|
package/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import H2CClient from './h2c-client'
|
|
|
11
11
|
import buildConnector from './connector'
|
|
12
12
|
import errors from './errors'
|
|
13
13
|
import Agent from './agent'
|
|
14
|
+
import Dispatcher1Wrapper from './dispatcher1-wrapper'
|
|
14
15
|
import MockClient from './mock-client'
|
|
15
16
|
import MockPool from './mock-pool'
|
|
16
17
|
import MockAgent from './mock-agent'
|
|
@@ -44,7 +45,7 @@ export { Interceptable } from './mock-interceptor'
|
|
|
44
45
|
|
|
45
46
|
declare function globalThisInstall (): void
|
|
46
47
|
|
|
47
|
-
export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, Socks5ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
|
|
48
|
+
export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, Dispatcher1Wrapper, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, Socks5ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
|
|
48
49
|
export default Undici
|
|
49
50
|
|
|
50
51
|
declare namespace Undici {
|
|
@@ -60,6 +61,7 @@ declare namespace Undici {
|
|
|
60
61
|
const buildConnector: typeof import('./connector').default
|
|
61
62
|
const errors: typeof import('./errors').default
|
|
62
63
|
const Agent: typeof import('./agent').default
|
|
64
|
+
const Dispatcher1Wrapper: typeof import('./dispatcher1-wrapper').default
|
|
63
65
|
const setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher
|
|
64
66
|
const getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher
|
|
65
67
|
const request: typeof import('./api').request
|