/** * Standalone JSON database layer for CLI usage. * * Reads and writes directly to JSON files without requiring the Stonyx * bootstrap, ORM init, or any framework dependencies. Supports both * single-file and directory modes. */ interface StandaloneDBOptions { dbPath?: string; mode?: 'file' | 'directory'; directory?: string; } interface DBRecord { id: string | number; [key: string]: unknown; } export default class StandaloneDB { readonly mode: 'file' | 'directory'; readonly dbPath: string; readonly directory: string; constructor(options?: StandaloneDBOptions); /** * Resolve the directory path for directory mode. */ getDirPath(): string; /** * List available collections by inspecting either the db.json keys * or the files in the db directory. */ getCollections(): Promise; /** * Read all records for a collection. */ readCollection(collection: string): Promise; /** * Write all records for a collection. */ writeCollection(collection: string, records: DBRecord[]): Promise; /** * Get a single record by id. */ get(collection: string, id: string | number): Promise; /** * List all records in a collection. */ list(collection: string): Promise; /** * Create a new record. Auto-assigns an integer id if none provided. */ create(collection: string, data: DBRecord): Promise; /** * Delete a record by id. */ delete(collection: string, id: string | number): Promise; private _readJSON; private _writeJSON; } export {};