No more ambient modules for tns-core-modules/* subpackages.

- Use path mappings in tsconfig.json to resolve module typings
- Only use ambient mobules for global API's
- Move single-file modules to a subdir with the same name so that
we can provide a hand-written typing next to it (via package.json)
- Delete all mentions of tns-core-modules.d.ts
- Delete reference d.ts assembly build steps. Not needed anymore.
- HACK! Use a <reference> for global typings in application.d.ts
to avoid publishing a separate @types/tns-core-modules package.
- Rename declarations.d.ts to tns-core-modules.d.ts to preserve
JS project mappings in references.d.ts (the only place we use those)
This commit is contained in:
Hristo Deshev
2017-03-02 13:50:23 +02:00
committed by Hristo Deshev
parent 1af8c6ca8e
commit b45cbe929b
230 changed files with 9170 additions and 10028 deletions

View File

@@ -1,225 +1,223 @@
/**
* Allows you to show different dialogs such as alerts, prompts, etc.
*/
declare module "ui/dialogs" {
/**
* Defines the input type for prompt dialog.
*/
export module inputType {
/**
* Defines the input type for prompt dialog.
* Plain text input type.
*/
export module inputType {
/**
* Plain text input type.
*/
export var text: string;
/**
* Password input type.
*/
export var password: string;
}
export var text: string;
/**
* The alert() method displays an alert box with a specified message.
* @param message Specifies the text to display in the alert box.
* Password input type.
*/
export function alert(message: string): Promise<void>;
export var password: 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): 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 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, userName?: string, password?: 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;
/**
* The alert() method displays an alert box with a specified message.
* @param options Specifies the options for the alert box.
* Gets or sets the dialog message.
*/
export function alert(options: AlertOptions): Promise<void>;
message?: string;
/**
* The confirm() method displays a dialog box with a specified message.
* @param message Specifies the text to display in the confirm box.
* Gets or sets the Cancel button text.
*/
export function confirm(message: string): Promise<boolean>;
cancelButtonText?: string;
/**
* The confirm() method displays a dialog box with a specified message.
* @param options Specifies the options for the confirm box.
* Gets or sets the list of available actions.
*/
export function confirm(options: ConfirmOptions): Promise<boolean>;
actions?: Array<string>;
}
/**
* Provides options for the dialog.
*/
export interface DialogOptions extends CancelableOptions {
/**
* Gets or sets the dialog title.
*/
title?: string;
/**
* 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.
* Gets or sets the dialog message.
*/
export function prompt(message: string, defaultText?: string): Promise<PromptResult>;
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;
/**
* The prompt() method displays a dialog box that prompts the visitor for input.
* @param options The options for the dialog box.
* Gets or sets the neutral button text.
*/
export function prompt(options: PromptOptions): Promise<PromptResult>;
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;
/**
* 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 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.
* Gets or sets the prompt input type (plain text or password).
*/
export function login(message: string, userName?: string, password?: string): Promise<LoginResult>;
inputType?: string;
}
/**
* Provides options for the login dialog.
*/
export interface LoginOptions extends ConfirmOptions {
/**
* Gets or sets the default text to display in the user name input box.
*/
userName?: string;
/**
* 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.
* Gets or sets the default text to display in the password input box.
*/
export function login(options: LoginOptions): Promise<LoginResult>;
password?: string;
}
/**
* Provides result data from the prompt dialog.
*/
export interface PromptResult {
/**
* Gets or sets the prompt dialog boolean result.
*/
result: boolean;
/**
* 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.
* Gets or sets the text entered in the prompt dialog.
*/
export function action(message: string, cancelButtonText: string, actions: Array<string>): Promise<string>;
text: string;
}
/**
* Provides result data from the login dialog.
*/
export interface LoginResult {
/**
* Gets or sets the login dialog boolean result.
*/
result: boolean;
/**
* The action() method displays a action box that prompts the visitor to choose some action.
* @param options The options for the dialog box.
* Gets or sets the user entered in the login dialog.
*/
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;
}
userName: string;
/**
* Provides options for the dialog.
* Gets or sets the password entered in the login 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 or password).
*/
inputType?: string;
}
/**
* Provides options for the login dialog.
*/
export interface LoginOptions extends ConfirmOptions {
/**
* 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;
}
}
password: string;
}

View File

@@ -1,2 +1,5 @@
{ "name" : "dialogs",
"main" : "dialogs" }
{
"name" : "dialogs",
"main" : "dialogs",
"types" : "dialogs.d.ts"
}