import { Observable } from 'rxjs'; import type { RxDocument, RxCollection, RxDocumentData, RxDocumentWriteData, UpdateQuery, CRDTEntry, ModifyFunction } from './types'; export declare const basePrototype: { readonly primaryPath: import("./types").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted: boolean | undefined; getLatest(this: import("./types").RxDocumentBase<{}, {}>): import("./types").RxDocumentBase<{}, {}>; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable; /** * returns observable of the value of the given path */ get$(this: import("./types").RxDocumentBase<{}, {}>, path: string): Observable; /** * populate the given path */ populate(this: import("./types").RxDocumentBase<{}, {}>, path: string): Promise; /** * get data by objectPath */ get(this: import("./types").RxDocumentBase<{}, {}>, objPath: string): any | null; toJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): import("./types").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }>; toMutableJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").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; 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: import("./types").RxDocumentBase<{}, {}>, 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: import("./types").RxDocumentBase<{}, {}>): Promise; incrementalRemove(this: import("./types").RxDocumentBase<{}, {}>): Promise; destroy(): never; }; export declare function createRxDocumentConstructor(proto?: { readonly primaryPath: import("./types").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted: boolean | undefined; getLatest(this: import("./types").RxDocumentBase<{}, {}>): import("./types").RxDocumentBase<{}, {}>; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable; /** * returns observable of the value of the given path */ get$(this: import("./types").RxDocumentBase<{}, {}>, path: string): Observable; /** * populate the given path */ populate(this: import("./types").RxDocumentBase<{}, {}>, path: string): Promise | null>; /** * get data by objectPath */ get(this: import("./types").RxDocumentBase<{}, {}>, objPath: string): any; toJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): import("./types").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }>; toMutableJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").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; getAttachment(): never; allAttachments(): never; readonly allAttachments$: void; modify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string | undefined): Promise>; /** * runs an incremental update over the document * @param function that takes the document-data and returns a new data-object */ incrementalModify(this: import("./types").RxDocumentBase<{}, {}>, mutationFunction: ModifyFunction, _context?: string | undefined): 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: import("./types").RxDocumentBase<{}, {}>): Promise>; incrementalRemove(this: import("./types").RxDocumentBase<{}, {}>): Promise>; destroy(): never; }): { (this: import("./types").RxDocumentBase<{}, {}>, collection: RxCollection, docData: RxDocumentData): void; prototype: { readonly primaryPath: import("./types").StringKeys<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }> | undefined; readonly primary: any; readonly revision: string | undefined; readonly deleted$: any; readonly deleted: boolean | undefined; getLatest(this: import("./types").RxDocumentBase<{}, {}>): import("./types").RxDocumentBase<{}, {}>; /** * returns the observable which emits the plain-data of this document */ readonly $: Observable; /** * returns observable of the value of the given path */ get$(this: import("./types").RxDocumentBase<{}, {}>, path: string): Observable; /** * populate the given path */ populate(this: import("./types").RxDocumentBase<{}, {}>, path: string): Promise | null>; /** * get data by objectPath */ get(this: import("./types").RxDocumentBase<{}, {}>, objPath: string): any; toJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): import("./types").DeepReadonlyObject<{ _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").RxDocumentMeta; }>; toMutableJSON(this: import("./types").RxDocumentBase<{}, {}>, withMetaFields?: boolean): { _deleted: boolean; _attachments: { [attachmentId: string]: import("./types").RxAttachmentData; }; _rev: string; _meta: import("./types").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; getAttachment(): never; allAttachments(): never; readonly allAttachments$: void; modify(this: RxDocument, mutationFunction: ModifyFunction, _context?: string | undefined): Promise>; /** * runs an incremental update over the document * @param function that takes the document-data and returns a new data-object */ incrementalModify(this: import("./types").RxDocumentBase<{}, {}>, mutationFunction: ModifyFunction, _context?: string | undefined): 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: import("./types").RxDocumentBase<{}, {}>): Promise>; incrementalRemove(this: import("./types").RxDocumentBase<{}, {}>): Promise>; destroy(): never; }; }; export declare function defineGetterSetter(schema: any, valueObj: any, objPath?: string, thisObj?: boolean): void; 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;