helene
Version:
Real-time Web Apps for Node.js
18 lines (17 loc) • 754 B
TypeScript
/**
* Way data is stored for this database
* For a Node.js/Node Webkit database it's the file system
* For a browser-side database it's localforage which chooses the best option depending on user browser (IndexedDB then WebSQL then localStorage)
*
* This version is the Node.js/Node Webkit version
* It's essentially fs, mkdirp and crash safe write and read functions
*/
import { IStorage } from '../types';
export declare class BrowserStorage implements IStorage {
read(name: string): Promise<string>;
/**
* Fully write or rewrite the datafile, immune to crashes during the write operation (data will not be lost)
*/
write(name: string, data: string): Promise<void>;
append(name: string, data: string): Promise<void>;
}