import { NotificationPayloads } from "./Notifications";
import { ApplicationStateValue } from "./ApplicationState";
export declare type NotificationCallback<D> = (data: D, sender: string) => void;
export interface NotificationCenterSubscriptionOptions {
    id?: string;
}
export declare type NotificationCenterSubscriptionCallbacks<EventPayloads = NotificationPayloads<ApplicationStateValue>> = {
    [key in keyof EventPayloads]?: (data: EventPayloads[key], sender: string) => Promise<void> | void;
};
export declare type AllNotificationsData<EventPayloads> = {
    [key in keyof EventPayloads]: {
        event: key;
        data: EventPayloads[key];
        sender: string;
    };
}[keyof EventPayloads];
export interface NotificationCenterSubscription<EventPayloads = any> extends NotificationCenterSubscriptionOptions {
    id: string;
    destroy(): void;
    send<K extends keyof EventPayloads>(event: K, data: EventPayloads[K]): void;
}
export interface NotificationCenter<EventPayloads extends NotificationPayloads<any> = NotificationPayloads<ApplicationStateValue>> {
    on<E extends keyof EventPayloads>(event: E, callback: NotificationCallback<EventPayloads[E]>, options?: NotificationCenterSubscriptionOptions): NotificationCenterSubscription<EventPayloads>;
    subscribe(on: NotificationCenterSubscriptionCallbacks<EventPayloads>, options?: NotificationCenterSubscriptionOptions): NotificationCenterSubscription<EventPayloads>;
    unsubscribe(subscriber: string, notification?: keyof EventPayloads): void;
    any(callback: (data: AllNotificationsData<EventPayloads>) => void, options?: NotificationCenterSubscriptionOptions): NotificationCenterSubscription<EventPayloads>;
    send<E extends keyof EventPayloads>(sender: string, notification: E, data: EventPayloads[E] | (() => EventPayloads[E])): void;
    /**
     * Removes all subscriptions
     *
     */
    destroy(): void;
}
