/** @public */ export interface StorageCursor { limit(number_: number): StorageCursor sort(parameters: Record): StorageCursor skip(offset: number): StorageCursor toArray(): Promise } /** @public */ export class ErrStorage extends Error {} /** @public */ export class ErrNoSession extends ErrStorage {} /** @public */ export abstract class Storage { protected _dsn: string constructor(dsn: string) { this._dsn = dsn } abstract find(name: string, query: Record): Promise abstract save(name: string, uniqKey: string, data: Record): Promise abstract createSession(): StorageSession abstract count(name: string, query?: Record): Promise abstract remove(collectionName: string, uniqKeyName: string, uniqKey: string): Promise } /** @public */ export abstract class StorageSession { abstract start(options?: Record): Promise abstract commit(fn: () => any, options?: Record): Promise }