feat(market): add search method, return promises

This commit is contained in:
Ibby 2017-01-07 04:38:37 -05:00
parent 009a20608e
commit d62779a2a6

View File

@ -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<any>}
*/
@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<any> { return }
/**
* Search apps by keyword
* @param keyword {string} Keyword
* @return {Promise<any>}
*/
@Cordova({
callbackStyle: 'object',
successName: 'success',
errorName: 'failure',
platforms: ['Android']
})
static search(keyword: string): Promise<any> { return }
}