@@ -3,19 +3,27 @@ import { Handler } from "../handler";
33// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
44export type DynamoDBStreamHandler = Handler < DynamoDBStreamEvent , DynamoDBBatchResponse | void > ;
55
6+ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers, @definitelytyped/no-single-element-tuple-type
7+ type Merge < T > = [ { [ K in keyof T ] : T [ K ] } ] [ number ] ;
8+
9+ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
10+ type ExclusivePropertyUnion < T , P = keyof T > = P extends any
11+ ? Merge < { [ K in Extract < keyof T , P > ] : T [ K ] } & { [ K in Exclude < keyof T , P > ] ?: never } >
12+ : never ;
13+
614// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html
7- export interface AttributeValue {
8- B ? : string | undefined ;
9- BS ?: string [ ] | undefined ;
10- BOOL ?: boolean | undefined ;
11- L ? : AttributeValue [ ] | undefined ;
12- M ?: { [ id : string ] : AttributeValue } | undefined ;
13- N ? : string | undefined ;
14- NS ? : string [ ] | undefined ;
15- NULL ? : boolean | undefined ;
16- S ? : string | undefined ;
17- SS ? : string [ ] | undefined ;
18- }
15+ export type AttributeValue = ExclusivePropertyUnion < {
16+ B : string ;
17+ BOOL : boolean ;
18+ BS : string [ ] ;
19+ L : AttributeValue [ ] ;
20+ M : Record < string , AttributeValue > ;
21+ N : string ;
22+ NS : string [ ] ;
23+ NULL : boolean ;
24+ S : string ;
25+ SS : string [ ] ;
26+ } > ;
1927
2028// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html
2129export interface StreamRecord {
0 commit comments