mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
minor refractor
This commit is contained in:
parent
df326f773f
commit
971ee4adda
@ -1,7 +1,5 @@
|
|||||||
import { CordovaInstance, Plugin } from './plugin';
|
import { CordovaInstance, Plugin } from './plugin';
|
||||||
|
|
||||||
declare var cordova: any;
|
declare var cordova: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Secure Storage
|
* @name Secure Storage
|
||||||
* @description
|
* @description
|
||||||
@ -10,29 +8,29 @@ declare var cordova: any;
|
|||||||
* Requires Cordova plugin: `cordova-plugin-secure-storage`. For more info, please see the [Cordova Secure Storage docs](https://github.com/Crypho/cordova-plugin-secure-storage).
|
* Requires Cordova plugin: `cordova-plugin-secure-storage`. For more info, please see the [Cordova Secure Storage docs](https://github.com/Crypho/cordova-plugin-secure-storage).
|
||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { SecureStorage } from 'ionic-native';
|
* import { SecureStorage } from 'ionic-native';
|
||||||
*
|
*
|
||||||
* let secureStorage: SecureStorage = new SecureStorage();
|
* let secureStorage: SecureStorage = new SecureStorage();
|
||||||
* secureStorage.create('my_store_name')
|
* secureStorage.create('my_store_name')
|
||||||
* .then(
|
* .then(
|
||||||
* () => console.log('Success'),
|
* () => console.log('Storage is ready!'),
|
||||||
* error => console.log(error);
|
* error => console.log(error);
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* secureStorage.get('myitem')
|
* secureStorage.get('myitem')
|
||||||
* .then(
|
* .then(
|
||||||
* data => console.log(data),
|
* data => console.log(data),
|
||||||
* error => console.log(error)
|
* error => console.log(error)
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* secureStorage.set('myitem', 'myvalue')
|
* secureStorage.set('myitem', 'myvalue')
|
||||||
* .then(
|
* .then(
|
||||||
* data => console.log(data),
|
* data => console.log(data),
|
||||||
* error => console.log(error)
|
* error => console.log(error)
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* secureStorage.remove('myitem')
|
* secureStorage.remove('myitem')
|
||||||
* .then(
|
* .then(
|
||||||
* data => console.log(data),
|
* data => console.log(data),
|
||||||
@ -50,10 +48,10 @@ export class SecureStorage {
|
|||||||
|
|
||||||
private _objectInstance: any;
|
private _objectInstance: any;
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a namespaced storage.
|
* Creates a namespaced storage.
|
||||||
* @param store {string}
|
* @param store {string}
|
||||||
*/
|
*/
|
||||||
create(store: string): Promise<any> {
|
create(store: string): Promise<any> {
|
||||||
|
Loading…
Reference in New Issue
Block a user