interface Response { ok: boolean; id: string; rev: string; error?: string; } interface DeleteResponse { ok: boolean; rev: string; } declare type New = T & { _id?: string; _rev?: string; }; declare type DbDoc = T & { _id: string; _rev: string; }; declare type Doc = DbDoc & { error?: string; reason?: string; }; interface Db { req: (path: string, method: string, opts?: any) => Promise; get: (docName: string) => Promise>; rawGet: (docName: string) => Promise>; getAll: (keys?: string[]) => Promise; }>>; post: (doc: New | DbDoc) => Promise; put: (doc: New, docID: string) => Promise; del: (_id: string, _rev: string) => Promise; query: (queryObj: any) => Promise>>; bulkInsert: (docs: Array>) => Promise>; } interface Session { response: { ok: boolean; error?: string; userCtx: { name: string; roles: string[]; }; }; AuthSession: string; } interface Login { response: { ok: boolean; error?: string; name: string; roles: string[]; }; AuthSession: string; } interface Lantier { use: (dbName: N) => Db; session: (session: string) => Promise; login: (username: string, password: string) => Promise; } interface InitOptions { adminMode?: boolean; username: string; password: string; log?: boolean; } declare function Lantier(dbURL: string, opts: InitOptions): Lantier; export default Lantier;