-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.d.ts
29 lines (24 loc) · 822 Bytes
/
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
declare module 'yana' {
import { EventEmitter } from "events";
interface AMIOptions {
host?: string;
port?: number;
reconnect?: boolean;
events?: string | boolean;
login: string;
password?: string;
}
type ActionResult = Record<string, string | string[]> & {
eventlist?: ActionResult[]
}
type ConnectCallback = (err: Error | undefined | null) => void;
type SendCallback = (err: Error | undefined | null, message: ActionResult) => void;
type DisconnectCallback = (err: Error | undefined | null) => void;
class AMI extends EventEmitter {
constructor(options: AMIOptions);
connect(cb?: ConnectCallback): Promise<void>;
send(action: object, cb?: SendCallback): Promise<ActionResult>;
disconnect(cb?: DisconnectCallback): Promise<void>;
}
export = AMI;
}