import { Location } from './location'; /** * Abstracts storage to file system or html localStorage. * TODO: rename Storage to SyncStorage, and this to Storage, * and phase out SyncStorage. */ export declare class AsyncStorage { readonly location: Location; private readonly localStorage; /** * @param location file or logical path */ constructor(location: string); exists(): Promise; read(): Promise; /** * For file system storage, all newlines are replaced with OS-appropriate */ write(contents: string): Promise; /** * For file system storage, all newlines are replaced with OS-appropriate */ append(contents: string): Promise; insert(contents: string, start: number): Promise; padLines(start: number, lines: number): Promise; clear(): Promise; remove(): Promise; /** * TODO local storage */ mkdir(): Promise; toString(): string; } /** * Abstracts storage to file system or html localStorage. */ export declare class Storage { readonly location: Location; private readonly localStorage; /** * @param location file or logical path */ constructor(location: string); get exists(): boolean; read(): string | undefined; /** * For file system storage, all newlines are replaced with OS-appropriate */ write(contents: string): void; /** * For file system storage, all newlines are replaced with OS-appropriate */ append(contents: string): void; insert(contents: string, start: number): void; padLines(start: number, lines: number): void; clear(): void; remove(): void; mkdir(): void; toString(): string; }