import type { Graffiti, GraffitiObjectBase, GraffitiLocation } from "@graffiti-garden/api"; import Ajv from "ajv-draft-04"; /** * Constructor options for the GraffitiPoubchDB class. */ export interface GraffitiPouchDBOptions { /** * Options to pass to the PouchDB constructor. * Defaults to `{ name: "graffitiDb" }`. * * See the [PouchDB documentation](https://pouchdb.com/api.html#create_database) * for available options. */ pouchDBOptions?: PouchDB.Configuration.DatabaseConfiguration; /** * Defines the name of the {@link https://api.graffiti.garden/interfaces/GraffitiObjectBase.html#source | `source` } * under which to store objects. * Defaults to `"local"`. */ sourceName?: string; /** * The time in milliseconds to keep tombstones before deleting them. * See the {@link https://api.graffiti.garden/classes/Graffiti.html#discover | `discover` } * documentation for more information. */ tombstoneRetention?: number; } /** * An implementation of only the database operations of the * GraffitiAPI without synchronization or session management. */ export declare class GraffitiPouchDBBase { protected readonly db: PouchDB.Database; protected readonly source: string; protected readonly tombstoneRetention: number; protected readonly ajv: Ajv; constructor(options?: GraffitiPouchDBOptions, ajv?: Ajv); protected queryByLocation(location: GraffitiLocation): Promise[]>; protected docId(location: GraffitiLocation): string; get: Graffiti["get"]; /** * Deletes all docs at a particular location. * If the `keepLatest` flag is set to true, * the doc with the most recent timestamp will be * spared. If there are multiple docs with the same * timestamp, the one with the highest `_id` will be * spared. */ protected deleteAtLocation(location: GraffitiLocation, keepLatest?: boolean): Promise; delete: Graffiti["delete"]; put: Graffiti["put"]; patch: Graffiti["patch"]; discover: Graffiti["discover"]; listChannels: Graffiti["listChannels"]; listOrphans: Graffiti["listOrphans"]; } //# sourceMappingURL=database.d.ts.map