import type { PropType, Ref, VNodeChild } from 'vue'; import type { ExtractPublicPropTypes } from '../../_utils'; import type { EmptyProps } from '../../empty'; export interface KanbanItem { key: KanbanKey; column: KanbanKey; disabled?: boolean; title?: string | (() => VNodeChild); description?: string | (() => VNodeChild); name?: string; render?: (item: KanbanItem, column: KanbanColumn) => VNodeChild; [key: string]: unknown; } export interface KanbanColumn { key: KanbanKey; title?: string | (() => VNodeChild); disabled?: boolean; frozen?: boolean; max?: number; status?: KanbanColumnStatus; [key: string]: unknown; } export interface KanbanMoveLocation { column: KanbanKey; index: number; } export interface KanbanMoveTarget { column: KanbanKey; index?: number; } export interface KanbanMoveContext { item: KanbanItem; from: KanbanMoveLocation; to: KanbanMoveLocation; } export interface KanbanDragContext { type: 'item' | 'column'; item?: KanbanItem; column: KanbanColumn; } export interface KanbanScrollContext { column?: KanbanKey; scrollTop: number; scrollHeight: number; clientHeight: number; } export interface KanbanInstance { moveItem: (key: KanbanKey, to: KanbanMoveTarget) => void; addItem: (item: KanbanItem, index?: number) => void; removeItem: (key: KanbanKey) => void; scrollToColumn: (columnKey: KanbanKey) => void; scrollColumnToBottom: (columnKey: KanbanKey) => void; } export interface KanbanColumnSlotProps { column: KanbanColumn; items: KanbanItem[]; index: number; } export interface KanbanColumnHeaderSlotProps { column: KanbanColumn; count: number; } export interface KanbanColumnFooterSlotProps { column: KanbanColumn; } export interface KanbanColumnEmptySlotProps { column: KanbanColumn; } export interface KanbanCardSlotProps { item: KanbanItem; column: KanbanColumn; dragging: boolean; } export interface KanbanSlots { column?: (props: KanbanColumnSlotProps) => VNodeChild; columnHeader?: (props: KanbanColumnHeaderSlotProps) => VNodeChild; columnFooter?: (props: KanbanColumnFooterSlotProps) => VNodeChild; card?: (props: KanbanCardSlotProps) => VNodeChild; empty?: () => VNodeChild; columnEmpty?: (props: KanbanColumnEmptySlotProps) => VNodeChild; } export interface MoveItemResult { data: KanbanItem[]; item: KanbanItem; from: KanbanMoveLocation; to: KanbanMoveLocation; } export interface ReadRef { readonly value: T; } export interface UseKanbanDragDeps { dataRef: ReadRef; columnsRef: ReadRef; columnFieldRef: ReadRef; orientationRef: ReadRef; getItemKey: (item: KanbanItem) => KanbanKey; isItemDraggable: (item: KanbanItem, column: KanbanColumn) => boolean; isColumnDraggable: (column: KanbanColumn) => boolean; allowDropRef: ReadRef<((ctx: KanbanMoveContext) => boolean) | undefined>; emitUpdateData: (data: KanbanItem[]) => void; emitMove: (ctx: KanbanMoveContext) => void; emitColumnsReorder: (columns: KanbanColumn[]) => void; emitDragStart: (ctx: KanbanDragContext) => void; emitDragEnd: (ctx: KanbanDragContext) => void; } export interface UseKanbanDragReturn { draggingItemKeySetRef: Ref>; draggingItemRef: Ref; draggingColumnKeyRef: Ref; droppingColumnKeyRef: Ref; droppingItemKeyRef: Ref; droppingPositionRef: Ref; handleItemDragStart: (event: DragEvent, item: KanbanItem) => void; handleItemDragOver: (event: DragEvent, item: KanbanItem) => void; handleItemDrop: (event: DragEvent, item: KanbanItem) => void; handleColumnDragStart: (event: DragEvent, column: KanbanColumn) => void; handleColumnDragOver: (event: DragEvent, column: KanbanColumn) => void; handleColumnDrop: (event: DragEvent, column: KanbanColumn) => void; handleDragEnd: VoidFunction; } export type KanbanKey = string | number; export type KanbanDropPosition = 'before' | 'after'; export type KanbanOrientation = 'horizontal' | 'vertical'; export type KanbanScrollMode = 'column' | 'board'; export type KanbanColumnStatus = 'neutral' | 'success' | 'progress' | 'pending' | 'error'; export type KanbanProps = ExtractPublicPropTypes; export type KanbanColumnProps = ExtractPublicPropTypes; export type KanbanCardProps = ExtractPublicPropTypes; export type KanbanItemKeyField = KanbanKey | ((item: KanbanItem) => KanbanKey); export type KanbanColumnByKey = Map; export type KanbanDropPredicate = (ctx: KanbanMoveContext) => boolean; export declare const kanbanProps: { readonly columns: { readonly type: PropType; readonly default: () => never[]; }; readonly data: { readonly type: PropType; readonly default: () => never[]; }; readonly itemKey: { readonly type: PropType; readonly default: "key"; }; readonly columnField: { readonly type: StringConstructor; readonly default: "column"; }; readonly orientation: { readonly type: PropType; readonly default: "horizontal"; }; readonly draggable: { readonly type: BooleanConstructor; readonly default: true; }; readonly columnsDraggable: { readonly type: BooleanConstructor; readonly default: false; }; readonly disabled: BooleanConstructor; readonly allowDrop: PropType<(ctx: KanbanMoveContext) => boolean>; readonly scrollMode: { readonly type: PropType; readonly default: "board"; }; readonly scrollThreshold: { readonly type: NumberConstructor; readonly default: 48; }; readonly loading: BooleanConstructor; readonly emptyProps: PropType>; readonly columnEmptyText: PropType VNodeChild)>; readonly columnProps: PropType>; readonly cardProps: PropType>; readonly 'onUpdate:data': PropType<((data: KanbanItem[]) => void) | Array<(data: KanbanItem[]) => void>>; readonly onMove: PropType<(ctx: KanbanMoveContext) => void>; readonly onColumnsReorder: PropType<(columns: KanbanColumn[]) => void>; readonly onDragStart: PropType<(ctx: KanbanDragContext) => void>; readonly onDragEnd: PropType<(ctx: KanbanDragContext) => void>; readonly onItemClick: PropType<(item: KanbanItem, column: KanbanColumn) => void>; readonly onColumnScrollTop: PropType<(ctx: KanbanScrollContext) => void>; readonly onColumnScrollBottom: PropType<(ctx: KanbanScrollContext) => void>; readonly onScrollTop: PropType<(ctx: KanbanScrollContext) => void>; readonly onScrollBottom: PropType<(ctx: KanbanScrollContext) => void>; }; export declare const kanbanColumnProps: { readonly column: { readonly type: PropType; readonly required: true; }; readonly items: { readonly type: PropType; readonly default: () => never[]; }; readonly index: { readonly type: NumberConstructor; readonly default: 0; }; }; export declare const kanbanCardProps: { readonly item: { readonly type: PropType; readonly required: true; }; readonly column: { readonly type: PropType; readonly required: true; }; readonly index: { readonly type: NumberConstructor; readonly default: 0; }; readonly ghost: BooleanConstructor; };