@bitblit/asyncglk
Version:
A Typescript Glk library
41 lines (40 loc) • 1.68 kB
TypeScript
import type { ProgressCallback } from '../../common/file.js';
import type { DialogDirectories, DialogOptions } from '../common/interface.js';
import type { BrowseableProvider, BrowserDialog, DirEntry, DownloadOptions } from './interface.js';
export declare class ProviderBasedBrowserDialog implements BrowserDialog {
'async': true;
private controller?;
private dirs;
private downloader;
private providers;
init(options: DialogOptions & DownloadOptions): Promise<void>;
download(url: string, progress_callback?: ProgressCallback): Promise<string>;
get_dirs(): DialogDirectories;
prompt(extension: string, save: boolean): Promise<string | null>;
set_storyfile_dir(path: string): Partial<DialogDirectories>;
upload(file: File): Promise<string>;
delete(path: string): Promise<void>;
exists(path: string): Promise<boolean>;
read(path: string): Promise<Uint8Array | null>;
write(files: Record<string, Uint8Array>): Promise<void>;
private setup;
}
/** Controller for FileDialog */
export declare class DialogController {
private dialog;
private metadata;
private provider;
constructor(provider: BrowseableProvider);
prompt(extension: string, save: boolean): Promise<string | null>;
delete(file: DirEntry): Promise<void>;
download(file: DirEntry): Promise<void>;
new_folder(path: string): Promise<void>;
rename(file: DirEntry, new_file_name: string): Promise<void>;
update(refresh?: boolean): Promise<void>;
update_working(path: string): void;
upload(files: Record<string, File>): Promise<void>;
}
export interface Filter {
extensions: string[];
label?: string;
}