/**
 * Provides types for the experimental File System Access API available in Chromium-based browsers
 * See: https://wicg.github.io/file-system-access/
 */
type WellKnownPath = 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos';
type PermissionMode = 'read' | 'readwrite';
type PermissionState = PermissionStatus['state'];
export type FilePickerType = {
    description?: string;
    accept: {
        [mimetype: string]: string[];
    };
};
type SharedPickerOptions = {
    id?: unknown;
    startIn?: WellKnownPath | FileSystemHandle;
};
type SharedFilePickerOptions = SharedPickerOptions & {
    excludeAcceptAllOption?: boolean;
    types?: FilePickerType[];
};
type ShowOpenFilePickerOptions = SharedFilePickerOptions & {
    multiple?: boolean;
};
type ShowSaveFilePickerOptions = SharedFilePickerOptions & {
    suggestedName?: string;
};
type ShowDirectoryPickerOptions = SharedPickerOptions & {
    mode?: PermissionMode;
};
type FileAccessAPI = {
    showOpenFilePicker: (options?: ShowOpenFilePickerOptions) => Promise<FileSystemFileHandle[]>;
    showSaveFilePicker: (options?: ShowSaveFilePickerOptions) => Promise<FileSystemFileHandle>;
    showDirectoryPicker: (options?: ShowDirectoryPickerOptions) => Promise<FileSystemDirectoryHandle>;
};
type FileAccessDataTransferItem = {
    getAsFileSystemHandle: () => Promise<FileSystemFileHandle | FileSystemDirectoryHandle | null>;
};
type FileAccessPermissionOptions = {
    mode: PermissionMode;
};
export declare const fileAccessContext: Window & typeof globalThis & FileAccessAPI;
export declare const hasFileAccessAPI: boolean;
/**
 * Attempts to acquire a FileSystemHandle from a DataTransferItem if running in a
 * browser with File Access API, otherwise returns null
 * @param item
 */
export declare function tryGetAsFilesystemHandle(item: DataTransferItem): ReturnType<FileAccessDataTransferItem['getAsFileSystemHandle']>;
export declare function tryQueryPermission(handle: FileSystemHandle, options: FileAccessPermissionOptions): Promise<PermissionState>;
export declare function tryGetFile(handle: FileSystemFileHandle | File): Promise<File>;
/**
 * Convert the File Access API style accept object to a flat string suitable for <input type=file>
 * @param types Array of FilePickerType objects
 */
export declare function flattenAcceptTypes(types: FilePickerType[] | undefined): string | undefined;
export {};
