import { ComponentType, DragEvent, MouseEvent, RefObject, TouchEvent } from 'react'; export interface ElementWithResizeObserver extends HTMLElement { __resizeObserver?: ResizeObserver; } export type ReactMouseEvent = import('react').MouseEvent; export type ReactDragEvent = import('react').DragEvent; export type ReactTouchEvent = import('react').TouchEvent; export type DOMMouseEvent = globalThis.MouseEvent; export type DOMDragEvent = globalThis.DragEvent; export type DOMTouchEvent = globalThis.TouchEvent; export interface DebugConfig { showDebugPanel?: boolean; showMousePosition?: boolean; showPanelSizes?: boolean; showPlaceholderInfo?: boolean; showDropZoneOutlines?: boolean; logLevel?: 0 | 1 | 2; } export declare const DEFAULT_DEBUG_CONFIG: Required; export interface DragOverPosition { columnIndex: number; insertIndex: number; } export interface OriginalPanelPosition { columnIndex: number; panelIndex: number; } export interface DragState { isDragging: boolean; draggedPanel: string | null; dragOverColumn: number | null; } export interface ColumnConfig { id: string; key: string; minWidth?: number; maxWidth?: number; className?: string; label?: string; title?: string; initialWidth?: number; resizable?: boolean; } export interface PanelConfig { id: string; component: ComponentType>; title: string; props?: Record; dragMode?: "normal" | "custom"; minHeight?: string; maxHeight?: string; } export interface PanelSizeInfo { width: number; height: number; x: number; y: number; minHeight: string; maxHeight: string; } export interface TouchDragState { isTouchDragging: boolean; panelId?: string | null; startX: number; startY: number; currentX: number; currentY: number; draggedElement: HTMLElement | null; } export interface ClickState { isClicked: boolean; panelId: string | null; } export interface MousePosition { x: number; y: number; isVisible: boolean; } export interface CustomDragState { isActive: boolean; panelId: string; startX: number; startY: number; } export interface DragDropHookReturn { dragState: DragState; dragOverPosition: DragOverPosition | null; originalPanelPosition: OriginalPanelPosition | null; touchDragState: TouchDragState; customDrag: CustomDragState; clickState: ClickState; mousePosition: MousePosition; dragModes: Record; panelSizes: Record; handleDragStart: (e: ReactDragEvent, panelId: string) => void; handleDragEnd: (e: ReactDragEvent) => void; handleClick: (e: ReactMouseEvent, panelId: string) => void; handleMouseDown: (e: ReactMouseEvent, panelId: string) => void; handleTouchStart: (e: ReactTouchEvent, panelId: string) => void; handleTouchMove: (e: ReactTouchEvent) => void; handleTouchEnd: (e: ReactTouchEvent) => void; handlePlaceholderDragEnter: (columnIndex: number, insertIndex: number) => void; handlePlaceholderDragLeave: (e: ReactDragEvent, columnIndex: number, insertIndex: number) => void; toggleDragMode: (panelId: string) => void; setDragOverPosition: (position: DragOverPosition | null) => void; setPanelRef: (panelId: string, el: ElementWithResizeObserver | null) => void; findPanelPosition: (panelId: string) => OriginalPanelPosition | null; dragOverPositionRef: RefObject; } export interface DragDropEventHandlers { onDragStart: (e: DragEvent, panelId: string) => void; onDragEnd: () => void; onPlaceholderDragEnter: (columnIndex: number, insertIndex: number) => void; onPlaceholderDragLeave: (e?: DragEvent, columnIndex?: number, insertIndex?: number) => void; onDragOverWithInsert: (e: DragEvent, columnIndex: number) => void; onDropWithInsert: (e: DragEvent, targetColumn: string) => void; onColumnDragLeave: (e: DragEvent) => void; onPanelClick?: (e: MouseEvent, panelId: string) => void; onPanelMouseDown?: (e: MouseEvent, panelId: string) => void; onTouchStart?: (e: TouchEvent, panelId: string) => void; onTouchMove?: (e: TouchEvent) => void; onTouchEnd?: (e: TouchEvent) => void; onPanelSizeInfoClick?: (e: MouseEvent | TouchEvent, panelId: string) => void; onToggleDragMode?: (panelId: string) => void; /** * Optional close handler. When provided, the panel header shows an X button that the * consumer uses to REMOVE the panel (unlike the EyeOff button, which only hides the * panel into the restore bar). * * 指定時のみパネルヘッダに ✕(完全クローズ)ボタンを表示する。 * EyeOff(非表示 + 復元バー)とは別の「パネルを取り除く」意味論。 */ onPanelClose?: (panelId: string) => void; /** * Optional maximize handler (controlled). When provided, the panel header shows a * maximize/restore button and the panel whose id equals `maximizedPanel` is rendered * as a viewport-filling fixed overlay (OS-window-like maximize). Called with the * panelId to maximize, or null to restore. Escape and header double-click also restore. * * 指定時のみパネルヘッダに最大化/復元ボタンを表示する (制御型)。`maximizedPanel` に * 一致するパネルはビューポート全面の fixed オーバーレイとして描画される (OS ウインドウの * 最大化と同様)。最大化するときは panelId、復元するときは null で呼ばれる。 * Escape キーとヘッダのダブルクリックでも復元/最大化をトグルする。 */ onPanelMaximizeChange?: (panelId: string | null) => void; } /** * Where the HTML5 drag can be initiated from (dragMode "normal" only). * - "panel" (default): the whole panel is draggable — current behavior. * - "header": only the panel header is draggable, so text inside the panel body * can be selected/copied (essential for document-viewer panels). * * HTML5 ドラッグの開始領域。"header" 指定でパネル本文のテキスト選択が可能になる * (ドキュメントビューア用途で必須)。既定は従来どおり "panel" 全体。 */ export type PanelDragHandle = "panel" | "header"; export interface DragDropState { columnPanels: Record; panelVisibility: Record; dragModes: Record; dragState: DragState; dragOverPosition: DragOverPosition | null; originalPanelPosition: OriginalPanelPosition | null; panelSizes: Record; customDrag?: CustomDragState; } export interface DragDropStateUpdaters { onColumnPanelsChange: (newColumnPanels: Record) => void; onPanelVisibilityChange: (newVisibility: Record) => void; setPanelRef?: (panelId: string, el: HTMLDivElement | null) => void; } export interface UseDragDropColumnsReturn { columnPanels: Record; panelVisibility: Record; dragModes: Record; dragState: DragState; dragOverPosition: DragOverPosition | null; originalPanelPosition: OriginalPanelPosition | null; touchDragState: TouchDragState; customDrag: CustomDragState; clickState: ClickState; mousePosition: MousePosition; panelSizes: Record; setColumnPanels: (newColumnPanels: Record) => void; setPanelVisibility: (newVisibility: Record) => void; setDragModes: (newDragModes: Record) => void; setPanelRef: (panelId: string, el: HTMLDivElement | null) => void; handleDragStart: (e: DragEvent, panelId: string) => void; handleDragEnd: () => void; handleMouseDown: (e: MouseEvent, panelId: string) => void; handleTouchStart: (e: TouchEvent, panelId: string) => void; handleTouchMove: (e: TouchEvent) => void; handleTouchEnd: (e: TouchEvent) => void; handlePlaceholderDragEnter: (columnIndex: number, insertIndex: number) => void; handlePlaceholderDragLeave: (e?: DragEvent, columnIndex?: number, insertIndex?: number) => void; handleDragOverWithInsert: (e: DragEvent, columnIndex: number) => void; handleDropWithInsert: (e: DragEvent, targetColumn: string) => void; handleColumnDragLeave: (e: DragEvent) => void; handlePanelSizeInfoClick: (e: MouseEvent | TouchEvent, panelId: string) => void; toggleDragMode: (panelId: string) => void; findPanelPosition: (panelId: string) => OriginalPanelPosition | null; } export interface ResizeConfig { enableResize?: boolean; columnWidths?: Record; onColumnWidthChange?: (columnId: string, width: number) => void; onResizeStart?: (columnId: string, startX: number) => void; onResize?: (currentX: number) => void; onResizeEnd?: () => void; isResizing?: boolean; resizingColumn?: string | null; } export type DragMode = "normal" | "custom"; //# sourceMappingURL=types.d.ts.map