UNPKG

1.63 kBTypeScriptView Raw
1import { Command } from "./command";
2import { MiddlewareStack } from "./middleware";
3import { MetadataBearer } from "./response";
4/**
5 * @public
6 *
7 * function definition for different overrides of client's 'send' function.
8 */
9interface InvokeFunction<InputTypes extends object, OutputTypes extends MetadataBearer, ResolvedClientConfiguration> {
10 <InputType extends InputTypes, OutputType extends OutputTypes>(command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, options?: any): Promise<OutputType>;
11 <InputType extends InputTypes, OutputType extends OutputTypes>(command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, options: any, cb: (err: any, data?: OutputType) => void): void;
12 <InputType extends InputTypes, OutputType extends OutputTypes>(command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, options?: any, cb?: (err: any, data?: OutputType) => void): Promise<OutputType> | void;
13}
14/**
15 * A general interface for service clients, idempotent to browser or node clients
16 * This type corresponds to SmithyClient(https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/src/client.ts).
17 * It's provided for using without importing the SmithyClient class.
18 */
19export interface Client<Input extends object, Output extends MetadataBearer, ResolvedClientConfiguration> {
20 readonly config: ResolvedClientConfiguration;
21 middlewareStack: MiddlewareStack<Input, Output>;
22 send: InvokeFunction<Input, Output, ResolvedClientConfiguration>;
23 destroy: () => void;
24}
25export {};
26
\No newline at end of file