import { API } from "./raw"; import type { SubscribeListener, BazaarMessage, CollectionOptions, FilterObject, OrderBy, Doc, AnyDoc, DeepPartial, ContextOptions } from "../types"; /** * @internal */ export declare class CollectionAPI { private api; private collectionName; private collectionOptions; private contextOptions; constructor(api: API, collectionName: string, collectionOptions?: CollectionOptions, contextOptions?: ContextOptions); getOne(docId: string): Promise; getAll(filter?: FilterObject, options?: { startOffset?: number; endOffset?: number; orderBy?: OrderBy; }): Promise; getPage(pageNumber: number, pageSize: number, filter?: FilterObject, options?: { orderBy?: OrderBy; }): Promise; /** * @returns An unsubscribe function */ subscribeOne(docId: string, listener: SubscribeListener): Promise<() => Promise>; /** * @returns An unsubscribe function */ subscribeAll(filter: FilterObject, listener: SubscribeListener): Promise<() => Promise>; /** * @returns The doc ID */ insertOne(doc: Omit | T): Promise; updateOne(docId: string, doc: DeepPartial): Promise; replaceOne(docId: string, doc: Omit | T): Promise; deleteOne(docId: string): Promise; deleteAll(filter?: FilterObject): Promise; private withCollection; }