· 7 years ago · Feb 12, 2018, 10:36 PM
1declare module 'aws-api-gateway-client' {
2 import { AxiosResponse } from 'axios'
3
4 interface AwsApiGatewayClientConfig {
5 accessKey?: string
6 secretKey?: string
7 sessionToken?: string
8 region?: string
9 apiKey?: string
10 invokeUrl: string
11 service?: string
12 defaultContentType?: string
13 defaultAcceptType?: string
14 systemClockOffset?: number
15 }
16
17 interface AwsApiGatewayClient {
18 invokeApi: <T>(
19 params: Object,
20 pathTemplate: string,
21 method: string,
22 additionalParams?: {
23 headers?: { Authorization?: string } | { [key: string]: string }
24 queryParams?: any
25 },
26 body?: any
27 ) => Promise<AxiosResponse<T>>
28 }
29
30 export const newClient: (config: AwsApiGatewayClientConfig) => AwsApiGatewayClient
31}