undici-types 6.13.0 → 6.14.1

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 CHANGED
@@ -217,7 +217,7 @@ declare namespace Dispatcher {
217
217
  export type StreamFactory = (data: StreamFactoryData) => Writable;
218
218
  export interface DispatchHandlers {
219
219
  /** 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. */
220
- onConnect?(abort: () => void): void;
220
+ onConnect?(abort: (err?: Error) => void): void;
221
221
  /** Invoked when an error has occurred. */
222
222
  onError?(err: Error): void;
223
223
  /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
@@ -0,0 +1,21 @@
1
+ import Agent from './agent'
2
+ import Dispatcher from './dispatcher'
3
+
4
+ export default EnvHttpProxyAgent
5
+
6
+ declare class EnvHttpProxyAgent extends Dispatcher {
7
+ constructor(opts?: EnvHttpProxyAgent.Options)
8
+
9
+ dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
10
+ }
11
+
12
+ declare namespace EnvHttpProxyAgent {
13
+ export interface Options extends Agent.Options {
14
+ /** Overrides the value of the HTTP_PROXY environment variable */
15
+ httpProxy?: string;
16
+ /** Overrides the value of the HTTPS_PROXY environment variable */
17
+ httpsProxy?: string;
18
+ /** Overrides the value of the NO_PROXY environment variable */
19
+ noProxy?: string;
20
+ }
21
+ }
package/eventsource.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { MessageEvent, ErrorEvent } from './websocket'
2
+ import Dispatcher from './dispatcher'
2
3
 
3
4
  import {
4
5
  EventTarget,
@@ -50,12 +51,13 @@ interface EventSource extends EventTarget {
50
51
 
51
52
  export declare const EventSource: {
52
53
  prototype: EventSource
53
- new (url: string | URL, init: EventSourceInit): EventSource
54
+ new (url: string | URL, init?: EventSourceInit): EventSource
54
55
  readonly CLOSED: 2
55
56
  readonly CONNECTING: 0
56
57
  readonly OPEN: 1
57
58
  }
58
59
 
59
60
  interface EventSourceInit {
60
- withCredentials?: boolean
61
+ withCredentials?: boolean,
62
+ dispatcher?: Dispatcher
61
63
  }
package/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import MockPool from'./mock-pool'
14
14
  import MockAgent from'./mock-agent'
15
15
  import mockErrors from'./mock-errors'
16
16
  import ProxyAgent from'./proxy-agent'
17
+ import EnvHttpProxyAgent from './env-http-proxy-agent'
17
18
  import RetryHandler from'./retry-handler'
18
19
  import RetryAgent from'./retry-agent'
19
20
  import { request, pipeline, stream, connect, upgrade } from './api'
@@ -31,7 +32,7 @@ export * from './content-type'
31
32
  export * from './cache'
32
33
  export { Interceptable } from './mock-interceptor'
33
34
 
34
- export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent }
35
+ export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent }
35
36
  export default Undici
36
37
 
37
38
  declare namespace Undici {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "6.13.0",
3
+ "version": "6.14.1",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {