@bitblit/asyncglk
Version:
A Typescript Glk library
37 lines (36 loc) • 1.81 kB
TypeScript
import { type GlkTypedArray } from '../../common/misc.js';
import type { FileRef } from '../../common/protocol.js';
import type { AutosaveData, ClassicSyncDialog, ClassicStreamingDialog, DialogOptions } from './interface.js';
/** A file buffer which stores its data in its preferred stream format, only converting back to a Uint8Array when required */
export declare class FileBuffer {
private binary;
private buf;
fref: FileRef;
private uni;
constructor(buf: GlkTypedArray, binary: boolean, fref: FileRef);
convert(): Uint8Array;
}
/** A Dialog class that wraps another Dialog instance, caching files so that they can be written asyncronously */
export declare class CachingDialogWrapper implements ClassicSyncDialog {
'async': false;
private cache;
classname: string;
private Dialog;
streaming: false;
constructor(Dialog: ClassicSyncDialog | ClassicStreamingDialog);
init(_options: DialogOptions): void;
file_ref_exists(fref: FileRef): boolean;
file_read(fref: FileRef): Uint8Array | null;
file_remove_ref(fref: FileRef): void;
file_write(_fref: FileRef, _content: Uint8Array): boolean;
inited(): boolean;
private write;
write_file(fref: FileRef, content: FileBuffer): boolean;
autosave_read(signature: string): AutosaveData | null;
autosave_write(signature: string, snapshot: AutosaveData | null): void;
file_clean_fixed_name(filename: string, usage: number): string;
file_construct_ref(filename?: string, usage?: string, gameid?: string): FileRef;
file_construct_temp_ref(usage: string): FileRef;
getlibrary(name: string): import("../../index-common.js").GlkOte | null;
open(save: boolean, usage: string | null, gameid: string | null | undefined, callback: (fref: FileRef | null) => void): void;
}