import { EventSubscriber, IInternalEventBus, InternalEventBusEventCallback } from '../../../../../../types/src/table';

export default class InternalEventBus implements IInternalEventBus {
    events: Record<string, EventSubscriber[]>;
    subscriptionNotifiers: Record<string, InternalEventBusEventCallback[]>;
    dispatch: (key: string, ...args: any[]) => void;
    chain: (key: string, args: any[] | any, initialValue: any, fallback?: any) => any;
    confirm: (key: string, args: any[] | any) => boolean;
    debug: boolean | string[] | undefined;
    constructor(debug?: boolean | string[]);
    subscriptionChange(key: string, callback: InternalEventBusEventCallback): void;
    subscribe(key: string, callback: (...args: any[]) => any, priority?: number): void;
    unsubscribe(key: string, callback?: (...args: any[]) => any): void;
    subscribed(key: string): boolean;
    _chain(key: string, args: any[] | any, initialValue: any, fallback?: any): any;
    _confirm(key: string, args: any[] | any): boolean;
    _notifySubscriptionChange(key: string, subscribed: boolean): void;
    _dispatch(key: string, ...args: any[]): void;
    _debugDispatch(key: string, ...args: any[]): any;
    _debugChain(key: string, args: any[] | any, initialValue: any, fallback?: any): any;
    _debugConfirm(key: string, args: any[] | any): boolean;
}
