mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
fix(DocumentPicker) uses String instead of DocumentPickerOptions
This commit is contained in:
parent
bfbbc2ee12
commit
e9580b46ef
@ -2,18 +2,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter options
|
|
||||||
*/
|
|
||||||
export enum DocumentPickerOptions {
|
|
||||||
/** Show only PDF files */
|
|
||||||
PDF = 'pdf',
|
|
||||||
/** show only image files */
|
|
||||||
IMAGE = 'image',
|
|
||||||
/** show all files */
|
|
||||||
ALL = 'all'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name DocumentPicker
|
* @name DocumentPicker
|
||||||
@ -24,13 +12,13 @@ export enum DocumentPickerOptions {
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { DocumentPicker, DocumentPickerOptions } from '@ionic-native/document-picker';
|
* import { DocumentPicker } from '@ionic-native/document-picker';
|
||||||
*
|
*
|
||||||
* constructor(private docPicker: DocumentPicker) { }
|
* constructor(private docPicker: DocumentPicker) { }
|
||||||
*
|
*
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
* this.docPicker.getFile(DocumentPickerOptions.ALL)
|
* this.docPicker.getFile('all')
|
||||||
* .then(uri => console.log(uri))
|
* .then(uri => console.log(uri))
|
||||||
* .catch(e => console.log(e));
|
* .catch(e => console.log(e));
|
||||||
*
|
*
|
||||||
@ -48,10 +36,10 @@ export class DocumentPicker extends IonicNativePlugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a file
|
* Open a file
|
||||||
* @param {DocumentPickerOptions} filters files between 'image', 'pdf' or 'all'
|
* @param {string} filters files between 'image', 'pdf' or 'all'
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getFile(options?: DocumentPickerOptions | string): Promise<string> { return; }
|
getFile(options?: string): Promise<string> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user