import { NXComponent, NXNativeEvent } from '@acorex/cdk/common';
import * as _angular_core from '@angular/core';
import { TemplateRef } from '@angular/core';
import { AXDropListDroppedEvent } from '@acorex/cdk/drag-drop';

declare class AXKanbanComponent extends NXComponent {
    hasActions: _angular_core.InputSignal<boolean>;
    dragStartDelay: _angular_core.InputSignal<number>;
    statuses: _angular_core.InputSignal<AXKanbanStatus[]>;
    itemTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
    dataSource: _angular_core.InputSignal<any[] | AXKanbanItem[]>;
    keyField: _angular_core.InputSignal<string>;
    indexField: _angular_core.InputSignal<string>;
    titleField: _angular_core.InputSignal<string>;
    cssClassField: _angular_core.InputSignal<string>;
    priorityField: _angular_core.InputSignal<string>;
    statusKeyField: _angular_core.InputSignal<string>;
    descriptionField: _angular_core.InputSignal<string>;
    emptyTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
    headerTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
    footerTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
    contentFooterTemplate: _angular_core.InputSignal<TemplateRef<unknown>>;
    tooltipTemplate: _angular_core.InputSignal<string | TemplateRef<unknown>>;
    onBeforeDrop: _angular_core.OutputEmitterRef<AXKanbanBeforeDropEvent>;
    onSortChanged: _angular_core.OutputEmitterRef<AXKanbanSortEvent>;
    onItemClick: _angular_core.OutputEmitterRef<AXKanbanMouseEvent>;
    onActionClick: _angular_core.OutputEmitterRef<AXKanbanMouseEvent>;
    onItemDblClick: _angular_core.OutputEmitterRef<AXKanbanMouseEvent>;
    onItemRightClick: _angular_core.OutputEmitterRef<AXKanbanMouseEvent>;
    protected items: _angular_core.Signal<AXKanbanItem[]>;
    protected filteredStatuses: _angular_core.Signal<AXKanbanStatus[]>;
    /**
     * Handles a drop operation to reorder items or move them between statuses.
     * It uses the component's current rendered state (`this.items`) as the source
     * of truth, performs precise re-indexing, and emits a comprehensive event with
     * the updated data source.
     *
     * @param event AXDropListDroppedEvent - The drag-and-drop event including indices and container information.
     * @returns Promise<void>
     */
    drop(event: AXDropListDroppedEvent): Promise<void>;
    /**
     * Programmatically move an item to a different status or reorder within the same status.
     * @param itemId The ID of the item to move (using keyField)
     * @param targetStatusKey The target status key to move the item to
     * @param targetIndex Optional target index within the target status. If not provided, item will be appended to the end.
     * @returns Promise<boolean> - true if the move was successful, false otherwise
     */
    moveItem(itemId: any, targetStatusKey: any, targetIndex?: number): Promise<boolean>;
    /**
     * Programmatically reorder an item within the same status.
     * @param itemId The ID of the item to reorder (using keyField)
     * @param newIndex The new index position within the same status
     * @returns Promise<boolean> - true if the reorder was successful, false otherwise
     */
    reorderItem(itemId: any, newIndex: number): Promise<boolean>;
    /**
     * Programmatically move an item to a different status.
     * @param itemId The ID of the item to move (using keyField)
     * @param targetStatusKey The target status key to move the item to
     * @param targetIndex Optional target index within the target status. If not provided, item will be appended to the end.
     * @returns Promise<boolean> - true if the move was successful, false otherwise
     */
    moveItemToStatus(itemId: any, targetStatusKey: any, targetIndex?: number): Promise<boolean>;
    /**
     * Core method that performs the move operation, handles re-indexing, and emits events.
     * This is used by both drag-and-drop operations and programmatic moves.
     *
     * @param originalItem The original item from dataSource that is being moved
     * @param previousStatusKey The status key the item is moving from
     * @param currentStatusKey The status key the item is moving to
     * @param previousIndex The index the item is moving from
     * @param currentIndex The index the item is moving to
     * @param nativeEvent The native mouse event (null for programmatic moves)
     * @returns Promise<boolean> - true if the move was successful, false otherwise
     */
    private performMove;
    /**
     * Emit beforeDrop event and return whether to continue with the drop operation.
     * Supports both synchronous and asynchronous event handlers via the `wait()` method.
     * @param item The original item from dataSource that is being moved
     * @param previousStatusKey The status key the item is moving from
     * @param currentStatusKey The status key the item is moving to
     * @param previousIndex The index the item is moving from
     * @param currentIndex The index the item is moving to
     * @param nativeEvent The native mouse event (null for programmatic moves)
     * @returns Promise<boolean> - true if the drop should proceed, false if it should be canceled
     */
    private emitBeforeDropEvent;
    protected getItemsById(key: any): AXKanbanItem[];
    protected getOriginalItemsById(key: any): any[];
    protected stringify(value: any): string;
    protected handleActionClick(event: MouseEvent, item: AXKanbanItem): void;
    protected handleClick(event: MouseEvent, item: AXKanbanItem): void;
    protected handleDblClick(event: MouseEvent, item: AXKanbanItem): void;
    protected handleRightClick(event: MouseEvent, item: AXKanbanItem): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXKanbanComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXKanbanComponent, "ax-kanban", never, { "hasActions": { "alias": "hasActions"; "required": false; "isSignal": true; }; "dragStartDelay": { "alias": "dragStartDelay"; "required": false; "isSignal": true; }; "statuses": { "alias": "statuses"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "keyField": { "alias": "keyField"; "required": false; "isSignal": true; }; "indexField": { "alias": "indexField"; "required": false; "isSignal": true; }; "titleField": { "alias": "titleField"; "required": false; "isSignal": true; }; "cssClassField": { "alias": "cssClassField"; "required": false; "isSignal": true; }; "priorityField": { "alias": "priorityField"; "required": false; "isSignal": true; }; "statusKeyField": { "alias": "statusKeyField"; "required": false; "isSignal": true; }; "descriptionField": { "alias": "descriptionField"; "required": false; "isSignal": true; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": false; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; "isSignal": true; }; "contentFooterTemplate": { "alias": "contentFooterTemplate"; "required": false; "isSignal": true; }; "tooltipTemplate": { "alias": "tooltipTemplate"; "required": false; "isSignal": true; }; }, { "onBeforeDrop": "onBeforeDrop"; "onSortChanged": "onSortChanged"; "onItemClick": "onItemClick"; "onActionClick": "onActionClick"; "onItemDblClick": "onItemDblClick"; "onItemRightClick": "onItemRightClick"; }, never, never, true, never>;
}

type AXKanbanItem = {
    id: any;
    index?: number;
    title?: string;
    statusKey: any;
    cssClass?: string;
    description?: string;
    priority?: 'highest' | 'high' | 'medium' | 'low' | 'lowest';
};
type AXKanbanStatus = {
    key: any;
    title: string;
    index?: number;
    cssClass?: string;
};
interface AXKanbanSortEvent extends NXNativeEvent<AXKanbanComponent, MouseEvent> {
    item: any;
    allItems: any[];
    currentIndex: number;
    previousIndex: number;
    currentStatusKey: any;
    previousStatusKey: any;
}
interface AXKanbanMouseEvent extends NXNativeEvent<AXKanbanComponent, MouseEvent> {
    item: any;
}
interface AXKanbanBeforeDropEvent extends NXNativeEvent<AXKanbanComponent, MouseEvent> {
    item: any;
    previousStatusKey: any;
    currentStatusKey: any;
    previousIndex: number;
    currentIndex: number;
    canceled: boolean;
    wait: (promise: Promise<any>) => void;
}

export { AXKanbanComponent };
export type { AXKanbanBeforeDropEvent, AXKanbanItem, AXKanbanMouseEvent, AXKanbanSortEvent, AXKanbanStatus };
