react-native-document-picker-macos
Version:
49 lines • 1.63 kB
TypeScript
export interface PickerOptions {
/**
* Whether multiple items can be selected
*
* @default false
*/
multiple?: boolean;
/**
* An array of Uniform Type Identifiers (UTIs) limiting the allowed content types
* If not provided, any type is allowed
*
* @example ['public.image', 'public.video']
* @see https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html
*/
allowedUTIs?: string[];
}
export interface File {
/** Absolute file path on disk */
path: string;
/** File URI (file://) */
uri: string;
/** Last path component */
name: string;
/** File size in bytes */
size: number | null;
/** Mime-type @example 'image/jpeg' */
mimeType: string | null;
}
export interface Directory {
/** Absolute directory path on disk */
path: string;
/** File URI (file://) */
uri: string;
/** Last path component */
name: string;
/** Directory size in bytes */
size: number | null;
}
/**
* Presents the native macOS file picker
* Resolves with an array of results; at most 1 element if `multiple` is false, or none if the user canceled the dialog
*/
export declare function pickFile(options?: PickerOptions): Promise<File[]>;
/**
* Presents the native macOS directory picker
* Resolves with an array of results; at most 1 element if `multiple` is false, or none if the user canceled the dialog
*/
export declare function pickDirectory(options?: PickerOptions): Promise<Directory[]>;
//# sourceMappingURL=index.d.ts.map