From c05b3e96722ee85c4771aa70236a77e1b60f60e2 Mon Sep 17 00:00:00 2001 From: MaximBelov Date: Tue, 11 May 2021 09:05:18 +0300 Subject: [PATCH] feat(local-backup): add plugin (#3656) --- .../plugins/local-backup/index.ts | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/@ionic-native/plugins/local-backup/index.ts diff --git a/src/@ionic-native/plugins/local-backup/index.ts b/src/@ionic-native/plugins/local-backup/index.ts new file mode 100644 index 00000000..863cc4e1 --- /dev/null +++ b/src/@ionic-native/plugins/local-backup/index.ts @@ -0,0 +1,54 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name LocalBackup + * @description + * This plugin to create local backup + * + * @usage + * ```typescript + * import { LocalBackup } from '@ionic-native/local-backup/ngx'; + * + * + * constructor(private localBackup: LocalBackup) { } + * + * ... + * + * + * this.localBackup.create({data: {key: 'value'}}) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'LocalBackup', + plugin: 'cordova-plugin-local-backup', + pluginRef: 'LocalBackup', + repo: 'https://github.com/MaximBelov/cordova-plugin-local-backup', + install: 'ionic cordova plugin add cordova-plugin-local-backup', + platforms: ['Android', 'iOS'], +}) +@Injectable() +export class LocalBackup extends IonicNativePlugin { + @Cordova() + create(data: any): Promise { + return; + } + + @Cordova() + read(): Promise{ + return; + } + + @Cordova() + exists(): Promise{ + return; + } + + @Cordova() + remove(): Promise{ + return; + } +}