feat(multiple-document-picker): add plugin (#3551)

* feat(multiple-document-picker): add plugin

* removed package json related changes
This commit is contained in:
agarwalnaveen22 2020-11-19 13:09:32 +05:30 committed by GitHub
parent 46853b4212
commit 78e92422ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<any>} Returns a promise that resolves when something happens
*/
@Cordova()
pick(type: number): Promise<any> {
return; // We add return; here to avoid any IDE / Compiler errors
}
}