/** * createSplitter - the HEADLESS core behind : a two-pane resizable * split with a draggable separator (WAI-ARIA `separator`), keyboard resize and * clamping, exposed as **prop-getters** you spread onto YOUR OWN markup. The core * never touches the DOM - the renderer measures the container rect and passes the * pointer position + rect IN via `setFromPointer` (same split as createSlider). * Parity: Smart `smart-splitter`. * * ```svelte * *
*
A
*
*
B
*
* ``` */ export type SplitterOrientation = 'horizontal' | 'vertical'; export type SplitterPoint = { x: number; y: number; }; /** Reactive inputs are passed as getters so the core tracks live prop changes. */ export type SplitterConfig = { /** Size of the FIRST pane as a fraction of the container (0..1). */ fraction: () => number; onChange?: (fraction: number) => void; /** Split direction: `horizontal` = a vertical gutter between left/right panes. */ orientation?: () => SplitterOrientation; /** Min / max fraction for the first pane (0..1). */ min?: () => number; max?: () => number; /** Keyboard step as a fraction (default 0.02 = 2%). */ step?: () => number; disabled?: () => boolean; dir?: () => 'ltr' | 'rtl' | 'auto' | undefined; ariaLabel?: () => string | undefined; }; export declare function createSplitter(config: SplitterConfig): { /** Clamped fraction (0..1) of the first pane. */ readonly fraction: number; /** Clamped size of the first pane as a percentage (0..100). */ readonly percent: number; /** Whether the separator is being dragged. */ readonly dragging: boolean; pointerDown: () => void; setFromPointer: (pos: SplitterPoint, rect: DOMRect) => void; endDrag: () => void; nudge: (delta: number) => void; /** Spread onto the draggable separator element. */ separatorProps: () => { role: "separator"; tabindex: number; 'aria-orientation': "horizontal" | "vertical"; 'aria-valuemin': number; 'aria-valuemax': number; 'aria-valuenow': number; 'aria-label': string; 'aria-disabled': true | undefined; onkeydown: (e: KeyboardEvent) => void; }; }; export type Splitter = ReturnType;