import { EventEmitter } from 'node:events';
import { Brand } from '@signalk/server-api';
interface EventsSpark {
    request: unknown;
    onDisconnects: Array<() => void>;
    write: (data: unknown) => void;
}
export declare function startEvents(app: any, spark: EventsSpark, onEvent: (data: any) => void, eventsFromQuery?: string): void;
export declare function startServerEvents(app: any, spark: EventsSpark, onServerEvent: any): void;
export type EventName = Brand<string, 'eventname'>;
export type EmitterId = Brand<string, 'emitterId'>;
export type ListenerId = Brand<string, 'listenerid'>;
export type EventsActorId = EmitterId & ListenerId;
export interface WrappedEmitter {
    getEmittedCount: () => number;
    getEventRoutingData: () => {
        events: {
            event: string;
            emitters: any;
            listeners: any;
        }[];
    };
    emit: (this: any, eventName: string, ...args: any[]) => boolean;
    addListener: (eventName: EventName, listener: (...args: any[]) => void) => EventEmitter;
    bindMethodsById: (eventsId: EventsActorId) => {
        emit: (this: any, eventName: string, ...args: any[]) => boolean;
        addListener: (eventName: EventName, listener: (...args: any[]) => void) => void;
        on: (eventName: EventName, listener: (...args: any[]) => void) => void;
    };
    removeAllListenersById: (actorId: EventsActorId) => void;
}
export interface WithWrappedEmitter {
    wrappedEmitter: WrappedEmitter;
}
export declare function wrapEmitter(targetEmitter: EventEmitter): WrappedEmitter;
export {};
//# sourceMappingURL=events.d.ts.map