diff --git a/packages/middleware-flexible-checksums/src/configuration.ts b/packages/middleware-flexible-checksums/src/configuration.ts index 6f8a0f04f0c2..5cb4e03109f0 100644 --- a/packages/middleware-flexible-checksums/src/configuration.ts +++ b/packages/middleware-flexible-checksums/src/configuration.ts @@ -1,4 +1,10 @@ -import { Encoder, GetAwsChunkedEncodingStream, HashConstructor, StreamHasher } from "@aws-sdk/types"; +import { + BodyLengthCalculator, + Encoder, + GetAwsChunkedEncodingStream, + HashConstructor, + StreamHasher, +} from "@aws-sdk/types"; export interface PreviouslyResolved { /** @@ -10,7 +16,7 @@ export interface PreviouslyResolved { /** * A function that can calculate the length of a body. */ - bodyLengthChecker: (body: any) => number | undefined; + bodyLengthChecker: BodyLengthCalculator; /** * A function that returns Readable Stream which follows aws-chunked encoding stream. diff --git a/packages/types/src/stream.ts b/packages/types/src/stream.ts index 6b817c965e60..b832c1dc81ca 100644 --- a/packages/types/src/stream.ts +++ b/packages/types/src/stream.ts @@ -1,9 +1,9 @@ import { HashConstructor, StreamHasher } from "./crypto"; -import { Encoder } from "./util"; +import { BodyLengthCalculator, Encoder } from "./util"; export interface GetAwsChunkedEncodingStreamOptions { base64Encoder?: Encoder; - bodyLengthChecker: (body: any) => number | undefined; + bodyLengthChecker: BodyLengthCalculator; checksumAlgorithmFn?: HashConstructor; checksumLocationName?: string; streamHasher?: StreamHasher;