@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
16 lines • 1.01 kB
text/typescript
import type * as React from 'react';
import { type UseCoordinatedExtras, type UseCoordinatedOptions } from "./useCoordinated.mjs";
/**
* `useLocalStorageState` + coordination in one call. Cross-tab sync
* happens via the underlying storage events; the coordinator handles
* within-tab peers (sibling demos on the same page) so their visible
* value flips land in a single layout pass.
*
* @param storageKey - localStorage key, or `null` to disable storage
* (falls back to regular `useState` semantics).
* @param initializer - Initial value, identical to
* `useLocalStorageState`.
* @param options - Coordination options. Pass `channelKey: null` to
* skip the coordinator entirely.
*/
export declare function useCoordinatedLocalStorage<TPreload = void>(storageKey: string | null, initializer: string | null | (() => string | null), options: UseCoordinatedOptions<string | null, TPreload>): [string | null, React.Dispatch<React.SetStateAction<string | null>>, UseCoordinatedExtras<string | null>];