mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 00:12:53 +08:00
feat(multiple-document-picker): add plugin (#3551)
* feat(multiple-document-picker): add plugin * removed package json related changes
This commit is contained in:
parent
46853b4212
commit
78e92422ab
47
src/@ionic-native/plugins/multiple-document-picker/index.ts
Normal file
47
src/@ionic-native/plugins/multiple-document-picker/index.ts
Normal 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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user