Skip to content

Commit

Permalink
feat(chooser): add getFileMetadata (#3425)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcelikdev authored Jun 11, 2020
1 parent 1aacb48 commit 79c3284
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/@ionic-native/plugins/chooser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 79c3284

Please sign in to comment.