66import { CredentialsShim } from '../auth/deprecated/loginManager'
77import { AwsContext } from './awsContext'
88import { AwsCredentialIdentityProvider , RetryStrategyV2 } from '@smithy/types'
9- import { Client as IClient } from '@smithy/types'
109import { getUserAgent } from './telemetry/util'
1110import { DevSettings } from './settings'
1211import {
@@ -16,6 +15,7 @@ import {
1615 HandlerExecutionContext ,
1716 HttpHandlerOptions ,
1817 MetadataBearer ,
18+ MiddlewareStack ,
1919 Provider ,
2020 RetryStrategy ,
2121 UserAgent ,
@@ -28,13 +28,15 @@ import { extensionVersion } from '.'
2828import { getLogger } from './logger'
2929import { omitIfPresent } from './utilities/tsUtils'
3030import { Client , SmithyResolvedConfiguration } from '@aws-sdk/smithy-client'
31- export type AwsClient = IClient < object , MetadataBearer , any >
32- export type AwsClientClass = Client <
33- HttpHandlerOptions ,
34- any ,
35- MetadataBearer ,
36- SmithyResolvedConfiguration < HttpHandlerOptions >
37- >
31+
32+ export type AwsClient = Client < HttpHandlerOptions , any , MetadataBearer , SmithyResolvedConfiguration < HttpHandlerOptions > >
33+ export type AwsClientConstructor < C > = new ( o : AwsClientOptions ) => C
34+
35+ interface AwsClient2 {
36+ middlewareStack : AwsMiddlewareStack
37+ }
38+
39+ type AwsMiddlewareStack = any
3840interface AwsConfigOptions {
3941 credentials : AwsCredentialIdentityProvider
4042 region : string | Provider < string >
@@ -47,8 +49,8 @@ interface AwsConfigOptions {
4749export type AwsClientOptions = AwsConfigOptions
4850
4951export interface AWSClientBuilderV3 {
50- createAwsService < C extends AwsClientClass > (
51- type : new ( o : AwsClientOptions ) => C ,
52+ createAwsService < C extends AwsClient2 > (
53+ type : AwsClientConstructor < C > ,
5254 options ?: Partial < AwsClientOptions > ,
5355 region ?: string ,
5456 userAgent ?: boolean ,
@@ -67,8 +69,8 @@ export class DefaultAWSClientBuilderV3 implements AWSClientBuilderV3 {
6769 return shim
6870 }
6971
70- public async createAwsService < C extends AwsClientClass > (
71- type : new ( o : AwsClientOptions ) => C ,
72+ public async createAwsService < C extends AwsClient2 > (
73+ type : AwsClientConstructor < C > ,
7274 options ?: Partial < AwsClientOptions > ,
7375 region ?: string ,
7476 userAgent : boolean = true ,
0 commit comments