forked from getndazn/dazn-lambda-powertools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
51 lines (44 loc) · 1.33 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
import middy from "@middy/core";
import { Callback, Context } from "aws-lambda";
export * from "@dazn/lambda-powertools-middleware-correlation-ids";
declare type EventType<T, C> = T extends (
event: infer EventArgType,
context: C,
callback: Callback<any>
) => void
? EventArgType
: T extends (event: infer EventArgType, context: C) => Promise<any>
? EventArgType
: never;
declare type HandlerReturnType<T, C> = T extends (
event: any,
context: C
) => Promise<infer RetType>
? RetType
: T extends (
event: any,
context: C,
callback: Callback<infer RetType>
) => void
? RetType
: never;
declare type AsyncHandler<C extends Context> =
| ((event: any, context: C, callback: Callback<any>) => void)
| ((event: any, context: C) => Promise<any>);
declare enum FILTERING_MODE {
BLACKLIST = "BLACKLIST",
WHITELIST = "WHITELIST",
}
declare namespace dazn__lambda_powertools_pattern_obfuscate {
const FILTERING_MODE: FILTERING_MODE;
function obfuscaterPattern<
H extends AsyncHandler<C>,
C extends Context = Context
>(
obfuscationFilters: string[],
f: H,
filterOnAfter?: boolean,
filteringMode?: FILTERING_MODE
): middy.Middy<EventType<H, C>, HandlerReturnType<H, C>, C>;
}
export default dazn__lambda_powertools_pattern_obfuscate;