-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.d.ts
More file actions
26 lines (21 loc) · 713 Bytes
/
index.d.ts
File metadata and controls
26 lines (21 loc) · 713 Bytes
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
import 'egg';
declare module 'egg' {
type UnitMessage = string | Buffer;
interface MessageType {
topic: string,
key?: string | Buffer, // Specify consumer for the corresponding key under topic
messages: UnitMessage | UnitMessage[]
}
interface Application {
kafka: {
sendMessage(msg: MessageType): Promise<any>
sendMessageSync(msg: MessageType, scb: (data: any) => void, ecb: (err: any) => void): void
};
}
interface Context {
kafka: {
sendMessage(msg: MessageType): Promise<any>
sendMessageSync(msg: MessageType, scb: (data: any) => void, ecb: (err: any) => void): void
};
}
}