feat(chooser): add getFileMetadata (#3425)

This commit is contained in:
mcelikdev 2020-06-11 18:13:34 +02:00 committed by GitHub
parent 1aacb487a4
commit 79c3284434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,8 @@ import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ChooserResult {
data: Uint8Array;
dataURI: string;
data?: Uint8Array;
dataURI?: string;
mediaType: string;
name: string;
uri: string;
@ -64,4 +64,15 @@ export class Chooser extends IonicNativePlugin {
getFile(accept?: string): Promise<ChooserResult | undefined> {
return;
}
/**
* Displays native prompt for user to select a file.
* @param {string} [accept] Optional MIME type filter (e.g. 'image/gif,video/*').
* @returns {Promise<any>} Promise containing selected file's MIME type, display name, and original URI.
* If user cancels, promise will be resolved as undefined.
* If error occurs, promise will be rejected.
*/
@Cordova()
getFileMetadata(accept?: string): Promise<ChooserResult | undefined> {
return;
}
}