import { QueryKey, QueryClient } from '@tanstack/react-query';

interface QueryBroadcastChannel {
    postMessage(message: unknown): void;
    close?(): void;
    onmessage: ((event: MessageEvent<unknown>) => void) | null;
}
interface QueryBroadcaster {
    publishKeys(keys: QueryKey[]): void;
    start(): () => void;
}
interface CreateQueryBroadcasterOptions {
    channel?: string;
    buster?: string;
    createChannel?: (channelName: string) => QueryBroadcastChannel | null;
}
declare function createQueryBroadcaster(queryClient: QueryClient, options?: CreateQueryBroadcasterOptions): QueryBroadcaster;

export { type CreateQueryBroadcasterOptions, type QueryBroadcastChannel, type QueryBroadcaster, createQueryBroadcaster };
