import { RefObject } from 'react'; /** A pinned header may take at most this share of the layout viewport height (ASMA-8737). */ export declare const PINNED_HEADER_MAX_VIEWPORT_SHARE = 0.25; export interface DialogHeaderPinning { /** Attach to the header: its measured height is `H`. */ headerRef: (element: HTMLElement | null) => void; /** Pinned (`position: sticky`) rather than scrolling with the body. */ pinned: boolean; /** Pinned but stepped aside for the on-screen keyboard (PIN-7): `inert`, `aria-hidden`, not rendered. */ hidden: boolean; /** Measured header height reserved as `scroll-padding-top` on the scroller (PIN-8); 0 when not pinned. */ scrollPaddingTop: number; /** Measured sticky-footer height reserved as `scroll-padding-bottom` on the scroller (PIN-8); 0 when absent. */ scrollPaddingBottom: number; } /** * The shared pinning decision for dialog headers (ASMA-8737, pinned bars PIN-1/2/7/8): pinned only * when the screen is taller than `30em` **and** the measured header is at most 25% of * `window.innerHeight`; otherwise it scrolls with the body. * * `H` is measured on the header itself, and pinning changes only its `position`, so the decision * cannot feed back into `H`. The visual viewport never enters the decision: the on-screen keyboard * only hides a pinned header, it never unpins one. A hidden header keeps its last measured height, so * it stays pinned and reserves the same padding the moment the keyboard goes. * * PIN-7's exception is part of the decision: a header that contains the focused field is the bar the * user is typing in, so it stays visible (and in the accessibility tree) while the keyboard is open. * A hidden header also leaves the tab order (`inert`). * * Hiding or showing the header moves the content by `H`; the focused element is brought back into * view afterwards, inside the scroll padding. */ export declare const useDialogHeaderPinning: (scrollerRef: RefObject) => DialogHeaderPinning;