import { AuthorizationKey, StorageSchema } from '@verdant-web/common'; import { EntityStore } from '../entities/EntityStore.js'; import { ObjectEntity } from '../index.js'; /** * Exposes functionality for creating documents, * the only mutation which is available as an entry * point in the storage system. */ export declare class DocumentManager> { private schema; private entities; constructor(schema: Schema, entities: EntityStore); private getOid; private addDefaults; private validate; create: (collection: string, init: any, options?: { undoable?: boolean; access?: AuthorizationKey; silenceAccessControlWithPrimaryKeyWarning?: boolean; }) => Promise; delete: (collection: string, primaryKey: string, options?: { undoable?: boolean; }) => Promise; deleteAll: (ids: [string, string][], options?: { undoable?: boolean; }) => Promise; deleteAllFromCollection: (collection: string, ids: string[], options?: { undoable?: boolean; }) => Promise; /** * Creates a clone of the given document entity, returning a new * document entity in the given collection. The primary key of * the original document will be regenerated automatically and * access will be copied from the original. Both can be overridden * explicitly via options. */ clone: (collection: string, entity: ObjectEntity, options?: { undoable?: boolean; access?: AuthorizationKey; primaryKey?: string; /** * Modify the data before cloning */ update?: (init: TInit) => TInit; }) => Promise; }