import { type ReactNode } from 'react';
import { TabSync } from '../../TabSync';
/**
* Provider for TabSync — creates instance, auto-disposes on unmount.
*
* @example
* function App() {
* return (
*
*
*
* );
* }
*/
export interface TabSyncProviderProps {
/** BroadcastChannel name (default: "tab-sync"). */
channel?: string;
/** Enable debug logging. */
debug?: boolean;
children: ReactNode;
}
export declare function TabSyncProvider({ channel, debug, children }: TabSyncProviderProps): import("react").FunctionComponentElement>;
/**
* Access the TabSync instance from context.
*
* @example
* const sync = useTabSyncContext();
* sync.set('theme', 'dark');
*/
export declare function useTabSyncContext(): TabSync;
/**
* Two-way state sync across browser tabs — like useState but shared.
* - Without callback: returns [value, setter] synced across tabs.
* - With callback: also calls your handler on every change (side effects).
*
* @example
* // Shared state — updates propagate to all tabs
* const [theme, setTheme] = useTabSync('theme', 'light');
*
*
* @example
* // With side effect callback
* const [cart, setCart] = useTabSync('cart', { items: [] }, (cart) => {
* document.title = `Cart (${cart.items.length})`;
* });
*
* @example
* // Form state synced across tabs
* const [draft, setDraft] = useTabSync('email-draft', '');
*