From 78e92422abb5a645ed09bf61b7dc250462ccc742 Mon Sep 17 00:00:00 2001 From: agarwalnaveen22 Date: Thu, 19 Nov 2020 13:09:32 +0530 Subject: [PATCH] feat(multiple-document-picker): add plugin (#3551) * feat(multiple-document-picker): add plugin * removed package json related changes --- .../plugins/multiple-document-picker/index.ts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/@ionic-native/plugins/multiple-document-picker/index.ts diff --git a/src/@ionic-native/plugins/multiple-document-picker/index.ts b/src/@ionic-native/plugins/multiple-document-picker/index.ts new file mode 100644 index 0000000000..1ec7387758 --- /dev/null +++ b/src/@ionic-native/plugins/multiple-document-picker/index.ts @@ -0,0 +1,47 @@ +/** + * This is a wrapper for MultipleDocumentsPicker plugin + * + */ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name Multiple Documents Picker + * @description + * This plugin allows users to pick multiple documents/images at once + * + * @usage + * ```typescript + * import { MultipleDocumentsPicker } from '@ionic-native/multiple-document-picker/ngx'; + * + * + * constructor(private multipleDocumentsPicker: MultipleDocumentsPicker) { } + * + * ... + * + * + * this.multipleDocumentsPicker.pick(1) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'MultipleDocumentsPicker', + plugin: 'cordova-plugin-multiple-documents-picker', + pluginRef: 'multipleDocumentsPicker', + repo: 'https://github.com/akeotech/cordova-plugin-multiple-documents-picker', + platforms: ['Android', 'iOS'], +}) +@Injectable() +export class MultipleDocumentsPicker extends IonicNativePlugin { + /** + * This function allow user to show native file picker + * @param type {number} To pick type of files: for images send 1, for all files send 2 + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + pick(type: number): Promise { + return; // We add return; here to avoid any IDE / Compiler errors + } +}