mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00

* chore: move tns-core-modules to nativescript-core * chore: preparing compat generate script * chore: add missing definitions * chore: no need for http-request to be private * chore: packages chore * test: generate tests for tns-core-modules * chore: add anroid module for consistency * chore: add .npmignore * chore: added privateModulesWhitelist * chore(webpack): added bundle-entry-points * chore: scripts * chore: tests changed to use @ns/core * test: add scoped-packages test project * test: fix types * test: update test project * chore: build scripts * chore: update build script * chore: npm scripts cleanup * chore: make the compat pgk work with old wp config * test: generate diff friendly tests * chore: create barrel exports * chore: move files after rebase * chore: typedoc config * chore: compat mode * chore: review of barrels * chore: remove tns-core-modules import after rebase * chore: dev workflow setup * chore: update developer-workflow * docs: experiment with API extractor * chore: api-extractor and barrel exports * chore: api-extractor configs * chore: generate d.ts rollup with api-extractor * refactor: move methods inside Frame * chore: fic tests to use Frame static methods * refactor: create Builder class * refactor: use Builder class in tests * refactor: include Style in ui barrel * chore: separate compat build script * chore: fix tslint errors * chore: update NATIVESCRIPT_CORE_ARGS * chore: fix compat pack * chore: fix ui-test-app build with linked modules * chore: Application, ApplicationSettings, Connectivity and Http * chore: export Trace, Profiling and Utils * refactor: Static create methods for ImageSource * chore: fix deprecated usages of ImageSource * chore: move Span and FormattedString to ui * chore: add events-args and ImageSource to index files * chore: check for CLI >= 6.2 when building for IOS * chore: update travis build * chore: copy Pod file to compat package * chore: update error msg ui-tests-app * refactor: Apply suggestions from code review Co-Authored-By: Martin Yankov <m.i.yankov@gmail.com> * chore: typings and refs * chore: add missing d.ts files for public API * chore: adress code review FB * chore: update api-report * chore: dev-workflow for other apps * chore: api update * chore: update api-report
296 lines
7.4 KiB
TypeScript
296 lines
7.4 KiB
TypeScript
/**
|
|
* 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;
|
|
}
|