undici-types 7.13.0 → 7.15.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/diagnostics-channel.d.ts +0 -1
- package/eventsource.d.ts +6 -1
- package/index.d.ts +4 -1
- package/interceptors.d.ts +5 -0
- package/package.json +1 -1
- package/snapshot-agent.d.ts +5 -3
package/diagnostics-channel.d.ts
CHANGED
package/eventsource.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export declare const EventSource: {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
interface EventSourceInit {
|
|
59
|
-
withCredentials?: boolean
|
|
59
|
+
withCredentials?: boolean
|
|
60
|
+
// @deprecated use `node.dispatcher` instead
|
|
60
61
|
dispatcher?: Dispatcher
|
|
62
|
+
node?: {
|
|
63
|
+
dispatcher?: Dispatcher
|
|
64
|
+
reconnectionTime?: number
|
|
65
|
+
}
|
|
61
66
|
}
|
package/index.d.ts
CHANGED
|
@@ -34,7 +34,9 @@ export * from './content-type'
|
|
|
34
34
|
export * from './cache'
|
|
35
35
|
export { Interceptable } from './mock-interceptor'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
declare function globalThisInstall (): void
|
|
38
|
+
|
|
39
|
+
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
|
|
38
40
|
export default Undici
|
|
39
41
|
|
|
40
42
|
declare namespace Undici {
|
|
@@ -74,4 +76,5 @@ declare namespace Undici {
|
|
|
74
76
|
MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore,
|
|
75
77
|
SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore
|
|
76
78
|
}
|
|
79
|
+
const install: typeof globalThisInstall
|
|
77
80
|
}
|
package/interceptors.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ declare namespace Interceptors {
|
|
|
9
9
|
export type DumpInterceptorOpts = { maxSize?: number }
|
|
10
10
|
export type RetryInterceptorOpts = RetryHandler.RetryOptions
|
|
11
11
|
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
|
12
|
+
export type DecompressInterceptorOpts = {
|
|
13
|
+
skipErrorResponses?: boolean
|
|
14
|
+
skipStatusCodes?: number[]
|
|
15
|
+
}
|
|
12
16
|
|
|
13
17
|
export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
|
|
14
18
|
export type CacheInterceptorOpts = CacheHandler.CacheOptions
|
|
@@ -28,6 +32,7 @@ declare namespace Interceptors {
|
|
|
28
32
|
export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
29
33
|
export function retry (opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
30
34
|
export function redirect (opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
35
|
+
export function decompress (opts?: DecompressInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
31
36
|
export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
32
37
|
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
33
38
|
export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
package/package.json
CHANGED
package/snapshot-agent.d.ts
CHANGED
|
@@ -18,9 +18,11 @@ declare class SnapshotRecorder {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
declare namespace SnapshotRecorder {
|
|
21
|
+
type SnapshotRecorderMode = 'record' | 'playback' | 'update'
|
|
22
|
+
|
|
21
23
|
export interface Options {
|
|
22
24
|
snapshotPath?: string
|
|
23
|
-
mode?:
|
|
25
|
+
mode?: SnapshotRecorderMode
|
|
24
26
|
maxSnapshots?: number
|
|
25
27
|
autoFlush?: boolean
|
|
26
28
|
flushInterval?: number
|
|
@@ -77,7 +79,7 @@ declare class SnapshotAgent extends MockAgent {
|
|
|
77
79
|
saveSnapshots (filePath?: string): Promise<void>
|
|
78
80
|
loadSnapshots (filePath?: string): Promise<void>
|
|
79
81
|
getRecorder (): SnapshotRecorder
|
|
80
|
-
getMode ():
|
|
82
|
+
getMode (): SnapshotRecorder.SnapshotRecorderMode
|
|
81
83
|
clearSnapshots (): void
|
|
82
84
|
resetCallCounts (): void
|
|
83
85
|
deleteSnapshot (requestOpts: any): boolean
|
|
@@ -87,7 +89,7 @@ declare class SnapshotAgent extends MockAgent {
|
|
|
87
89
|
|
|
88
90
|
declare namespace SnapshotAgent {
|
|
89
91
|
export interface Options extends MockAgent.Options {
|
|
90
|
-
mode?:
|
|
92
|
+
mode?: SnapshotRecorder.SnapshotRecorderMode
|
|
91
93
|
snapshotPath?: string
|
|
92
94
|
maxSnapshots?: number
|
|
93
95
|
autoFlush?: boolean
|