import { RealtimeController, Notification, JSONObject, ScopeOption, UserOption, Kuzzle, ResponsePayload, BaseRequest } from "kuzzle-sdk"; interface EmbeddedRealtime extends RealtimeController { /** * Subscribes by providing a set of filters: messages, document changes * and, optionally, user events matching the provided filters will generate * real-time notifications. * * @see https://docs.kuzzle.io/core/2/guides/main-concepts/realtime-engine/ * * @param index Index name * @param collection Collection name * @param filters Optional subscription filters * @param callback Callback function to handle notifications * @param options Additional options * - `scope` Subscribe to document entering or leaving the scope. (default: 'all') * - `users` Subscribe to users entering or leaving the room. (default: 'none') * - `subscribeToSelf` Subscribe to notifications fired by our own queries. (default: true) * - `volatile` Subscription information sent alongside notifications. (default: `{}`) * - `propagate` Propagate the callback execution on each cluster node. (default: false) * * @returns A string containing the room ID */ subscribe(index: string, collection: string, filters: JSONObject, callback: (notification: Notification) => void | Promise, options?: { /** * Subscribe to document entering or leaving the scope. (default: 'all') */ scope?: ScopeOption; /** * Subscribe to users entering or leaving the room. (default: 'none') */ users?: UserOption; /** * Subscribe to notifications fired by our own queries. (default: true) */ subscribeToSelf?: boolean; /** * Subscription information sent alongside notifications */ volatile?: JSONObject; /** * Propagate the callback execution on each cluster node (default: false) */ propagate?: boolean; }): Promise; } /** * Kuzzle embedded SDK to make API calls inside applications or plugins. */ export declare class EmbeddedSDK extends Kuzzle { realtime: EmbeddedRealtime; constructor(); /** * Returns a new SDK impersonated with the provided user. * * @param user - User to impersonate the SDK with * @param options - Optional sdk arguments */ as(user: { _id: string; }, options?: { checkRights: boolean; }): EmbeddedSDK; /** * Sends an API request to Kuzzle. * * This is a low-level method, exposed to allow advanced SDK users to bypass * high-level methods. * * @param request - API request (https://docs.kuzzle.io/core/2/guides/main-concepts/1-api#other-protocols) * @param options - Optional arguments */ query(request: TRequest, options?: { propagate?: boolean; }): Promise>; } export {};