import type { PropsWithChildren } from 'react'; /** Slot identifier: a plain string, so the module is layout-agnostic. */ export type SlotId = string; export type SlotCoverage = { /** Whether each slot, by ID, is currently obscured (collapsed, or covered by another slot). */ obscured: Record; }; /** What to do with a pending reveal intent, given the current coverage. */ export type RevealAction = /** The target is not measured yet (e.g. its view just became active): wait for an update. */ 'wait' /** The target is obscured: reveal it by releasing whatever covers it. */ | 'act' /** There is no intent, or the target is already visible: clear the intent. */ | 'clear'; /** * Decides what to do about a pending reveal intent: wait until the target is measured, then act * only if it is obscured, otherwise clear. Pure, so it can run in an effect keyed on `coverage`. * * @param revealSlot - Slot pending reveal, if any. * @param coverage - Current coverage snapshot. * @returns Whether to wait, reveal the slot or clear the intent. */ export declare const resolveRevealAction: (revealSlot: SlotId | undefined, coverage: SlotCoverage) => RevealAction; export type SlotGeometryContextValue = { /** Clears the pending reveal intent. */ clearReveal: () => void; coverage: SlotCoverage; /** Live check that measures the DOM at call time, for event handlers where `coverage` may lag. */ isObscured: (slot: SlotId) => boolean; register: (slot: SlotId, element: HTMLElement | null) => void; /** * Records a one-shot intent to reveal `slot` after navigation. Pair it with * `resolveRevealAction(revealSlot, coverage)` in an effect to release whatever covers the slot * once it has been measured. */ requestReveal: (slot: SlotId) => void; /** Slot pending reveal, or `undefined`. Resolve it with `resolveRevealAction`. */ revealSlot: SlotId | undefined; }; /** * @internal Exported for unit tests. A target is obscured when its box is under `MIN_VISIBLE_AREA` * or another element covers at least `COVER_THRESHOLD` of it. */ export declare const measureObscured: (target: HTMLElement, others: HTMLElement[]) => boolean; export declare const SlotGeometryProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element; export declare const useSlotGeometry: () => SlotGeometryContextValue; /** Returns a stable callback ref that registers and unregisters the element backing `slot`. */ export declare const useRegisterSlotGeometry: (slot: SlotId) => (element: HTMLElement | null) => void; //# sourceMappingURL=SlotGeometry.d.ts.map