diff --git a/src/@ionic-native/plugins/web-intent/index.ts b/src/@ionic-native/plugins/web-intent/index.ts index f435afa195..5aeebc54d7 100644 --- a/src/@ionic-native/plugins/web-intent/index.ts +++ b/src/@ionic-native/plugins/web-intent/index.ts @@ -2,6 +2,20 @@ import { Injectable } from '@angular/core'; import { Cordova, CordovaProperty, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; +export interface IntentOptions { + requestCode?: number; + type?: string; + package?: string; + url?: string; + extras?: object; + action?: string; + component?: { + package: string; + class: string; + }; + flags?: number[]; +}; + /** * @name Web Intent * @description @@ -25,6 +39,8 @@ import { Observable } from 'rxjs/Observable'; * this.webIntent.startActivity(options).then(onSuccess, onError); * * ``` + * @interfaces + * IntentOptions */ @Plugin({ pluginName: 'WebIntent', @@ -97,30 +113,21 @@ export class WebIntent extends IonicNativePlugin { /** * Launches an Android intent - * @param options {Object} { action: any, url: string, type?: string } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startActivity(options: { - action: any; - extras?: any; - url: string; - type?: string; - }): Promise { + startActivity(options: IntentOptions): Promise { return; } /** * Starts a new activity and return the result to the application - * @param options {Object} { action: any, url: string, type?: string } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startActivityForResult(options: { - action: any; - url: string; - type?: string; - }): Promise { + startActivityForResult(options: IntentOptions): Promise { return; } @@ -166,27 +173,21 @@ export class WebIntent extends IonicNativePlugin { /** * Sends a custom intent passing optional extras - * @param options {Object} { action: string, extras?: { option: boolean } } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - sendBroadcast(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + sendBroadcast(options: IntentOptions): Promise { return; } /** * Request that a given application service be started - * @param options {Object} { action: string, extras?: { option: boolean } } + * @param options {IntentOptions} * @returns {Promise} */ @Cordova() - startService(options: { - action: string; - extras?: { option: boolean }; - }): Promise { + startService(options: IntentOptions): Promise { return; }