import { IDisposable } from "../../Types/Contracts.js"; import { DocumentStore } from "../DocumentStore.js"; import { SubscriptionCreationOptions } from "./SubscriptionCreationOptions.js"; import { DocumentType } from "../DocumentAbstractions.js"; import { SubscriptionWorkerOptions } from "./SubscriptionWorkerOptions.js"; import { Revision } from "./Revision.js"; import { SubscriptionState } from "./SubscriptionState.js"; import { SubscriptionWorker } from "./SubscriptionWorker.js"; import { SubscriptionUpdateOptions } from "./SubscriptionUpdateOptions.js"; export declare class DocumentSubscriptions implements IDisposable { private readonly _store; private readonly _subscriptions; constructor(store: DocumentStore); /** * Creates a data subscription in a database. The subscription will expose all * documents that match the specified subscription options for a given type. */ create(options: SubscriptionCreationOptions): Promise; /** * Creates a data subscription in a database. The subscription will expose all * documents that match the specified subscription options for a given type. */ create(options: SubscriptionCreationOptions, database: string): Promise; /** * Creates a data subscription in a database. The subscription will expose all * documents that match the specified subscription options for a given type. */ create(documentType: DocumentType): Promise; /** * Creates a data subscription in a database. The subscription will expose all documents * that match the specified subscription options for a given type. */ createForRevisions(options: SubscriptionCreationOptions): Promise; /** * Creates a data subscription in a database. The subscription will expose all documents * that match the specified subscription options for a given type. */ createForRevisions(options: SubscriptionCreationOptions, database: string): Promise; private _ensureCriteria; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorker(options: SubscriptionWorkerOptions): SubscriptionWorker; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorker(options: SubscriptionWorkerOptions, database: string): SubscriptionWorker; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorker(subscriptionName: string): SubscriptionWorker; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorker(subscriptionName: string, database: string): SubscriptionWorker; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorkerForRevisions(options: SubscriptionWorkerOptions): SubscriptionWorker>; /** * It opens a subscription and starts pulling documents since a last processed document for that subscription. * The connection options determine client and server cooperation rules like document batch sizes * or a timeout in a matter of which a client needs to acknowledge that batch has been processed. * The acknowledgment is sent after all documents are processed by subscription's handlers. * * There can be only a single client that is connected to a subscription. */ getSubscriptionWorkerForRevisions(options: SubscriptionWorkerOptions, database: string): SubscriptionWorker>; /** * It downloads a list of all existing subscriptions in a database. */ getSubscriptions(start: number, take: number): Promise; /** * It downloads a list of all existing subscriptions in a database. */ getSubscriptions(start: number, take: number, database: string): Promise; /** * Delete a subscription. */ delete(name: string): Promise; /** * Delete a subscription. */ delete(name: string, database: string): Promise; /** * Returns subscription definition and it's current state */ getSubscriptionState(subscriptionName: string): Promise; /** * Returns subscription definition and it's current state */ getSubscriptionState(subscriptionName: string, database: string): Promise; dispose(): void; dropSubscriptionWorker(worker: SubscriptionWorker, database?: string): Promise; /** * Force server to close all current client subscription connections to the server */ dropConnection(name: string): Promise; /** * Force server to close all current client subscription connections to the server */ dropConnection(name: string, database: string): Promise; enable(name: string): any; enable(name: string, database: string): any; disable(name: string): any; disable(name: string, database: string): any; update(options: SubscriptionUpdateOptions): Promise; update(options: SubscriptionUpdateOptions, database: string): Promise; } //# sourceMappingURL=DocumentSubscriptions.d.ts.map