Skip to content

Commit

Permalink
feat(multiple-document-picker): add plugin (#3551)
Browse files Browse the repository at this point in the history
* feat(multiple-document-picker): add plugin

* removed package json related changes
  • Loading branch information
agarwalnaveen22 committed Nov 19, 2020
1 parent 46853b4 commit 78e9242
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions 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<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
}
}

0 comments on commit 78e9242

Please sign in to comment.