/
dialogs.d.ts
295 lines (251 loc) · 7.4 KB
/
dialogs.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/**
* Allows you to show different dialogs such as alerts, prompts, etc.
* @module "ui/dialogs"
*/ /** */
/**
* Defines the input type for prompt dialog.
*/
export module inputType {
/**
* Plain text input type.
*/
export const text: string;
/**
* Password input type.
*/
export const password: string;
/**
* Email input type.
*/
export const email: string;
/**
* Number input type.
*/
export const number: string;
/**
* Decimal input type.
*/
export const decimal: string;
/**
* Phone input type.
*/
export const phone: string;
}
/**
* Defines the capitalization type for prompt dialog.
*/
export module capitalizationType {
/**
* No automatic capitalization.
*/
export const none: string;
/**
* Capitalizes every character.
*/
export const all: string;
/**
* Capitalize the first word of each sentence.
*/
export const sentences: string;
/**
* Capitalize the first letter of every word.
*/
export const words: string;
}
/**
* The alert() method displays an alert box with a specified message.
* @param message Specifies the text to display in the alert box.
*/
export function alert(message: string | number | boolean): Promise<void>;
/**
* The alert() method displays an alert box with a specified message.
* @param options Specifies the options for the alert box.
*/
export function alert(options: AlertOptions): Promise<void>;
/**
* The confirm() method displays a dialog box with a specified message.
* @param message Specifies the text to display in the confirm box.
*/
export function confirm(message: string): Promise<boolean>;
/**
* The confirm() method displays a dialog box with a specified message.
* @param options Specifies the options for the confirm box.
*/
export function confirm(options: ConfirmOptions): Promise<boolean>;
/**
* The prompt() method displays a dialog box that prompts the visitor for input.
* @param message The text to display in the dialog box.
* @param defaultText The default text to display in the input box. Optional.
*/
export function prompt(message: string, defaultText?: string): Promise<PromptResult>;
/**
* The prompt() method displays a dialog box that prompts the visitor for input.
* @param options The options for the dialog box.
*/
export function prompt(options: PromptOptions): Promise<PromptResult>;
/**
* The login() method displays a login dialog box that prompts the visitor for user name and password.
* @param message The text to display in the dialog box.
* @param userNameHint The default text to display as a hint in the username input. Optional.
* @param passwordHint The default text to display as a hint in the password input. Optional.
* @param userName The default text to display in the user name input box. Optional.
* @param password The default text to display in the password input box. Optional.
*/
export function login(message: string, userNameHint?: string, passwordHint?: string, userName?: string, password?: string): Promise<LoginResult>;
/**
* The login() method displays a login dialog box that prompts the visitor for user name and password.
* @param message The text to display in the dialog box.
* @param userNameHint The default text to display as a hint in the username input. Optional.
* @param passwordHint The default text to display as a hint in the password input. Optional.
*/
export function login(message: string, userNameHint?: string, passwordHint?: string): Promise<LoginResult>;
/**
* The login() method displays a login dialog box that prompts the visitor for user name and password.
* @param options The options for the dialog box.
*/
export function login(options: LoginOptions): Promise<LoginResult>;
/**
* The action() method displays a action box that prompts the visitor to choose some action.
* @param message The text to display in the dialog box.
* @param cancelButtonText The text to display in the cancel button.
* @param actions List of available actions.
*/
export function action(message: string, cancelButtonText: string, actions: Array<string>): Promise<string>;
/**
* The action() method displays a action box that prompts the visitor to choose some action.
* @param options The options for the dialog box.
*/
export function action(options: ActionOptions): Promise<string>;
/**
* Provides options for the dialog.
*/
export interface CancelableOptions {
/**
* [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog.
*/
cancelable?: boolean;
}
/**
* Provides options for the dialog.
*/
export interface ActionOptions extends CancelableOptions {
/**
* Gets or sets the dialog title.
*/
title?: string;
/**
* Gets or sets the dialog message.
*/
message?: string;
/**
* Gets or sets the Cancel button text.
*/
cancelButtonText?: string;
/**
* Gets or sets the list of available actions.
*/
actions?: Array<string>;
}
/**
* Provides options for the dialog.
*/
export interface DialogOptions extends CancelableOptions {
/**
* Gets or sets the dialog title.
*/
title?: string;
/**
* Gets or sets the dialog message.
*/
message?: string;
}
/**
* Provides options for the alert.
*/
export interface AlertOptions extends DialogOptions {
/**
* Gets or sets the OK button text.
*/
okButtonText?: string;
}
/**
* Provides options for the confirm dialog.
*/
export interface ConfirmOptions extends AlertOptions {
/**
* Gets or sets the Cancel button text.
*/
cancelButtonText?: string;
/**
* Gets or sets the neutral button text.
*/
neutralButtonText?: string;
}
/**
* Provides options for the prompt dialog.
*/
export interface PromptOptions extends ConfirmOptions {
/**
* Gets or sets the default text to display in the input box.
*/
defaultText?: string;
/**
* Gets or sets the prompt input type (plain text, password, or email).
*/
inputType?: string;
/**
* Gets or sets the prompt capitalizationType (none, all, sentences, or words).
*/
capitalizationType?: string;
}
/**
* Provides options for the login dialog.
*/
export interface LoginOptions extends ConfirmOptions {
/**
* Gets or sets the default text to display as hint in the user name input box.
*/
userNameHint?: string;
/**
* Gets or sets the default text to display as hint in the password input box.
*/
passwordHint?: string;
/**
* Gets or sets the default text to display in the user name input box.
*/
userName?: string;
/**
* Gets or sets the default text to display in the password input box.
*/
password?: string;
}
/**
* Provides result data from the prompt dialog.
*/
export interface PromptResult {
/**
* Gets or sets the prompt dialog boolean result.
*/
result: boolean;
/**
* Gets or sets the text entered in the prompt dialog.
*/
text: string;
}
/**
* Provides result data from the login dialog.
*/
export interface LoginResult {
/**
* Gets or sets the login dialog boolean result.
*/
result: boolean;
/**
* Gets or sets the user entered in the login dialog.
*/
userName: string;
/**
* Gets or sets the password entered in the login dialog.
*/
password: string;
}