import type { FluxFilterDefinition, FluxFilterState, FluxFilterValue, FluxIconName, FluxSize } from '@flux-ui/types'; import type { DateTime } from 'luxon'; import type { ComponentInternalInstance, ComputedRef, InjectionKey, Ref, VNode } from 'vue'; export const FluxAdaptiveGroupInjectionKey: InjectionKey = Symbol(); export const FluxBreadcrumbCollapsedInjectionKey: InjectionKey> = Symbol(); export const FluxBreadcrumbSeparatorInjectionKey: InjectionKey> = Symbol(); export const FluxCalendarInjectionKey: InjectionKey = Symbol(); export const FluxDisabledInjectionKey: InjectionKey> = Symbol(); export const FluxKanbanInjectionKey: InjectionKey = Symbol(); export const FluxExpandableGroupInjectionKey: InjectionKey = Symbol(); export const FluxFlyoutInjectionKey: InjectionKey = Symbol(); export const FluxFilterInjectionKey: InjectionKey = Symbol(); export const FluxFormCheckboxGroupInjectionKey: InjectionKey = Symbol(); export const FluxFormFieldInjectionKey: InjectionKey = Symbol(); export const FluxFormRadioGroupInjectionKey: InjectionKey = Symbol(); export const FluxItemControlInjectionKey: InjectionKey = Symbol(); export const FluxMenuFlyoutInjectionKey: InjectionKey = Symbol(); export const FluxMenuPersistentInjectionKey: InjectionKey>> = Symbol(); export const FluxSegmentedControlInjectionKey: InjectionKey = Symbol(); export const FluxTabBarInjectionKey: InjectionKey = Symbol(); export const FluxTableInjectionKey: InjectionKey = Symbol(); export const FluxTimelineInjectionKey: InjectionKey = Symbol(); export const FluxTooltipInjectionKey: InjectionKey = Symbol(); export type FluxKanbanDragMode = 'pointer' | 'keyboard'; export type FluxKanbanDragState = { readonly mode: FluxKanbanDragMode; readonly itemId: string | number; readonly fromColumnId: string | number; readonly dropColumnId: string | number | null; readonly beforeItemId: string | number | null; readonly originBeforeItemId?: string | number | null; }; export type FluxKanbanColumnDragState = { readonly columnId: string | number; readonly dropBeforeColumnId: string | number | null; }; export type FluxKanbanKeyboardDirection = 'up' | 'down' | 'left' | 'right'; export type FluxKanbanInjection = { readonly disabled: Ref; readonly reorderableColumns: Ref; readonly dragState: Ref; readonly columnDragState: Ref; readonly grabbedId: Ref; readonly isOverColumnId: Ref; readonly isDropAllowed: Ref; registerItem(element: Element, itemId: string | number): void; unregisterItem(element: Element): void; getItemInfo(element: Element): { readonly itemId: string | number } | undefined; registerColumn(element: Element, columnId: string | number): void; unregisterColumn(element: Element): void; getColumnInfo(element: Element): { readonly columnId: string | number } | undefined; setBoardElement(element: Element | null): void; setColumnBodyElement(columnId: string | number, element: Element | null): void; enterColumn(columnId: string | number): void; leaveColumn(columnId: string | number): void; startDrag(itemId: string | number, fromColumnId: string | number): void; endDrag(): void; updateDropTarget(columnId: string | number, beforeItemId: string | number | null): void; clearDropTarget(): void; commitDrop(): void; grabItem(itemId: string | number, fromColumnId: string | number): void; moveKeyboard(direction: FluxKanbanKeyboardDirection): void; commitKeyboardDrop(): void; cancelKeyboardDrop(): void; isItemGrabbed(itemId: string | number): boolean; startColumnDrag(columnId: string | number): void; endColumnDrag(): void; updateColumnDropTarget(beforeColumnId: string | number | null): void; commitColumnDrop(): void; cancelAll(): void; onPointerMove(clientX: number, clientY: number): void; }; export type FluxAdaptiveGroupChild = { readonly priority: Ref; readonly desiredDefaultWidth: Ref; readonly desiredFallbackWidth: Ref; readonly isDefaultVisible: Ref; }; export type FluxAdaptiveGroupInjection = { register(uid: number, child: FluxAdaptiveGroupChild): void; unregister(uid: number): void; }; export type FluxCalendarView = 'month' | 'week' | 'two-days' | 'day'; export type FluxCalendarKeyboardDirection = 'up' | 'down' | 'left' | 'right'; export type FluxCalendarItemData = { readonly id: string | number; readonly date: DateTime; readonly duration?: number; readonly allDay: boolean; readonly isClickable: boolean; renderContent(): VNode[]; handleClick(evt: MouseEvent): void; }; export type FluxCalendarInjection = { readonly isDraggable: ComputedRef; readonly resolvedView: ComputedRef; readonly hourRange: ComputedRef; readonly pixelsPerMinute: ComputedRef; readonly snapMinutes: ComputedRef; readonly grabbedId: Ref; registerItem(id: string | number, data: FluxCalendarItemData): void; unregisterItem(id: string | number): void; registerItemElement(element: Element, id: string | number): void; unregisterItemElement(element: Element): void; onItemDragStart(id: string | number, fromDate: DateTime, evt: DragEvent): void; onItemDragEnd(id: string | number): void; onItemKeyboardGrab(id: string | number, fromDate: DateTime): void; onItemKeyboardMove(direction: FluxCalendarKeyboardDirection): void; onItemKeyboardCommit(): void; onItemKeyboardCancel(): void; }; export type FluxExpandableGroupInjection = { closeAll(): void; register(uid: number, expandable: ComponentInternalInstance): void; unregister(uid: number): void; }; export type FluxFilterInjection = { readonly state: Ref; back(): void; clear(name: string | number): void; getDefinition(name: string | number): FluxFilterDefinition | undefined; getValue(name: string | number): FluxFilterValue | undefined; hasValue(name: string | number): boolean; reset(name: string | number): void; setValue(name: string | number, value?: FluxFilterValue): void; }; export type FluxFlyoutInjection = { readonly isClosing: Ref; readonly isOpen: Ref; readonly isOpening: Ref; close(): void; }; export type FluxItemControlInjection = { readonly isControl: Readonly>; register(id: string): void; }; export type FluxMenuFlyoutPointer = { readonly x: number; readonly y: number; // Trailing "anchor" point: the pointer position from roughly TRAIL_LAG ago. Used as the apex // of the prediction cone so the safe triangle stays stable even when the pointer moves slowly. readonly tx: number; readonly ty: number; // Smoothed pointer velocity in px/ms (EMA), with its precomputed magnitude. readonly vx: number; readonly vy: number; readonly speed: number; }; export type FluxMenuFlyoutCone = { readonly id: number; // Polygon corners. The forward cone is a triangle (a, b, c); the return cone is a trapezium // corridor that also uses the optional fourth corner (d). readonly ax: number; readonly ay: number; readonly bx: number; readonly by: number; readonly cx: number; readonly cy: number; // Fourth corner, only present for the return corridor (absent → forward triangle). readonly dx?: number; readonly dy?: number; // Pointer "head" position, used to draw the velocity vector in the debug overlay. readonly hx: number; readonly hy: number; // True for the return cone (aiming back from the submenu towards its opener) rather than the // forward cone (aiming from the opener into the submenu). readonly back: boolean; }; export type FluxMenuFlyoutEntry = { readonly id: number; getTrigger(): HTMLElement | null; getPopup(): HTMLElement | null; readonly isOpen: Ref; // Whether the pointer was inside this submenu's popup (or an open descendant) within the return // window — i.e. the pointer is genuinely travelling back from this submenu, not merely sweeping // past its opener. Gates the return cone so a vertical sweep through the column never sticks. wasRecentlyInside(): boolean; close(): void; }; export type FluxMenuFlyoutInjection = { readonly debugCone: Ref; readonly pointer: Readonly>; readonly pointerType: Readonly>; readonly activeCone: Ref; readonly keyboardStack: Ref; register(entry: FluxMenuFlyoutEntry): void; unregister(entry: FluxMenuFlyoutEntry): void; closeOthers(self: FluxMenuFlyoutEntry): void; hasOpenDescendant(self: FluxMenuFlyoutEntry): boolean; isAimingAtOpenSubmenu(askTrigger: HTMLElement | null): boolean; isInsidePopups(target: Node | null): boolean; // Returns the trigger element of the flyout that currently owns the active cone, so a menu can tell // whether that cone belongs to one of its own items (and should dim only that menu's siblings). getActiveConeTrigger(): HTMLElement | null; closeAll(): void; }; export type FluxFormFieldInjection = { readonly id?: string; readonly labelId?: string; readonly errorId?: Readonly>; readonly hintId?: Readonly>; readonly isGroup?: boolean; registerControl?(): string; }; export type FluxFormCheckboxGroupValue = string | number | boolean; export type FluxFormCheckboxGroupInjection = { readonly modelValue: Ref; readonly disabled: Ref; readonly isReadonly: Ref; readonly error: Ref; has(value: FluxFormCheckboxGroupValue): boolean; toggle(value: FluxFormCheckboxGroupValue): void; }; export type FluxFormRadioGroupValue = string | number | boolean; export type FluxFormRadioGroupInjection = { readonly name: string; readonly modelValue: Ref; readonly disabled: Ref; readonly isReadonly: Ref; readonly error: Ref; select(value: FluxFormRadioGroupValue): void; }; export type FluxSegmentedControlValue = string | number; export type FluxSegmentedControlInjection = { readonly modelValue: Ref; readonly size: Ref; select(value: FluxSegmentedControlValue): void; registerItem(element: HTMLElement, value: FluxSegmentedControlValue): void; unregisterItem(element: HTMLElement): void; }; export type FluxTabBarInjection = { readonly isPills: Ref; registerItem(element: Element, isActive: Ref): void; unregisterItem(element: Element): void; }; export type FluxTableColumnDef = { readonly align?: 'start' | 'center' | 'end'; readonly isNumeric?: boolean; readonly isShrinking?: boolean; readonly maxWidth?: number; readonly minWidth?: number; readonly noWrap?: boolean; readonly pinned: 'start' | 'end' | null; readonly width?: number; }; export type FluxTablePinnedEdges = { readonly end: number; readonly start: number; }; export type FluxTableInjection = { readonly activeRow: Ref; readonly columns: Readonly>; readonly pinnedEdges: Ref; readonly pinnedOffsets: Ref>; registerColumn(element: Readonly>, column: Readonly>): () => void; registerTreeNode(element: Readonly>, level: Readonly>): () => void; }; export type FluxTimelineInjection = { registerMarker(element: Readonly>): () => void; }; export type FluxTooltipInjection = { calculate(): void; };