refractor(dialogs): refractor interfaces to avoid duplicates

This commit is contained in:
Ibby 2016-12-06 09:08:02 -05:00
parent 3ba72e9f15
commit 427527a129

View File

@ -1,7 +1,7 @@
import { Cordova, Plugin } from './plugin'; import { Cordova, Plugin } from './plugin';
export interface PromptCallback { export interface DialogsPromptCallback {
/** /**
* The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc. * The index of the pressed button. (Number) Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
@ -31,6 +31,8 @@ export interface PromptCallback {
* *
* *
* ``` * ```
* @interfaces
* DialogsPromptCallback
*/ */
@Plugin({ @Plugin({
pluginName: 'Dialogs', pluginName: 'Dialogs',
@ -80,7 +82,7 @@ export class Dialogs {
* @param {string} title Dialog title. (Optional, defaults to Prompt) * @param {string} title Dialog title. (Optional, defaults to Prompt)
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"]) * @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"])
* @param {string} defaultText Default textbox input value. (Optional, Default: empty string) * @param {string} defaultText Default textbox input value. (Optional, Default: empty string)
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered * @returns {Promise<DialogsPromptCallback>} Returns a promise that resolves an object with the button index clicked and the text entered
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
@ -91,7 +93,7 @@ export class Dialogs {
title: string = 'Prompt', title: string = 'Prompt',
buttonLabels: Array<string> = ['OK', 'Cancel'], buttonLabels: Array<string> = ['OK', 'Cancel'],
defaultText: string = '' defaultText: string = ''
): Promise<any> { return; } ): Promise<DialogsPromptCallback> { return; }
/** /**