File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @smithy/fetch-http-handler " : patch
3
+ " @smithy/node-http-handler " : patch
4
+ ---
5
+
6
+ align ctor and static creation signatures for http handlers
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
32
32
* @returns the input if it is an HttpHandler of any class,
33
33
* or instantiates a new instance of this handler.
34
34
*/
35
- public static create ( instanceOrOptions ?: HttpHandler < any > | FetchHttpHandlerConfig ) {
35
+ public static create (
36
+ instanceOrOptions ?: HttpHandler < any > | FetchHttpHandlerOptions | Provider < FetchHttpHandlerOptions | void >
37
+ ) {
36
38
if ( typeof ( instanceOrOptions as any ) ?. handle === "function" ) {
37
39
// is already an instance of HttpHandler.
38
40
return instanceOrOptions as HttpHandler < any > ;
@@ -41,7 +43,7 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
41
43
return new FetchHttpHandler ( instanceOrOptions as FetchHttpHandlerConfig ) ;
42
44
}
43
45
44
- constructor ( options ?: FetchHttpHandlerOptions | Provider < FetchHttpHandlerOptions | undefined > ) {
46
+ constructor ( options ?: FetchHttpHandlerOptions | Provider < FetchHttpHandlerOptions | void > ) {
45
47
if ( typeof options === "function" ) {
46
48
this . configProvider = options ( ) . then ( ( opts ) => opts || { } ) ;
47
49
} else {
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ export class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {
34
34
* @returns the input if it is an HttpHandler of any class,
35
35
* or instantiates a new instance of this handler.
36
36
*/
37
- public static create ( instanceOrOptions ?: HttpHandler < any > | NodeHttpHandlerOptions ) {
37
+ public static create (
38
+ instanceOrOptions ?: HttpHandler < any > | NodeHttpHandlerOptions | Provider < NodeHttpHandlerOptions | void >
39
+ ) {
38
40
if ( typeof ( instanceOrOptions as any ) ?. handle === "function" ) {
39
41
// is already an instance of HttpHandler.
40
42
return instanceOrOptions as HttpHandler < any > ;
Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ export class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOptions> {
53
53
* @returns the input if it is an HttpHandler of any class,
54
54
* or instantiates a new instance of this handler.
55
55
*/
56
- public static create ( instanceOrOptions ?: HttpHandler < any > | NodeHttp2HandlerOptions ) {
56
+ public static create (
57
+ instanceOrOptions ?: HttpHandler < any > | NodeHttp2HandlerOptions | Provider < NodeHttp2HandlerOptions | void >
58
+ ) {
57
59
if ( typeof ( instanceOrOptions as any ) ?. handle === "function" ) {
58
60
// is already an instance of HttpHandler.
59
61
return instanceOrOptions as HttpHandler < any > ;
You can’t perform that action at this time.
0 commit comments