From d62779a2a6ffcf219d33021779bb85800d9c2a45 Mon Sep 17 00:00:00 2001 From: Ibby Date: Sat, 7 Jan 2017 04:38:37 -0500 Subject: [PATCH] feat(market): add search method, return promises --- src/plugins/market.ts | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/plugins/market.ts b/src/plugins/market.ts index 0ad90200e..6299dca23 100644 --- a/src/plugins/market.ts +++ b/src/plugins/market.ts @@ -19,12 +19,30 @@ import { Plugin, Cordova } from './plugin'; repo: 'https://github.com/xmartlabs/cordova-plugin-market' }) export class Market { + /** * Opens an app in Google Play / App Store * @param appId {string} Package name - * @param callbacks {Object} Optional callbacks in the format {success?: Function, failure?: Function} + * @return {Promise} */ - @Cordova({sync: true}) - static open(appId: string, callbacks?: {success?: Function, failure?: Function}): void { } + @Cordova({ + callbackStyle: 'object', + successName: 'success', + errorName: 'failure' + }) + static open(appId: string): Promise { return } + + /** + * Search apps by keyword + * @param keyword {string} Keyword + * @return {Promise} + */ + @Cordova({ + callbackStyle: 'object', + successName: 'success', + errorName: 'failure', + platforms: ['Android'] + }) + static search(keyword: string): Promise { return } }