Skip to content

Commit

Permalink
feat(nativestorage): add NativeStorage plugin wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Jul 17, 2016
1 parent 453374d commit af5d4ad
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {Keyboard} from './plugins/keyboard';
import {LaunchNavigator} from './plugins/launchnavigator';
import {LocalNotifications} from './plugins/localnotifications';
import {MediaCapture} from './plugins/media-capture';
import {NativeStorage} from './plugins/nativestorage';
import {MediaPlugin} from './plugins/media';
import {Network} from './plugins/network';
import {OneSignal} from './plugins/onesignal';
Expand Down Expand Up @@ -129,6 +130,7 @@ export {
Hotspot,
Insomnia,
Keyboard,
NativeStorage,
Network,
OneSignal,
PinDialog,
Expand Down Expand Up @@ -194,6 +196,7 @@ window['IonicNative'] = {
LocalNotifications: LocalNotifications,
MediaCapture: MediaCapture,
MediaPlugin: MediaPlugin,
NativeStorage: NativeStorage,
Network: Network,
Printer: Printer,
Push: Push,
Expand Down
38 changes: 38 additions & 0 deletions src/plugins/nativestorage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {Plugin, Cordova} from './plugin';
/**
* @name Native Storage
*/
@Plugin({
plugin: 'cordova-plugin-nativestorage',
pluginRef: 'NativeStorage',
repo: 'https://github.com/TheCocoaProject/cordova-plugin-nativestorage'
})
export class NativeStorage {
/**
* Stores a value
* @param reference
* @param value
*/
@Cordova()
static setItem(reference: string, value: any): Promise<any> {return; }

/**
* Gets a stored item
* @param reference
*/
@Cordova()
static getItem(reference: string): Promise<any> {return; }

/**
* Removes a single stored item
* @param reference
*/
@Cordova()
static remove(reference: string): Promise<any> {return; }

/**
* Removes all stored values.
*/
@Cordova()
static clear(): Promise<any> {return; }
}

0 comments on commit af5d4ad

Please sign in to comment.