/** Axis-aligned selection rectangle (container-local coordinates). */ export interface MarqueeRect { x: number; y: number; width: number; height: number; } /** Hit-test target with an id and box in the same coordinate space as {@link MarqueeRect}. */ export interface MarqueeItemRect { id: string; x: number; y: number; width: number; height: number; } export type MarqueeModifier = 'replace' | 'add' | 'toggle'; export interface MarqueeDragState { rect: MarqueeRect; ids: string[]; modifier: MarqueeModifier; } export interface AttachMarqueeSelectOptions { /** Pixels of movement before a drag becomes a marquee (keeps clicks clean). Default 4. */ threshold?: number; /** Supply item boxes; called on each move after threshold. */ getItems: () => MarqueeItemRect[]; /** Live updates while dragging (after threshold). */ onDrag?: (state: MarqueeDragState) => void; /** Fired on pointerup if a marquee drag occurred. */ onSelect: (state: MarqueeDragState) => void; /** Skip starting a marquee from this event target. */ shouldIgnore?: (target: EventTarget | null) => boolean; /** Called when the overlay rect changes (including null when idle / below threshold). */ onRect?: (rect: MarqueeRect | null) => void; } export declare function normalizeRect(x0: number, y0: number, x1: number, y1: number): MarqueeRect; export declare function rectsIntersect(a: MarqueeRect, b: MarqueeRect): boolean; export declare function hitTestIds(marquee: MarqueeRect, items: MarqueeItemRect[]): string[]; /** Collapse duplicate ids (e.g. widget host + synthetic children) into one union box. */ export declare function mergeMarqueeItemsById(items: MarqueeItemRect[]): MarqueeItemRect[]; export declare function getMarqueeModifier(e: Pick): MarqueeModifier; export declare function resolveMarqueeSelection(hitIds: string[], previousIds: string[], modifier: MarqueeModifier): string[]; /** Collect `[data-marquee-id]` children in container-local (incl. scroll) coordinates. */ export declare function collectMarqueeItems(container: HTMLElement, selector?: string): MarqueeItemRect[]; export declare function defaultMarqueeIgnore(target: EventTarget | null): boolean; /** * Attach Windows-style rubber-band selection to a container. * Returns a disposer. */ export declare function attachMarqueeSelect(container: HTMLElement, options: AttachMarqueeSelectOptions): () => void;