import { UrlConfigItem } from '../utils/routeUtils';
type QueryString = string;
/**
 * Configuration contract for `useUrlState`.
 *
 * Use this hook when your application uses **store/redux as source of truth**
 * and you want a centralized URL synchronizer:
 * - URL -> store: parse incoming search params and dispatch updates
 * - store -> URL: serialize current store values and navigate with push/replace
 *
 * Recommended setup:
 * - Mount one top-level synchronizer component near the router
 * - Pass only URL-managed store values via `storeValues`
 * - Keep URL writing centralized through this hook
 *
 * Not intended for "URL-only state" screens where you directly read/write
 * params via router APIs (for example `useSearchParams`) without store sync.
 */
type UseUrlStateProps<TState> = {
    /**
     * URL sync configuration.
     * Each entry maps one query param key to a store selector and update action.
     */
    config: readonly UrlConfigItem<TState, any>[];
    /**
     * Current URL search string (for example `location.search`).
     * Expected shape: `'?q=test&sort=-name'` or `''`.
     */
    searchString: QueryString;
    /**
     * Current store values used by the configured selectors. This could be values from a redux store.
     * Keys should match the `config` keys, values are compared against URL/defaults.
     */
    storeValues: Record<string, unknown>;
    /**
     * Optional localStorage key for sticky URL state restore on initial load
     * when managed URL params are missing.
     */
    localStorageKey?: string;
    /**
     * Router navigation type (typically from React Router `useNavigationType`).
     * `POP` indicates browser back/forward navigation.
     */
    navigationType?: 'POP' | 'PUSH' | 'REPLACE' | string;
    /**
     * Store update callback invoked when URL -> store sync detects a change.
     * Usually wraps `dispatch(...)`.
     */
    onUpdateStore: (action: any) => void;
    /**
     * Navigation callback used for store -> URL sync writes.
     * `historyMode` controls whether to `push` or `replace` the history entry.
     */
    onNavigate: (search: string, historyMode: 'push' | 'replace') => void;
};
/**
 * ----------------------------------------------------------------------------
 * MAIN EXPORT
 * ----------------------------------------------------------------------------
 */
declare const useUrlState: <TState>(props: UseUrlStateProps<TState>) => void;
export default useUrlState;
