export type CommandEvent = { command: any; }; export type DisconnectEvent = void; export type ConnectedEvent = void; export type ErrorEvent = { error: string; }; export type ResultEvent = { type: string; value: any; }; export type CommandCompleteEvent = { success: boolean; error?: string; }; export type AccessibilityTreeEvent = { tree: any; }; export declare const EVENTS: { readonly COMMAND: "command"; readonly DISCONNECT: "disconnect"; readonly CONNECTED: "connected"; readonly ERROR: "error"; readonly RESULT: "result"; readonly COMMAND_COMPLETE: "commandComplete"; readonly ACCESSIBILITY_TREE: "accessibilityTree"; }; type EventListener = (...args: any[]) => void; export declare class CustomEventEmitter { private listeners; constructor(); private getListeners; emitCommand(command: any): boolean; emitDisconnect(): boolean; emitConnected(): boolean; emitError(error: string): boolean; emitResult(result: { type: string; value: any; }): boolean; emitCommandComplete(result: { success: boolean; error?: string; }): boolean; emitAccessibilityTree(tree: any): boolean; onCommand(listener: (command: any) => void): this; onDisconnect(listener: () => void): this; onConnected(listener: () => void): this; onError(listener: (error: string) => void): this; onResult(listener: (result: { type: string; value: any; }) => void): this; onCommandComplete(listener: (result: { success: boolean; error?: string; }) => void): this; onAccessibilityTree(listener: (tree: any) => void): this; on(event: string, listener: EventListener): this; emit(event: string, ...args: any[]): boolean; removeListener(event: string, listener: EventListener): this; removeAllListeners(event?: string): this; } export default CustomEventEmitter;