Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chooser): add getFileMetadata #3425

Merged
merged 1 commit into from
Jun 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}