-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.d.ts
122 lines (98 loc) · 2.14 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
export declare function Yemot_router(opt?: { timeout: number }): YemotRouter;
interface YemotRouter {
add_fn: (path: string, handler: Handler) => void;
}
export type Call = {
did: string;
phone: string;
real_did: string;
call_id: string;
extension: string;
query: object;
read(
massage: msg_data,
mode?: mode,
options?: read_options
): Promise<String | false>;
go_to_folder(folder: string): void;
id_list_message(data: msg_data, wait_to_more_action: boolean): void;
routing_yemot(phone: string): void;
restart_ext(): void;
};
type Handler = (p: Call) => void;
type msg_data = [{ type: msg_data_type; data: string }];
type msg_data_type =
| "file"
| "text"
| "speech"
| "digits"
| "number"
| "alpha"
| "zmanim"
| "go_to_folder"
| "system_message"
| "music_on_hold"
| "date"
| "dateH";
type mode = "tap" | "stt" | "record";
type read_options = {
val_name: string;
re_enter_if_exists: boolean;
max: number;
min: number;
sec_wait: number;
play_ok_mode: play_ok_mode;
block_asterisk: boolean;
block_zero: boolean;
replace_char: string;
digits_allowed: (number | string)[];
amount_attempts: number;
read_none: boolean;
read_none_var: string;
block_change_type_lang: boolean;
lang: string;
allow_typing: boolean;
path: string;
file_name: string;
record_ok: boolean;
record_hangup: boolean;
record_attach: boolean;
};
type play_ok_mode =
| "Number"
| "Digits"
| "File"
| "TTS"
| "Alpha"
| "No"
| "HebrewKeyboard"
| "EmailKeyboard"
| "EnglishKeyboard"
| "DigitsKeyboard"
| "TeudatZehut"
| "Price"
| "Time"
| "Phone"
| "No";
export const errors = {
Exit_error,
};
class Exit_error extends Error {
constructor(call, ...params) {
// Pass remaining arguments (including vendor specific ones) to parent constructor
super(...params);
this.call = new Call();
this.name = "Exit_error";
this.date = new Date();
}
}
class Hangup_error extends Exit_error {
constructor(...params) {
this.name = "Hangup_error";
}
}
class Timeout_error extends Exit_error {
constructor(...params) {
this.name = "Timeout_error";
}
}