/** * Event listener function identifier */ export declare class EventIdentifier { private readonly _identifier; private readonly _once; /** * Event listener function identifier * * @param {string} identifier string identifier * @param {boolean} once listener type */ constructor(identifier?: string, once?: boolean); /** * Returns the string identifier * * @alias `identifier` * * @returns {string} string identifier */ toString(): string; /** * Returns the string identifier * * @alias `toString` * * @returns {string} string identifier */ get identifier(): string; /** * Returns the listener type * * @returns {boolean} listener type, `true` — one‑shot */ get once(): boolean; /** * Compares two identifiers for equality * * @param {EventIdentifier} identifier identifier to compare with * @returns {boolean} comparison result */ equal(identifier: EventIdentifier): boolean; } /** * Global SDK event bus */ export default class EventBus { /** List of all registered events */ private _events; /** * Add a new event listener * * @param event event to listen for * @param {(...args: EventDescription[*]) => void} callback function to be called when the event fires * @param {boolean} once optional listener type * @param {string} identifier optional listener identifier * @returns {EventIdentifier} pointer to the specific function bound to this event */ addCallback(event: E, callback: (...args: EventDescription[E]) => void, once?: boolean, identifier?: string): EventIdentifier; /** * Remove a specific event listener * * @param event name of the event for which to remove the listener * @param {((...args: EventDescription[*]) => void) | EventIdentifier} callback registered function or its identifier * @returns {boolean} result of the removal */ removeCallback(event: E, callback?: ((...args: EventDescription[E]) => void) | EventIdentifier): boolean; /** * Internal method that triggers all listeners for a given event * * @param {E} event event name * @param {any} args arguments passed to the listeners * @returns {boolean} execution result */ emitEvent>(event: E, ...args: EventDescription[E]): boolean; }