@@ -8,10 +8,11 @@ import { requestTimeout } from "./request-timeout";
88
99declare let AbortController : any ;
1010
11+ /**
12+ * @public
13+ */
1114export { FetchHttpHandlerOptions } ;
1215
13- type FetchHttpHandlerConfig = FetchHttpHandlerOptions ;
14-
1516/**
1617 * @internal
1718 * Detection of keepalive support. Can be overridden for testing.
@@ -35,9 +36,9 @@ export type AdditionalRequestParameters = {
3536 *
3637 * HttpHandler implementation using browsers' `fetch` global function.
3738 */
38- export class FetchHttpHandler implements HttpHandler < FetchHttpHandlerConfig > {
39- private config ?: FetchHttpHandlerConfig ;
40- private configProvider : Promise < FetchHttpHandlerConfig > ;
39+ export class FetchHttpHandler implements HttpHandler < FetchHttpHandlerOptions > {
40+ private config ?: FetchHttpHandlerOptions ;
41+ private configProvider : Promise < FetchHttpHandlerOptions > ;
4142
4243 /**
4344 * @returns the input if it is an HttpHandler of any class,
@@ -51,7 +52,7 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
5152 return instanceOrOptions as HttpHandler < any > ;
5253 }
5354 // input is ctor options or undefined.
54- return new FetchHttpHandler ( instanceOrOptions as FetchHttpHandlerConfig ) ;
55+ return new FetchHttpHandler ( instanceOrOptions as FetchHttpHandlerOptions ) ;
5556 }
5657
5758 constructor ( options ?: FetchHttpHandlerOptions | Provider < FetchHttpHandlerOptions | void > ) {
@@ -199,15 +200,15 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
199200 return Promise . race ( raceOfPromises ) . finally ( removeSignalEventListener ) ;
200201 }
201202
202- updateHttpClientConfig ( key : keyof FetchHttpHandlerConfig , value : FetchHttpHandlerConfig [ typeof key ] ) : void {
203+ updateHttpClientConfig ( key : keyof FetchHttpHandlerOptions , value : FetchHttpHandlerOptions [ typeof key ] ) : void {
203204 this . config = undefined ;
204205 this . configProvider = this . configProvider . then ( ( config ) => {
205206 ( config as Record < typeof key , typeof value > ) [ key ] = value ;
206207 return config ;
207208 } ) ;
208209 }
209210
210- httpHandlerConfigs ( ) : FetchHttpHandlerConfig {
211+ httpHandlerConfigs ( ) : FetchHttpHandlerOptions {
211212 return this . config ?? { } ;
212213 }
213214}
0 commit comments