forked from awslabs/kinesis-aggregation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
35 lines (30 loc) · 1.25 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
import {Kinesis} from 'aws-sdk';
import {KinesisStreamRecordPayload} from 'aws-lambda/trigger/kinesis-stream';
declare module 'aws-kinesis-agg' {
export interface UserRecord {
partitionKey: string;
explicitPartitionKey: string;
sequencenumber: string;
subSequencenumber: number;
data: string;
}
export interface EncodedRecord {
partitionKey: string,
data: Buffer;
}
export function deaggregate(kinesisRecord: KinesisStreamRecordPayload,
computeChecksums: boolean,
perRecordCallback: (err: Error, userRecords?: UserRecord) => void,
afterRecordCallback: (err?: Error, errorUserRecord?: UserRecord) => void
): void;
export function deaggregateSync(kinesisRecord: KinesisStreamRecordPayload,
computeChecksums: boolean,
afterRecordCallback: (err: Error, userRecords?: UserRecord[]) => void
): void;
export function aggregate(records: any[],
encodedRecordHandler: (encodedRecord: EncodedRecord, callback: (err?: Error, data?: Kinesis.Types.PutRecordOutput) => void) => void,
afterPutAggregatedRecords: () => void,
errorCallback: (error: Error, data?: EncodedRecord) => void,
queueSize?: number
): void;
}