Skip to content

Commit 6890a47

Browse files
authored
fix(packages): use HashConstructor instead of { new: Hash } (#2638)
1 parent 30831c7 commit 6890a47

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Diff for: packages/middleware-apply-body-checksum/src/md5Configuration.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Encoder, Hash, StreamHasher } from "@aws-sdk/types";
1+
import { Encoder, HashConstructor, StreamHasher } from "@aws-sdk/types";
22

33
export interface Md5BodyChecksumInputConfig {}
44
interface PreviouslyResolved {
5-
md5: { new (): Hash };
5+
md5: HashConstructor;
66
base64Encoder: Encoder;
77
streamHasher: StreamHasher<any>;
88
}
@@ -12,7 +12,7 @@ export interface Md5BodyChecksumResolvedConfig {
1212
* A constructor for a class implementing the @aws-sdk/types.Hash interface that computes MD5 hashes.
1313
* @internal
1414
*/
15-
md5: { new (): Hash };
15+
md5: HashConstructor;
1616
/**
1717
* The function that will be used to convert binary data to a base64-encoded string.
1818
* @internal

Diff for: packages/middleware-sdk-sqs/src/configurations.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Hash } from "@aws-sdk/types";
1+
import { HashConstructor } from "@aws-sdk/types";
22

33
export interface PreviouslyResolved {
4-
md5: { new (): Hash };
4+
md5: HashConstructor;
55
}

Diff for: packages/middleware-ssec/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
Decoder,
33
Encoder,
4-
Hash,
4+
HashConstructor,
55
InitializeHandler,
66
InitializeHandlerArguments,
77
InitializeHandlerOptions,
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414
interface PreviouslyResolved {
1515
base64Encoder: Encoder;
16-
md5: { new (): Hash };
16+
md5: HashConstructor;
1717
utf8Decoder: Decoder;
1818
}
1919

Diff for: packages/types/src/crypto.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface HashConstructor {
3838
* implementation of this interface.
3939
*/
4040
export interface StreamHasher<StreamType = any> {
41-
(hashCtor: { new (): Hash }, stream: StreamType): Promise<Uint8Array>;
41+
(hashCtor: HashConstructor, stream: StreamType): Promise<Uint8Array>;
4242
}
4343

4444
/**

0 commit comments

Comments
 (0)