feat(siri-shortcuts): Add clear option for the activated shortcut (#2734)

* feat(siri-shortcuts): Add clear option for the getActivatedShortcutOperation

* Update index.ts
This commit is contained in:
Bart Wesselink 2018-09-25 16:43:47 +02:00 committed by Daniel Sogl
parent 8116ddd139
commit 3eff280127

View File

@ -13,11 +13,15 @@ export interface SiriShortcutOptions extends SiriShortcut {
isEligibleForPrediction?: boolean; isEligibleForPrediction?: boolean;
} }
export interface ActivatedShortcutOptions {
clear?: boolean;
}
/** /**
* @beta * @beta
* @name Siri Shortcuts * @name Siri Shortcuts
* @description * @description
* This plugin only works when your app is built with XCode 10 Beta. Shortcuts will only appear on iOS-versions >= 12.0 * This plugin only works when your app is built with XCode 10. Shortcuts will only appear on iOS-versions >= 12.0
* *
* This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri. * This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
* After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check * After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
@ -71,6 +75,7 @@ export interface SiriShortcutOptions extends SiriShortcut {
* @interfaces * @interfaces
* SiriShortcut * SiriShortcut
* SiriShortcutOptions * SiriShortcutOptions
* ActivatedShortcutOptions
*/ */
@Plugin({ @Plugin({
pluginName: 'SiriShortcuts', pluginName: 'SiriShortcuts',
@ -134,10 +139,12 @@ export class SiriShortcuts extends IonicNativePlugin {
/** /**
* Get the current clicked user activity, and return `null` if none * Get the current clicked user activity, and return `null` if none
* @param {ActivatedShortcutOptions|null} options Options to specify for getting the shortcut
* @param {boolean} options.clear Clear the currently activated shortcut, defaults to true
* @return Promise<SiriShortcut|null> * @return Promise<SiriShortcut|null>
*/ */
@Cordova() @Cordova()
getActivatedShortcut(): Promise<SiriShortcut | null> { getActivatedShortcut(options?: ActivatedShortcutOptions): Promise<SiriShortcut | null> {
return; return;
} }
} }