import { KeyboardEvent, PointerEvent } from "react"; //#region src/inspector/use-pane-width.d.ts /** * Width the drag produces for a pane docked to the inline-end edge. * * That edge is the right in LTR (width = distance from the right) and the * left in RTL (width = distance from the left). Without the RTL branch the * delta is inverted and the drag oscillates. * * A pointer can be dragged well past either bound — off the window edge, or * across the whole viewport — so the raw distance is clamped here, before * anything keeps it. Persisting the raw distance is what made a pane dragged * narrower than the minimum from being persisted as an invalid preference. */ export declare const resolveDragWidth: ({ clientX, isRtl, viewportWidth }: { clientX: number; isRtl: boolean; viewportWidth: number; }) => number; /** Pixels one arrow press moves the edge; Page/Home/End move further. */ export declare const INSPECTOR_PANE_KEYBOARD_STEP = 16; export declare const INSPECTOR_PANE_KEYBOARD_PAGE_STEP = 64; /** * Width a keyboard resize produces. Returns `null` for keys the handle does * not own, so the caller can leave the event alone rather than swallowing * every keystroke that reaches a focusable separator. * * Arrow semantics follow the *edge*, not the width: on an inline-end pane * the inline-start arrow grows it. Under RTL the physical arrows swap, so * the same key keeps meaning "make it bigger" on both sides. */ export declare const resolveKeyboardWidth: ({ currentWidth, isRtl, key }: { currentWidth: number; isRtl: boolean; key: string; }) => number | null; export type InspectorPaneWidthPersistence = { read: () => number; write: (width: number) => void; }; type UseInspectorPaneWidthOptions = { /** Inline size the sidebar takes out of the same layout row. */ sidebarWidth: number; /** Persistence is injected so this package stays independent of its host. */ persistence?: InspectorPaneWidthPersistence | undefined; /** Viewport width in CSS pixels; 0 before the viewport is known. */ viewportWidth: number; }; type UseInspectorPaneWidthResult = { /** * Pointer + keyboard handlers and ARIA state to spread onto the drag * handle. The handle is a focusable `separator`, so it is operable * without a pointer. */ resizeHandleProps: { "aria-orientation": "vertical"; "aria-valuemax": number; "aria-valuemin": number; "aria-valuenow": number; onKeyDown: (event: KeyboardEvent) => void; onLostPointerCapture: (event: PointerEvent) => void; onPointerCancel: (event: PointerEvent) => void; onPointerDown: (event: PointerEvent) => void; onPointerMove: (event: PointerEvent) => void; onPointerUp: (event: PointerEvent) => void; tabIndex: number; }; /** Reset the pane to its default width (double-click affordance). */ resetWidth: () => void; /** * Width the pane renders at: the dragged width clamped against the room * left beside the sidebar. */ width: number; }; /** * Owns the docked pane's width: the width the user dragged to, its * persistence, and the clamp against the room actually available. * * What renders is always the clamped value, so shrinking the window or * expanding the sidebar takes space back from the pane instead of crushing * the content column. The *desired* width keeps the user's choice, so the * pane returns to it once the room comes back. */ export declare const useInspectorPaneWidth: ({ sidebarWidth, persistence, viewportWidth }: UseInspectorPaneWidthOptions) => UseInspectorPaneWidthResult; //#endregion