UNPKG

5.06 kBTypeScriptView Raw
1import { Color } from '../../color';
2import { Page } from '../page';
3export declare namespace DialogStrings {
4 const STRING = "string";
5 const PROMPT = "Prompt";
6 const CONFIRM = "Confirm";
7 const ALERT = "Alert";
8 const LOGIN = "Login";
9 const OK = "OK";
10 const CANCEL = "Cancel";
11}
12/**
13 * Provides options for the dialog.
14 */
15export interface CancelableOptions {
16 /**
17 * [Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog.
18 */
19 cancelable?: boolean;
20 /**
21 * [Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style
22 */
23 theme?: number;
24}
25/**
26 * Provides options for the dialog.
27 */
28export interface ActionOptions extends CancelableOptions {
29 /**
30 * Gets or sets the dialog title.
31 */
32 title?: string;
33 /**
34 * Gets or sets the dialog message.
35 */
36 message?: string;
37 /**
38 * Gets or sets the Cancel button text.
39 */
40 cancelButtonText?: string;
41 /**
42 * Gets or sets the list of available actions.
43 */
44 actions?: Array<string>;
45 /**
46 * [iOS only] Gets or sets the indexes of destructive actions.
47 */
48 destructiveActionsIndexes?: Array<number>;
49}
50/**
51 * Provides options for the dialog.
52 */
53export interface DialogOptions extends CancelableOptions {
54 /**
55 * Gets or sets the dialog title.
56 */
57 title?: string;
58 /**
59 * Gets or sets the dialog message.
60 */
61 message?: string;
62}
63/**
64 * Provides options for the alert.
65 */
66export interface AlertOptions extends DialogOptions {
67 /**
68 * Gets or sets the OK button text.
69 */
70 okButtonText?: string;
71}
72/**
73 * Provides options for the confirm dialog.
74 */
75export interface ConfirmOptions extends AlertOptions {
76 /**
77 * Gets or sets the Cancel button text.
78 */
79 cancelButtonText?: string;
80 /**
81 * Gets or sets the neutral button text.
82 */
83 neutralButtonText?: string;
84}
85/**
86 * Provides options for the prompt dialog.
87 */
88export interface PromptOptions extends ConfirmOptions {
89 /**
90 * Gets or sets the default text to display in the input box.
91 */
92 defaultText?: string;
93 /**
94 * Gets or sets the prompt input type (plain text, password, or email).
95 */
96 inputType?: string;
97 /**
98 * Gets or sets the prompt capitalizationType (none, all, sentences, or words).
99 */
100 capitalizationType?: string;
101}
102/**
103 * Provides result data from the prompt dialog.
104 */
105export interface PromptResult {
106 /**
107 * Gets or sets the prompt dialog boolean result.
108 */
109 result: boolean;
110 /**
111 * Gets or sets the text entered in the prompt dialog.
112 */
113 text: string;
114}
115/**
116 * Provides result data from the login dialog.
117 */
118export interface LoginResult {
119 /**
120 * Gets or sets the login dialog boolean result.
121 */
122 result: boolean;
123 /**
124 * Gets or sets the user entered in the login dialog.
125 */
126 userName: string;
127 /**
128 * Gets or sets the password entered in the login dialog.
129 */
130 password: string;
131}
132/**
133 * Provides options for the login dialog.
134 */
135export interface LoginOptions extends ConfirmOptions {
136 /**
137 * Gets or sets the default text to display as hint in the user name input box.
138 */
139 userNameHint?: string;
140 /**
141 * Gets or sets the default text to display as hint in the password input box.
142 */
143 passwordHint?: string;
144 /**
145 * Gets or sets the default text to display in the user name input box.
146 */
147 userName?: string;
148 /**
149 * Gets or sets the default text to display in the password input box.
150 */
151 password?: string;
152}
153/**
154 * Defines the input type for prompt dialog.
155 */
156export declare namespace inputType {
157 /**
158 * Plain text input type.
159 */
160 const text = "text";
161 /**
162 * Password input type.
163 */
164 const password = "password";
165 /**
166 * Email input type.
167 */
168 const email = "email";
169 /**
170 * Number input type
171 */
172 const number = "number";
173 /**
174 * Decimal input type
175 */
176 const decimal = "decimal";
177 /**
178 * Phone input type
179 */
180 const phone = "phone";
181}
182/**
183 * Defines the capitalization type for prompt dialog.
184 */
185export declare namespace capitalizationType {
186 /**
187 * No automatic capitalization.
188 */
189 const none = "none";
190 /**
191 * Capitalizes every character.
192 */
193 const all = "all";
194 /**
195 * Capitalize the first word of each sentence.
196 */
197 const sentences = "sentences";
198 /**
199 * Capitalize the first letter of every word.
200 */
201 const words = "words";
202}
203export declare function getCurrentPage(): Page;
204export declare function getButtonColors(): {
205 color: Color;
206 backgroundColor: Color;
207};
208export declare function getLabelColor(): Color;
209export declare function getTextFieldColor(): Color;
210export declare function isDialogOptions(arg: any): boolean;
211export declare function parseLoginOptions(args: any[]): LoginOptions;