import { Observable } from 'rxjs'; import type { RxDocument, RxCollection, RxDocumentData, RxDocumentWriteData, UpdateQuery, CRDTEntry, ModifyFunction } from './types/index.d.ts'; export declare const basePrototype: { readonly primaryPath: import("./index.ts").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted$$: unknown; readonly deleted: boolean | undefined; getLatest(this: RxDocument): RxDocument; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable>; readonly $$: any; /** * returns observable of the value of the given path */ get$(this: RxDocument, path: string): Observable; get$$(this: RxDocument, path: string): unknown; /** * populate the given path */ populate(this: RxDocument, path: string): Promise; /** * get data by objectPath * @hotPath Performance here is really important, * run some tests before changing anything. */ get(this: RxDocument, objPath: string): any | null; toJSON(this: RxDocument, withMetaFields?: boolean): import("./index.ts").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }>; toMutableJSON(this: RxDocument, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }; /** * updates document * @overwritten by plugin (optional) * @param updateObj mongodb-like syntax */ update(_updateObj: UpdateQuery): never; incrementalUpdate(_updateObj: UpdateQuery): never; updateCRDT(_updateObj: CRDTEntry | CRDTEntry[]): never; putAttachment(): never; putAttachmentBase64(): never; getAttachment(): never; allAttachments(): never; readonly allAttachments$: void; modify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; /** * runs an incremental update over the document * @param function that takes the document-data and returns a new data-object */ incrementalModify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; patch(this: RxDocument, patch: Partial): Promise>; /** * patches the given properties */ incrementalPatch(this: RxDocument, patch: Partial): Promise>; /** * saves the new document-data * and handles the events */ _saveData(this: RxDocument, newData: RxDocumentWriteData, oldData: RxDocumentData): Promise>; /** * Remove the document. * Notice that there is no hard delete, * instead deleted documents get flagged with _deleted=true. */ remove(this: RxDocument): Promise; incrementalRemove(this: RxDocument): Promise; close(): never; }; export declare function createRxDocumentConstructor(proto?: { readonly primaryPath: import("./index.ts").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted$$: unknown; readonly deleted: boolean | undefined; getLatest(this: RxDocument): RxDocument; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable>; readonly $$: any; /** * returns observable of the value of the given path */ get$(this: RxDocument, path: string): Observable; get$$(this: RxDocument, path: string): unknown; /** * populate the given path */ populate(this: RxDocument, path: string): Promise; /** * get data by objectPath * @hotPath Performance here is really important, * run some tests before changing anything. */ get(this: RxDocument, objPath: string): any | null; toJSON(this: RxDocument, withMetaFields?: boolean): import("./index.ts").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }>; toMutableJSON(this: RxDocument, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }; /** * updates document * @overwritten by plugin (optional) * @param updateObj mongodb-like syntax */ update(_updateObj: UpdateQuery): never; incrementalUpdate(_updateObj: UpdateQuery): never; updateCRDT(_updateObj: CRDTEntry | CRDTEntry[]): never; putAttachment(): never; putAttachmentBase64(): never; getAttachment(): never; allAttachments(): never; readonly allAttachments$: void; modify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; /** * runs an incremental update over the document * @param function that takes the document-data and returns a new data-object */ incrementalModify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; patch(this: RxDocument, patch: Partial): Promise>; /** * patches the given properties */ incrementalPatch(this: RxDocument, patch: Partial): Promise>; /** * saves the new document-data * and handles the events */ _saveData(this: RxDocument, newData: RxDocumentWriteData, oldData: RxDocumentData): Promise>; /** * Remove the document. * Notice that there is no hard delete, * instead deleted documents get flagged with _deleted=true. */ remove(this: RxDocument): Promise; incrementalRemove(this: RxDocument): Promise; close(): never; }): { (this: RxDocument, collection: RxCollection, docData: RxDocumentData): void; prototype: { readonly primaryPath: import("./index.ts").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted$$: unknown; readonly deleted: boolean | undefined; getLatest(this: RxDocument): RxDocument; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable>; readonly $$: any; /** * returns observable of the value of the given path */ get$(this: RxDocument, path: string): Observable; get$$(this: RxDocument, path: string): unknown; /** * populate the given path */ populate(this: RxDocument, path: string): Promise; /** * get data by objectPath * @hotPath Performance here is really important, * run some tests before changing anything. */ get(this: RxDocument, objPath: string): any | null; toJSON(this: RxDocument, withMetaFields?: boolean): import("./index.ts").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }>; toMutableJSON(this: RxDocument, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./index.ts").RxAttachmentData; }; _rev: string; _meta: import("./index.ts").RxDocumentMeta; }; /** * updates document * @overwritten by plugin (optional) * @param updateObj mongodb-like syntax */ update(_updateObj: UpdateQuery): never; incrementalUpdate(_updateObj: UpdateQuery): never; updateCRDT(_updateObj: CRDTEntry | CRDTEntry[]): never; putAttachment(): never; putAttachmentBase64(): never; getAttachment(): never; allAttachments(): never; readonly allAttachments$: void; modify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; /** * runs an incremental update over the document * @param function that takes the document-data and returns a new data-object */ incrementalModify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string): Promise; patch(this: RxDocument, patch: Partial): Promise>; /** * patches the given properties */ incrementalPatch(this: RxDocument, patch: Partial): Promise>; /** * saves the new document-data * and handles the events */ _saveData(this: RxDocument, newData: RxDocumentWriteData, oldData: RxDocumentData): Promise>; /** * Remove the document. * Notice that there is no hard delete, * instead deleted documents get flagged with _deleted=true. */ remove(this: RxDocument): Promise; incrementalRemove(this: RxDocument): Promise; close(): never; }; }; export declare function createWithConstructor(constructor: any, collection: RxCollection, jsonData: RxDocumentData): RxDocument | null; export declare function isRxDocument(obj: any): boolean; export declare function beforeDocumentUpdateWrite(collection: RxCollection, newData: RxDocumentWriteData, oldData: RxDocumentData): Promise;