mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
fix(plugins): rename packages/classes
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin } from '@ionic-native/core';
|
||||
|
||||
|
||||
/**
|
||||
* @name NativeStorage
|
||||
* @description Native storage of variables in Android and iOS
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NativeStorage } from 'ionic-native';
|
||||
*
|
||||
* NativeStorage.setItem('myitem', {property: 'value', anotherProperty: 'anotherValue'})
|
||||
* .then(
|
||||
* () => console.log('Stored item!'),
|
||||
* error => console.error('Error storing item', error)
|
||||
* );
|
||||
*
|
||||
* NativeStorage.getItem('myitem')
|
||||
* .then(
|
||||
* data => console.log(data),
|
||||
* error => console.error(error)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NativeStorage',
|
||||
plugin: 'cordova-plugin-nativestorage',
|
||||
pluginRef: 'NativeStorage',
|
||||
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'
|
||||
})
|
||||
@Injectable()
|
||||
export class NativeStorage {
|
||||
/**
|
||||
* Stores a value
|
||||
* @param reference {string}
|
||||
* @param value
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setItem(reference: string, value: any): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Gets a stored item
|
||||
* @param reference {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getItem(reference: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Removes a single stored item
|
||||
* @param reference {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
remove(reference: string): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Removes all stored values.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
clear(): Promise<any> {return; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user