mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-13 14:21:04 +08:00
replaced callback functions with promises
This commit is contained in:
parent
514c492966
commit
1e1920f524
@ -32,74 +32,72 @@ export class AppPreferences {
|
|||||||
/**
|
/**
|
||||||
* Get a preference value
|
* Get a preference value
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is available
|
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||||
* @param {Function} errorCallback The function to call when value is unavailable
|
|
||||||
* @param {string} dict Dictionary for key
|
|
||||||
* @param {string} key Key
|
* @param {string} key Key
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static fetch(successCallback: Function, errorCallback: Function, dict: string, key?: string): Promise<any> { return; }
|
callbackOrder: 'reverse'
|
||||||
|
})
|
||||||
|
static fetch(dict: string, key?: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a preference value
|
* Set a preference value
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is set successfully
|
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||||
* @param {Function} errorCallback The function to call when value is not set
|
|
||||||
* @param {string} dict Dictionary for key
|
|
||||||
* @param {string} key Key
|
* @param {string} key Key
|
||||||
* @param {string} value Value
|
* @param {string} value Value
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static store(successCallback: Function, errorCallback: Function, dict: string, key: string, value?: string): Promise<any> {
|
callbackOrder: 'reverse'
|
||||||
|
})
|
||||||
|
static store(dict: string, key: string, value?: string): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove value from preferences
|
* Remove value from preferences
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is available
|
* @param {string} dict Dictionary for key (OPTIONAL)
|
||||||
* @param {Function} errorCallback The function to call when value is unavailable
|
|
||||||
* @param {string} dict Dictionary for key
|
|
||||||
* @param {string} key Key
|
* @param {string} key Key
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static remove(successCallback: Function, errorCallback: Function, dict: string, key?: string): Promise<any> { return; }
|
callbackOrder: 'reverse'
|
||||||
|
})
|
||||||
|
static remove(dict: string, key?: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear preferences
|
* Clear preferences
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is available
|
|
||||||
* @param {Function} errorCallback The function to call when value is unavailable
|
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static clearAll(successCallback: Function, errorCallback: Function): Promise<any> { return; }
|
callbackOrder: 'reverse'
|
||||||
|
})
|
||||||
|
static clearAll(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show native preferences interface
|
* Show native preferences interface
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is available
|
|
||||||
* @param {Function} errorCallback The function to call when value is unavailable
|
|
||||||
* @return {Promise<any>} Returns a promise
|
* @return {Promise<any>} Returns a promise
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
static show(successCallback: Function, errorCallback: Function): Promise<any> { return; }
|
callbackOrder: 'reverse'
|
||||||
|
})
|
||||||
|
static show(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show native preferences interface
|
* Show native preferences interface
|
||||||
*
|
*
|
||||||
* @param {Function} successCallback The function to call when the value is available
|
|
||||||
* @param {Function} errorCallback The function to call when value is unavailable
|
|
||||||
* @param {boolean} subscribe true value to subscribe, false - unsubscribe
|
* @param {boolean} subscribe true value to subscribe, false - unsubscribe
|
||||||
* @return {Observable<any>} Returns an observable
|
* @return {Observable<any>} Returns an observable
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
observable: true
|
observable: true
|
||||||
})
|
})
|
||||||
static watch(successCallback: Function, errorCallback: Function, subscribe: boolean): Observable<any> { return; }
|
static watch(subscribe: boolean): Observable<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return named configuration context
|
* Return named configuration context
|
||||||
|
Loading…
x
Reference in New Issue
Block a user