/** * Options for the useBroadcastChannel hook */ type UseBroadcastChannelOptions = { /** * Callback function called when a message is received */ onMessage?: (data: T) => void; /** * Callback function called when an error occurs */ onError?: (error: Event) => void; }; /** * Return type for the useBroadcastChannel hook */ type UseBroadcastChannelReturn = { /** * Function to send a message to the broadcast channel */ postMessage: (data: T) => void; /** * Function to manually close the broadcast channel */ close: () => void; /** * Whether the BroadcastChannel API is supported */ isSupported: boolean; }; /** * useBroadcastChannel * * @description A React hook that provides a clean interface to the Broadcast Channel API for cross-tab/window communication * @param channelName - The name of the broadcast channel * @param options - Configuration options for message and error handling * @returns Object with postMessage function, close function, and isSupported flag * @see {@link https://rooks.vercel.app/docs/hooks/useBroadcastChannel} */ declare function useBroadcastChannel(channelName: string, options?: UseBroadcastChannelOptions): UseBroadcastChannelReturn; export { useBroadcastChannel };