-
-
Notifications
You must be signed in to change notification settings - Fork 376
/
index.d.ts
69 lines (55 loc) · 1.71 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import middy from '@middy/core'
interface Options<Client, ClientOptions> {
AwsClient?: new (...args: any[]) => Client
awsClientOptions?: Partial<ClientOptions>
awsClientAssumeRole?: string
awsClientCapture?: (service: Client) => Client
fetchData?: { [key: string]: string }
disablePrefetch?: boolean
cacheKey?: string
cacheExpiry?: number
setToContext?: boolean
}
declare class HttpError extends Error {
status: number
statusCode: number
expose: boolean
[key: string]: any
[key: number]: any
}
declare function createPrefetchClient<Client, ClientOptions> (
options: Options<Client, ClientOptions>
): Client
declare function createClient<Client, ClientOptions> (
options: Options<Client, ClientOptions>,
request: middy.Request
): Promise<Client>
declare function canPrefetch<Client, ClientOptions> (
options: Options<Client, ClientOptions>
): boolean
declare function getInternal (
variables: any,
request: middy.Request
): Promise<any>
declare function sanitizeKey (key: string): string
declare function processCache<Client, ClientOptions> (
options: Options<Client, ClientOptions>,
fetch: (request: middy.Request, cachedValues: any) => any,
request?: middy.Request
): { value: any, expiry: number }
declare function getCache (keys: string): any
declare function clearCache (keys?: string | string[] | null): void
declare function jsonSafeParse (
string: string,
reviver?: (key: string, value: any) => any
): any
declare function normalizeHttpResponse (
request: any,
fallbackResponse?: any
): any
declare function createError (
code: number,
message: string,
properties?: Record<string, any>
): HttpError
declare function modifyCache (cacheKey: string, value: any): void