export interface JsonStore { load(): Promise; save(value: T): Promise; } export interface JsonlStore { append(value: T): Promise; read(options?: { last?: number }): Promise; trim(options: { keepLast: number }): Promise; } export interface Storage { json(name: string, options?: { defaults?: T }): JsonStore; jsonl(name: string): JsonlStore; } export interface RawBackend { read(name: string): Promise; write(name: string, content: string): Promise; append(name: string, line: string): Promise; readLines(name: string, options?: { last?: number }): Promise; trimLines(name: string, keepLast: number): Promise; }