///
///
import uuid from './uuid';
declare type RelDB = ReturnType;
declare function setSchema(this: PouchDB.Database, schema: any): PouchDB.RelDatabase;
declare function createRel(db: PouchDB.Database, keysToSchemas: any, schema: any): {
save: (type: any, obj: any) => Promise<{
id: any;
rev: string;
}>;
find: (type: any, idOrIds?: any) => Promise;
findHasMany: (type: any, belongsToKey: any, belongsToId: any) => Promise;
del: (type: any, obj: any) => Promise<{
deleted: boolean;
}>;
getAttachment: (type: any, id: any, attachmentId: any, options?: any) => Promise;
putAttachment: (type: any, obj: any, attachmentId: any, attachment: any, attachmentType: any) => Promise;
removeAttachment: (type: any, obj: any, attachmentId: any) => Promise;
parseDocID: (str: any) => {
type: any;
id: any;
};
makeDocID: (obj: any) => string;
parseRelDocs: (type: any, pouchDocs: any) => Promise;
isDeleted: (type: any, id: any) => Promise;
uuid: typeof uuid;
};
declare const _default: {
setSchema: typeof setSchema;
};
export default _default;
declare global {
namespace PouchDB {
interface Static {
plugin(plugin: T): Static;
}
interface Database {
setSchema(schema: any): RelDatabase;
}
interface RelDatabase extends Database {
rel: RelDB;
}
}
}