import { BroadcastChannelOptions } from "broadcast-channel"; import { QueryClient, QueryKey } from "@tanstack/query-core"; //#region src/index.d.ts /** * Metadata describing a broadcast that failed to be delivered to other tabs. * Passed to {@link BroadcastQueryClientOptions.onBroadcastError} so callers * can correlate failures with the originating query. */ interface BroadcastErrorEvent { type: 'updated' | 'removed' | 'added'; queryHash: string; queryKey: QueryKey; } interface BroadcastQueryClientOptions { /** The QueryClient to sync. */ queryClient: QueryClient; /** * Unique channel name used to communicate between tabs and windows. * @default 'tanstack-query' */ broadcastChannel?: string; /** Options forwarded to the underlying `BroadcastChannel`. */ options?: BroadcastChannelOptions; /** * Called when a query event fails to broadcast to other tabs — most * commonly because the query's `state.data`, `state.error`, or `queryKey` * contains a value the structured-clone algorithm cannot serialize * (e.g. `ReadableStream`, `File`, functions, Vue `reactive` proxies). * * Provide this to route failures to an error tracker. If omitted, a * `console.warn` is emitted in development so failures are never silent. * * May return a `Promise`; any rejection is caught internally so it cannot * cause a secondary unhandled rejection. */ onBroadcastError?: (error: unknown, event: BroadcastErrorEvent) => void | Promise; } declare function broadcastQueryClient({ queryClient, broadcastChannel, options, onBroadcastError }: BroadcastQueryClientOptions): () => void; //#endregion export { BroadcastErrorEvent, broadcastQueryClient }; //# sourceMappingURL=index.d.cts.map