import { BiDi } from "../../index"; import Session from "../session/commands"; import WebSocket from "ws"; import { ScriptEventName, ScriptEventSubscriptionType } from "./types/EventTypes"; /** * Handles script events and subscriptions. */ export declare class ScriptEvents { /** * BiDi connection instance. */ _ws: BiDi; /** * WebSocket connection instance. */ _connection: WebSocket; /** * Session instance. */ _session: Session; /** * Map of event subscriptions. */ eventSubscriptions: Map; /** * Initializes the ScriptEvents instance. * @param BiDiConnection - BiDi connection instance. */ constructor(BiDiConnection: BiDi); /** * Gets the event subscription data. * @returns Map of event subscriptions. */ get eventSubscriptionData(): Map; /** * Handles an event subscription. * @param eventName - Name of the event. * @returns Promise that resolves when the event is handled. */ private handleEvent; /** * Subscribes to message events. * @returns Promise that resolves when the subscription is successful. */ message(): Promise; /** * Subscribes to realm created events. * @returns Promise that resolves when the subscription is successful. */ realmCreated(): Promise; /** * Subscribes to realm destroyed events. * @returns Promise that resolves when the subscription is successful. */ realmDestroyed(): Promise; }