@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
24 lines • 1.08 kB
text/typescript
/**
* Register a source that may cause a layout shift once it settles. Call the
* returned function when the source has reached its stable post-hydration
* layout. Idempotent — calling it more than once is a no-op.
*/
export declare function registerLayoutShiftSource(): () => void;
/**
* Whether the page's initial layout-shifting swaps have settled. `true` before
* any source registers (nothing to wait for) and once every registered source
* has settled.
*/
export declare function layoutShiftsSettled(): boolean;
/**
* Resolves once {@link layoutShiftsSettled} is `true`. Returns `null`
* synchronously when already settled so callers can take a fast path (mirrors
* `useHighlightGate`). Rejects with an `AbortError` if `signal` aborts first,
* so a superseding coordination announce can abandon the wait.
*/
export declare function whenLayoutShiftsSettled(signal?: AbortSignal): Promise<void> | null;
/**
* Reset all gate state. Test-only — there is no production reason to reopen a
* settled gate.
*/
export declare function resetLayoutShiftGate(): void;