import { type LayoutChangeEvent, type ViewStyle } from "react-native"; import { type Responsive } from "./responsive.js"; /** * Container probe for HUGGING components. A component whose root hugs its * content cannot learn its container's width by measuring itself (the Tabs * vertical rail post-mortem: the rail measured its own ~180px and `narrow` * latched true in any container). Render a sibling View with this style * beside the root and attach the measurement hook's `onLayout` to it: * absolutely positioned against the parent (RN Views are position:relative * by default), it spans the container's width in either flex direction, * takes no space in the flex flow (no gap slot), and intercepts nothing. */ export declare const containerProbe: ViewStyle; export interface MeasuredWidth { /** The element's rounded layout width in px; 0 until the first layout. */ width: number; /** True once a real layout has been observed (width > 0). */ measured: boolean; /** Attach to the element to measure. Stable identity; re-renders only when * the ROUNDED width changes, so subpixel relayout churn is free. */ onLayout: (event: LayoutChangeEvent) => void; } /** Measure the width of whatever element the returned `onLayout` is attached to. */ export declare function useMeasuredWidth(): MeasuredWidth; /** Like useMeasuredWidth, but `width` falls back to the WINDOW width until the * first layout: the best available guess for the unmeasured first frame. For * components whose threshold is a raw px value rather than a breakpoint * (Form's two-column stack). Subscribes at bucket granularity so the fallback * stays fresh across breakpoint-sized resizes without per-pixel re-renders. * * The fallback is withheld until after hydration (see `useHydrated`), so a * server-rendered app hydrates against the same markup it shipped. */ export declare function useContainerWidth(): MeasuredWidth; export interface ContainerBreakpointOptions { /** Resolve against the WINDOW width until the element has measured, instead * of rendering `base`. For above-the-fold grids whose desktop arrangement * would visibly flash on a phone's first frame. */ seedViewport?: boolean; } export interface ContainerBreakpoint extends MeasuredWidth { /** The map value for the element's own width (base until measured, or the * window-seeded value with `seedViewport`). */ value: T; } /** Container query: resolve a Responsive map against the element's OWN width. */ export declare function useContainerBreakpoint(map: Responsive, options?: ContainerBreakpointOptions): ContainerBreakpoint; //# sourceMappingURL=container.d.ts.map