@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
17 lines • 974 B
text/typescript
/**
* Returns a function that, given an `AbortSignal`, resolves once the
* highlighter is ready — or returns `null` synchronously when the
* gate is already open so callers can take a fast path. The returned
* promise rejects with `AbortError` when the signal aborts so a
* superseding announce can supersede the wait (the engine silently
* swallows aborted preload rejections via `coordinatePreference`).
*
* The gate is kept in sync with `deferHighlight` from a
* `React.useEffect`, not during render — refs are mutated only in
* effects so the linter's `react-hooks/refs` rule stays satisfied.
* The lag between commit and effect is a single microtask, and the
* effect runs before any user-initiated click can reach the
* coordinator, so an originator click that lands in the same
* microtask as the flip still sees the resolved gate.
*/
export declare function useHighlightGate(deferHighlight: boolean): (signal: AbortSignal) => Promise<void> | null;