export declare abstract class BedrockEventDefinition { abstract name: string; /** * Method to implement event logic. * @param options - Event options (undefined if not used) * @param onEvent - Callback called when the event is triggered. * @param onError - Callback called on error (error type: unknown) */ abstract listener(options: O, onEvent: (response: R) => void, onError: (error: unknown) => void): void; /** * Additional logic to execute when removing the event listener. * If needed in the plugin, override this method and it will be called * when the listener is removed. */ abstract remove(): void; } /** * BedrockEvent class registers event definition instances passed to the constructor. * The addEventListener method only allows registered event names, and the types of passed * options/callbacks are automatically inferred. * * Each subscription is uniquely identified by (event name + options). */ export declare class BedrockEvent> { private definitions; private subscriptionGroups; constructor(defs: Defs[]); addEventListener(eventName: E, listener: Extract extends BedrockEventDefinition ? [O] extends [undefined] ? { onEvent: (response: R) => void; onError?: (error: unknown) => void; } : { options: O; onEvent: (response: R) => void; onError?: (error: unknown) => void; } : never): () => void; emit(eventName: E, data: Extract extends BedrockEventDefinition ? R : never): void; private _getKey; }