import { default as default_2 } from 'react';
import { ForwardedRef } from 'react';
import { ForwardRefExoticComponent } from 'react';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { NiceBaseProps } from '@nice2dev/ui-core';
import { NiceDataSource } from '@nice2dev/ui-core';
import { NiceSize } from '@nice2dev/ui-core';
import { ReactNode } from 'react';
import { RefAttributes } from 'react';
import { TracelessMode } from '@nice2dev/ui-core';

declare interface AIFilter {
    field: string;
    operator: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startsWith' | 'endsWith';
    value: unknown;
}

/**
 * AI-generated match suggestion.
 */
export declare interface AISuggestion {
    /** Statement item ID */
    statementId: string;
    /** Suggested entry IDs */
    entryIds: string[];
    /** Confidence score (0-100) */
    confidence: number;
    /** Confidence level */
    confidenceLevel: MatchConfidence;
    /** Explanation */
    reason: string;
    /** Factors that contributed to this suggestion */
    factors: SuggestionFactor[];
}

/**
 * A single transaction from the bank statement import.
 */
export declare interface BankStatementItem {
    /** Unique identifier */
    id: string;
    /** Transaction date */
    date: Date | string;
    /** Value date (settlement) */
    valueDate?: Date | string;
    /** Description / reference */
    description?: string;
    /** Transaction amount (positive=credit, negative=debit) */
    amount: number;
    /** ISO currency code */
    currency?: string;
    /** Counterparty name */
    counterparty?: string;
    /** IBAN / account number */
    counterpartyAccount?: string;
    /** Bank reference number */
    referenceNumber?: string;
    /** End-to-end ID (SEPA) */
    endToEndId?: string;
    /** Additional metadata */
    metadata?: Record<string, any>;
    /** Current reconciliation status */
    status?: ReconciliationStatus;
    /** Matched book entry IDs */
    matchedEntryIds?: string[];
    /** AI confidence (0-100) */
    confidence?: number;
    /** ID of suggested matching book entry. */
    suggestedMatch?: string;
    /** Excluded from reconciliation */
    excluded?: boolean;
}

/**
 * A single entry from the accounting ledger / ERP.
 */
export declare interface BookEntry {
    /** Unique identifier */
    id: string;
    /** Posting date */
    date: Date | string;
    /** Document date */
    documentDate?: Date | string;
    /** Description / posting text */
    description?: string;
    /** Reference / document code (alternative display when `description` is omitted). */
    reference?: string;
    /** GL account or bank account code. */
    account?: string;
    /** Amount (positive=debit, negative=credit for bank account) */
    amount: number;
    /** ISO currency code */
    currency?: string;
    /** Document number (invoice, receipt, etc.) */
    documentNumber?: string;
    /** Customer/Vendor name */
    partyName?: string;
    /** Customer/Vendor ID */
    partyId?: string;
    /** Cost center */
    costCenter?: string;
    /** GL account */
    glAccount?: string;
    /** Tax code */
    taxCode?: string;
    /** Additional metadata */
    metadata?: Record<string, any>;
    /** Current reconciliation status */
    status?: ReconciliationStatus;
    /** Matched bank statement IDs */
    matchedStatementIds?: string[];
    /** AI confidence (0-100) */
    confidence?: number;
}

/** Cell position for keyboard navigation and selection. */
declare interface CellPosition {
    rowKey: string;
    field: string;
}

/** Cell range for multi-cell selection. */
declare interface CellRange {
    start: CellPosition;
    end: CellPosition;
}

/** Clipboard export format. */
declare type ClipboardFormat = 'text' | 'csv' | 'json' | 'html' | 'markdown';

/** Column group for multi-level headers. */
declare interface ColumnGroup {
    header: string;
    columns: string[];
    align?: 'left' | 'center' | 'right';
}

export declare function computeAggregate(rows: Record<string, any>[], field: string, type: NiceAggregateType): string;

export declare function escapeCsvField(val: string): string;

/**
 * Match confidence level.
 */
export declare type MatchConfidence = 'high' | 'medium' | 'low';

/**
 * Single matching criterion.
 */
export declare interface MatchCriteria {
    /** Field to compare on statement */
    statementField: keyof BankStatementItem | string;
    /** Field to compare on entry */
    entryField: keyof BookEntry | string;
    /** Comparison type */
    comparison: 'exact' | 'contains' | 'startsWith' | 'regex' | 'fuzzy' | 'amount';
    /** Tolerance for amount comparison (as decimal, e.g., 0.01 for 1%) */
    tolerance?: number;
    /** Transform function name */
    transform?: 'lowercase' | 'uppercase' | 'trim' | 'removeSpaces' | 'digits';
}

/**
 * Rule-based matching configuration.
 */
export declare interface MatchingRule {
    /** Rule ID */
    id: string;
    /** Rule name */
    name: string;
    /** Priority (higher = first) */
    priority: number;
    /** Is rule active */
    enabled: boolean;
    /** Match criteria */
    criteria: MatchCriteria[];
    /** Required criteria count to match (default: all) */
    minCriteriaCount?: number;
    /** Description */
    description?: string;
}

/** Supported cell renderer types for NiceModuleGrid. */
declare type ModuleCellRendererType = 'text' | 'number' | 'currency' | 'date' | 'datetime' | 'boolean' | 'enum' | 'link' | 'image' | 'progress' | 'rating' | 'color' | 'badge' | 'avatar' | 'percent' | 'custom';

/** Context menu action. */
declare interface ModuleContextMenuItem<T = any> {
    key: string;
    label: string;
    icon?: React.ReactNode;
    disabled?: boolean | ((row: T) => boolean);
    hidden?: boolean | ((row: T) => boolean);
    danger?: boolean;
    divider?: boolean;
    permission?: string;
    onClick?: (row: T) => void;
}

/** Empty state configuration. */
declare interface ModuleEmptyState {
    icon?: React.ReactNode;
    title: string;
    description?: string;
    action?: {
        label: string;
        onClick: () => void;
        icon?: React.ReactNode;
    };
}

/** Enum option for badge/select renderers. */
declare interface ModuleEnumOption {
    value: string | number;
    label: string;
    /** Visual variant — semantic name or any CSS color string. */
    color?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'secondary' | 'default' | (string & {});
    icon?: React.ReactNode;
}

/** Export configuration. */
declare interface ModuleExportConfig {
    filename?: string;
    includeHidden?: boolean;
    selectedOnly?: boolean;
    columns?: string[];
    title?: string;
    subtitle?: string;
}

/** Export format options. */
declare type ModuleExportFormat = 'csv' | 'excel' | 'pdf' | 'json';

/** Single filter condition. */
declare interface ModuleFilterCondition {
    field: string;
    operator: ModuleFilterOperator;
    value: unknown;
    valueTo?: unknown;
}

/** Filter group with AND/OR logic. */
declare interface ModuleFilterGroup {
    logic: 'and' | 'or';
    conditions: (ModuleFilterCondition | ModuleFilterGroup)[];
}

/** Filter operator types. */
declare type ModuleFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'in' | 'notIn' | 'between' | 'isNull' | 'isNotNull';

/** Column definition from JSON schema for NiceModuleGrid. */
declare interface ModuleGridColumn<T = any> {
    /** Field path in entity (supports dot notation: "address.city") */
    field: string;
    /** Display header (i18n key or literal) */
    header: string;
    /** Column width (px or 'auto') */
    width?: number | 'auto';
    /** Minimum column width */
    minWidth?: number;
    /** Maximum column width */
    maxWidth?: number;
    /** Enable column sorting */
    sortable?: boolean;
    /** Enable column filtering */
    filterable?: boolean;
    /** Cell renderer type */
    type?: ModuleCellRendererType;
    /** Custom cell renderer function */
    render?: (value: unknown, row: T, index: number) => React.ReactNode;
    /** Cell alignment */
    align?: 'left' | 'center' | 'right';
    /** Hide column by default */
    hidden?: boolean;
    /** Pin column to left or right */
    pinned?: 'left' | 'right';
    /** Enable inline editing */
    editable?: boolean;
    /** Custom inline editor */
    editor?: (value: unknown, row: T, onChange: (val: unknown) => void) => React.ReactNode;
    /** Enum options for badge/select renderers */
    enumOptions?: ModuleEnumOption[];
    /** Format pattern (date: 'YYYY-MM-DD', number: '#,##0.00', currency: 'PLN') */
    format?: string;
    /** Currency code for currency renderer */
    currencyCode?: string;
    /** Alias for `currencyCode`. */
    currency?: string;
    /** Max rating for rating renderer */
    maxRating?: number;
    /** Link URL template (use {{field}} for values) */
    linkTemplate?: string;
    /** Open link in new tab */
    linkNewTab?: boolean;
    /** Image thumbnail size */
    imageSize?: 'xs' | 'sm' | 'md' | 'lg';
    /** Progress bar color */
    progressColor?: 'primary' | 'success' | 'warning' | 'danger';
    /** Tooltip for column header */
    headerTooltip?: string;
    /** Validation rules for inline editing */
    validation?: {
        required?: boolean;
        min?: number;
        max?: number;
        pattern?: string;
        message?: string;
    };
    /** Column group name (for grouped headers) */
    group?: string;
    /** Aggregate function for footer */
    aggregate?: 'sum' | 'avg' | 'count' | 'min' | 'max';
    /** Searchable in global search */
    searchable?: boolean;
    /** Export to CSV/Excel/PDF */
    exportable?: boolean;
}

/** Server query for pagination, sorting, filtering. */
declare interface ModuleGridQuery {
    page: number;
    pageSize: number;
    sort?: ModuleSortSpec[];
    filter?: ModuleFilterGroup;
    search?: string;
    groupBy?: string;
}

/** Server response with pagination metadata. */
declare interface ModuleGridResponse<T> {
    data: T[];
    total: number;
    page: number;
    pageSize: number;
    hasMore: boolean;
    aggregates?: Record<string, number>;
}

/** Grouped row structure. */
declare interface ModuleGroupedRow<T = any> {
    isGroup: true;
    groupKey: string;
    groupValue: unknown;
    groupLabel: string;
    count: number;
    aggregates?: Record<string, number>;
    rows?: T[];
    expanded?: boolean;
    level: number;
}

/** Selection mode for grid. */
declare type ModuleSelectionMode = 'none' | 'single' | 'multiple' | 'checkbox';

/** Sort specification. */
declare interface ModuleSortSpec {
    field: string;
    direction: 'asc' | 'desc';
}

/** User view preferences for persistence. */
declare interface ModuleViewPreferences {
    columnOrder?: string[];
    columnWidths?: Record<string, number>;
    hiddenColumns?: string[];
    pinnedColumns?: {
        left: string[];
        right: string[];
    };
    sort?: ModuleSortSpec[];
    filter?: ModuleFilterGroup;
    pageSize?: number;
    groupBy?: string;
    displayDensity?: 'compact' | 'normal' | 'comfortable';
}

/** Supported aggregate functions for column footers. */
declare type NiceAggregateType = 'sum' | 'avg' | 'count' | 'min' | 'max';

export declare function NiceCardView<T extends NiceCardViewItem>({ items, renderCard, columns, gap, searchable, searchField, searchPlaceholder, loading, emptyText, onCardClick, className, style, accessMode, id, }: NiceCardViewProps<T>): JSX_2.Element | null;

/** An item displayed by the {@link NiceCardView} component. */
declare interface NiceCardViewItem {
    /** Unique key. */
    key: string;
    /** Additional data fields. */
    [field: string]: any;
}

/** Props for the {@link NiceCardView} component — a responsive card grid with search and custom card rendering. */
export declare interface NiceCardViewProps<T extends NiceCardViewItem = NiceCardViewItem> extends NiceBaseProps {
    /** Data items. */
    items: T[];
    /** Custom card renderer. */
    renderCard: (item: T) => default_2.ReactNode;
    /** Number of grid columns. */
    columns?: number;
    /** Gap between cards (px or CSS value). */
    gap?: number | string;
    /** Show a search box. */
    searchable?: boolean;
    /** Field searched when searchable is enabled. */
    searchField?: string;
    /** Search input placeholder. */
    searchPlaceholder?: string;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when items is empty. */
    emptyText?: string;
    /** Called when a card is clicked. */
    onCardClick?: (item: T) => void;
}

declare interface NiceColumnState {
    field: string;
    visible: boolean;
    width?: number;
    order?: number;
}

/** Conditional formatting rule for cells. */
declare interface NiceConditionalFormat<T = any> {
    /** Condition to apply formatting */
    when: (value: unknown, row: T, field: string) => boolean;
    /** CSS class to apply */
    className?: string;
    /** Inline styles to apply */
    style?: React.CSSProperties;
    /** Icon to display */
    icon?: React.ReactNode;
    /** Background color */
    backgroundColor?: string;
    /** Text color */
    color?: string;
}

/** Conditional formatting rule for cells. */
declare interface NiceConditionalFormatRule {
    /** Target cell range (e.g. "A1:C10"). */
    range: string;
    /** Rule type. */
    type: 'greaterThan' | 'lessThan' | 'equalTo' | 'between' | 'textContains' | 'isEmpty' | 'isNotEmpty' | 'colorScale' | 'dataBar';
    /** Comparison value(s). */
    value?: NiceSpreadsheetCellValue;
    value2?: NiceSpreadsheetCellValue;
    /** Formatting to apply when condition is met. */
    style: {
        bgColor?: string;
        color?: string;
        bold?: boolean;
        italic?: boolean;
    };
    /** Color scale stops (for colorScale type). */
    colorScale?: {
        min: string;
        mid?: string;
        max: string;
    };
}

export declare function NiceDataGrid<T extends Record<string, any>>({ columns, data: dataProp, keyField, dataSource, sortable, sortField: controlledSortField, sortDirection: controlledSortDir, onSort, selectable, selectedKeys: controlledSelected, onSelectionChange, pagination, pageSize: initPageSize, page: controlledPage, onPageChange, totalRows, searchable, searchPlaceholder, virtualScroll, rowHeight, groupBy, groupRender, onCellEdit, editMode, formItems, formColumns, editFormTitle, formProps, onRowEdit, onRowAdd, onRowDelete: _onRowDelete, bulkActions, onBulkDelete, exportCsv, exportFilename, detailRow, expandedRowKeys: controlledExpandedRows, onExpandedRowChange, columnReorder: _columnReorder, onColumnReorder: _onColumnReorder, columnResize, rowDraggable, onRowReorder, striped, compact, loading: loadingProp, emptyText, toolbar, onRowClick, pinnedTopKeys, pinnedBottomKeys, colSpan: colSpanFn, showStatusBar, contextMenuItems, onContextMenuAction, printFriendly, keyboardNavigation, focusedCell: controlledFocusedCell, onFocusedCellChange, cellRangeSelection, selectedCellRange: controlledCellRange, onCellRangeChange, clipboard, clipboardFormat, onBeforeCopy, onCopy, onPaste, quickFilters, activeQuickFilters: controlledQuickFilters, onQuickFilterChange, columnGroups: _columnGroups, stateStorageKey, initialState, onStateChange, flashRowKeys, flashDuration, autoFitColumns: _autoFitColumns, showColumnStats: _showColumnStats, rowIndicator, frozenRows: _frozenRows, className, style, accessMode, id, displayStyle, }: NiceDataGridProps<T>): JSX_2.Element | null;

export declare namespace NiceDataGrid {
    var displayName: string;
}

export declare const NiceDataGridAI: <T extends Record<string, unknown>>(props: NiceDataGridAIProps<T> & {
    ref?: default_2.ForwardedRef<NiceDataGridAIRef<T>>;
}) => default_2.ReactElement;

export declare interface NiceDataGridAIProps<T extends Record<string, unknown>> extends Omit<NiceDataGridProps<T>, 'ref'> {
    /** Enable AI features (requires NiceAIProvider) */
    enableAI?: boolean;
    /** AI model to use */
    aiModel?: string;
    /** Enable natural language search */
    enableNLSearch?: boolean;
    /** Enable AI-powered insights */
    enableInsights?: boolean;
    /** Natural language placeholder */
    nlPlaceholder?: string;
    /** Callback when AI filter is applied */
    onAIFilter?: (query: string, filters: AIFilter[]) => void;
    /** Callback when AI generates insights */
    onInsights?: (insights: string[]) => void;
    /** Show AI search bar */
    showAISearchBar?: boolean;
    /** Example queries to show as hints */
    exampleQueries?: string[];
}

declare interface NiceDataGridAIRef<_T> {
    /** Apply natural language filter */
    applyNLFilter: (query: string) => Promise<void>;
    /** Clear AI filters */
    clearAIFilters: () => void;
    /** Get current AI filters */
    getAIFilters: () => AIFilter[];
    /** Generate insights from current data */
    generateInsights: () => Promise<string[]>;
}

/** Bulk action button shown in {@link NiceDataGrid} toolbar when rows are selected. */
declare interface NiceDataGridBulkAction<T = any> {
    /** Unique key for the action. */
    key: string;
    /** Visible label. */
    label: string;
    /** Optional icon node. */
    icon?: React.ReactNode;
    /** Visual variant. */
    variant?: 'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
    /** Disable the action based on current selection. */
    disabled?: (selectedKeys: string[], rows: T[]) => boolean;
    /** Handler invoked with selected row keys and the matching rows. */
    onClick: (selectedKeys: string[], rows: T[]) => void;
}

/** Column definition for {@link NiceDataGrid}. */
export declare interface NiceDataGridColumn<T = any> {
    field: string;
    header: string;
    width?: number | string;
    minWidth?: number;
    sortable?: boolean;
    filterable?: boolean;
    render?: (value: unknown, row: T, index: number) => React.ReactNode;
    align?: 'left' | 'center' | 'right';
    hidden?: boolean;
    /** Pin column to left or right edge */
    pinned?: 'left' | 'right';
    /** Allow inline cell editing via double-click */
    editable?: boolean;
    /** Custom inline editor */
    editor?: (value: unknown, row: T, onChange: (val: unknown) => void) => React.ReactNode;
    /** Footer aggregation */
    aggregate?: NiceAggregateType;
    /** Custom aggregate label */
    aggregateLabel?: string;
    /** Conditional formatting rules */
    conditionalFormats?: NiceConditionalFormat<T>[];
    /** Data type for validation and formatting */
    dataType?: 'string' | 'number' | 'boolean' | 'date' | 'currency' | 'percent';
    /** Format pattern (e.g., "#,##0.00" for numbers) */
    format?: string;
    /** Enable cell sparkline/progress visualization */
    cellVisualization?: 'progress' | 'sparkline' | 'rating' | 'trend' | 'heatmap';
    /** Min value for visualization scaling */
    visualMin?: number;
    /** Max value for visualization scaling */
    visualMax?: number;
    /** Validation rules */
    validation?: {
        required?: boolean;
        min?: number;
        max?: number;
        pattern?: RegExp;
        custom?: (value: unknown, row: T) => boolean | string;
    };
    /** Tooltip for column header */
    headerTooltip?: string;
    /** Enable column header menu (sort, filter, hide, auto-fit) */
    headerMenu?: boolean;
}

/**
 * Props for the NiceDataGrid component � a full-featured data table with sorting,
 * filtering, pagination, virtual scrolling, grouping, inline editing, master/detail and more.
 */
export declare interface NiceDataGridProps<T extends Record<string, any> = any> extends NiceBaseProps {
    columns: NiceDataGridColumn<T>[];
    /** Inline data array. Ignored when `dataSource` is provided. */
    data?: T[];
    keyField?: string;
    /**
     * Universal data source binding.
     * When provided, the grid automatically handles sort, pagination, search
     * and CRUD via the data source. `data` prop is ignored.
     */
    dataSource?: NiceDataSource<T>;
    sortable?: boolean;
    sortField?: string;
    sortDirection?: SortDirection;
    onSort?: (field: string, direction: SortDirection) => void;
    selectable?: boolean;
    selectedKeys?: Set<string>;
    onSelectionChange?: (keys: Set<string>) => void;
    pagination?: boolean;
    pageSize?: number;
    page?: number;
    onPageChange?: (page: number) => void;
    totalRows?: number;
    searchable?: boolean;
    searchPlaceholder?: string;
    virtualScroll?: boolean;
    /** Fixed row height in px for virtual scrolling (default 40) */
    rowHeight?: number;
    groupBy?: string;
    /** Custom group header renderer */
    groupRender?: (groupValue: unknown, rows: T[]) => React.ReactNode;
    onCellEdit?: (rowKey: string, field: string, newValue: unknown) => void;
    /** Editing mode. `'inline'` (default) edits a single cell in place; `'popup'` opens a NiceForm-based dialog for the whole row (or a subset defined by `formItems`). */
    editMode?: 'inline' | 'popup';
    /** Form item definitions for popup-edit mode. When omitted, auto-derived from `columns` (skipping non-editable). Use `field` to map back to the row data. */
    formItems?: NiceFormItem[];
    /** Number of columns for the popup form. Defaults to 2. */
    formColumns?: number;
    /** Modal title for popup edit. Defaults to `'Edit row'`. */
    editFormTitle?: string;
    /** Escape-hatch: extra props forwarded to the underlying `NiceForm` in the popup (e.g. `labelPosition`, `gap`, `size`, `responsiveColumns`). Aligns with the `NiceFormDesigner` standard. */
    formProps?: Partial<Omit<NiceFormProps, 'items' | 'data' | 'onFieldChange' | 'onSubmit' | 'columns' | 'showActions' | 'submitLabel'>>;
    /** Called when the popup form is submitted with the merged row. */
    onRowEdit?: (rowKey: string, updatedRow: T) => void;
    /** Called when user requests a new row (toolbar button). When provided a "+ Add" button is shown and the popup is opened with empty data. */
    onRowAdd?: (newRow: T) => void;
    /** Called when user clicks the row delete action. When provided, a delete column is rendered. */
    onRowDelete?: (rowKey: string, row: T) => void;
    /** Bulk action items shown in toolbar when one or more rows are selected. */
    bulkActions?: NiceDataGridBulkAction<T>[];
    /** Called when user clicks the built-in "Bulk delete" action (only if {@link bulkActions} not provided). */
    onBulkDelete?: (selectedKeys: string[], rows: T[]) => void;
    exportCsv?: boolean;
    exportFilename?: string;
    /** Render detail content for an expanded row */
    detailRow?: (row: T) => React.ReactNode;
    expandedRowKeys?: Set<string>;
    onExpandedRowChange?: (keys: Set<string>) => void;
    /** Enable column reorder via drag */
    columnReorder?: boolean;
    onColumnReorder?: (columns: NiceDataGridColumn<T>[]) => void;
    /** Enable column resize via drag */
    columnResize?: boolean;
    rowDraggable?: boolean;
    onRowReorder?: (fromIndex: number, toIndex: number) => void;
    striped?: boolean;
    compact?: boolean;
    loading?: boolean;
    emptyText?: string;
    toolbar?: React.ReactNode;
    onRowClick?: (row: T) => void;
    pinnedTopKeys?: Set<string>;
    pinnedBottomKeys?: Set<string>;
    colSpan?: (row: T, col: NiceDataGridColumn<T>, colIndex: number) => number | undefined;
    showStatusBar?: boolean;
    contextMenuItems?: {
        key: string;
        label: string;
        icon?: React.ReactNode;
        disabled?: boolean;
    }[];
    onContextMenuAction?: (action: string, row: T) => void;
    printFriendly?: boolean;
    /** Enable keyboard navigation with arrow keys */
    keyboardNavigation?: boolean;
    /** Currently focused cell */
    focusedCell?: CellPosition;
    /** Callback when focused cell changes */
    onFocusedCellChange?: (cell: CellPosition | null) => void;
    /** Enable multi-cell range selection */
    cellRangeSelection?: boolean;
    /** Currently selected cell range */
    selectedCellRange?: CellRange;
    /** Callback when cell range changes */
    onCellRangeChange?: (range: CellRange | null) => void;
    /** Enable clipboard operations (copy/paste) */
    clipboard?: boolean;
    /** Default clipboard format */
    clipboardFormat?: ClipboardFormat;
    /** Callback before copy � return false to cancel */
    onBeforeCopy?: (data: T[], fields: string[]) => boolean | void;
    /** Callback after copy */
    onCopy?: (data: T[], fields: string[], format: ClipboardFormat) => void;
    /** Callback on paste */
    onPaste?: (data: unknown[][], startCell: CellPosition) => void;
    /** Quick filter chips */
    quickFilters?: QuickFilter<T>[];
    /** Active quick filter keys */
    activeQuickFilters?: string[];
    /** Callback when quick filters change */
    onQuickFilterChange?: (activeKeys: string[]) => void;
    columnGroups?: ColumnGroup[];
    /** Storage key for persisting grid state */
    stateStorageKey?: string;
    /** Initial state (overrides storage) */
    initialState?: NiceDataGridState;
    /** Callback when state changes */
    onStateChange?: (state: NiceDataGridState) => void;
    /** Keys of rows that should flash (for update animations) */
    flashRowKeys?: Set<string>;
    /** Duration of flash animation in ms */
    flashDuration?: number;
    /** Enable auto-fit column width */
    autoFitColumns?: boolean;
    /** Show quick stats tooltip on column header hover */
    showColumnStats?: boolean;
    /** Render custom row indicator (validation, status, etc.) */
    rowIndicator?: (row: T) => React.ReactNode;
    /** Number of rows to freeze at top */
    frozenRows?: number;
}

/** Grid state for persistence. */
declare interface NiceDataGridState {
    columnWidths?: Record<string, number>;
    columnOrder?: string[];
    hiddenColumns?: string[];
    sortField?: string;
    sortDirection?: 'asc' | 'desc' | null;
    pageSize?: number;
    expandedGroups?: string[];
}

declare interface NiceFilterState {
    [key: string]: unknown;
}

/** Describes a single field in a {@link NiceForm} layout. */
declare interface NiceFormItem {
    field: string;
    label?: string;
    colSpan?: number;
    required?: boolean;
    /** Static visibility flag � set to false to always hide. */
    visible?: boolean;
    /**
     * Dynamic visibility: evaluated against current form data.
     * Example: `(data) => data.country === 'PL'`
     */
    visibleWhen?: (data: Record<string, any>) => boolean;
    render?: (value: unknown, onChange: (v: unknown) => void) => default_2.ReactNode;
    hint?: string;
    /** Group name � fields with the same group are rendered together under a section header. */
    group?: string;
    /** Tab name � fields with the same tab are rendered together under a tab. Tabs take precedence over groups for top-level structure. */
    tab?: string;
    /** Field type for auto-rendering (text, number, select, etc.). */
    type?: string;
    /** Options for select/radio type fields. */
    options?: Array<{
        label: string;
        value: string | number;
    } | string>;
    /** Mask pattern for `type: 'masked'`. */
    mask?: string;
    /** Placeholder text shown when no value is selected/entered. */
    placeholder?: string;
    /** Default value applied when no value exists in `data`. */
    defaultValue?: unknown;
    /** Disable this field individually. */
    disabled?: boolean;
    /** Render this field in read-only mode individually. */
    readOnly?: boolean;
    /** Hide this field (alias of `visible: false`). */
    hidden?: boolean;
    /**
     * Optional unit / currency code rendered as a suffix for `type: 'currency'`
     * or `type: 'number'` (e.g. `'PLN'`, `'$'`, `'kg'`). Defaults to `'PLN'`
     * for currency.
     */
    unit?: string;
    /** Decimal precision for `type: 'number'` / `type: 'currency'`. Default 2 for currency, 0 for number. */
    precision?: number;
    /** Stepper increment for `type: 'number'` / `type: 'currency'`. Default 100 for currency, 1 for number. */
    step?: number;
    /** For `type: 'address'` � render sub-fields in 1 or 2 columns. Default 2. */
    columns?: 1 | 2;
}

/** Props for the {@link NiceForm} component � a declarative, data-driven form layout. */
declare interface NiceFormProps extends NiceBaseProps {
    items: NiceFormItem[];
    /** Inline form data. Ignored when `dataSource` + `recordKey` are provided. */
    data?: Record<string, any>;
    /** Field change callback. Ignored when `dataSource` is provided. */
    onFieldChange?: (field: string, value: unknown) => void;
    onSubmit?: (data: Record<string, any>) => void;
    /**
     * Two-way data source binding.
     * When provided together with `recordKey`, the form loads and edits
     * a single record from the source. `data`/`onFieldChange` are ignored.
     */
    dataSource?: NiceDataSource;
    /** Key of the record to load/edit. */
    recordKey?: unknown;
    columns?: number;
    /**
     * Responsive columns: map of min-width breakpoint (px) ? column count.
     * Example: `{ 0: 1, 600: 2, 1024: 3 }` ? 1 col on small, 2 on medium, 3 on large.
     */
    responsiveColumns?: Record<number, number>;
    gap?: number | string;
    labelPosition?: 'top' | 'left';
    size?: NiceSize;
    readOnly?: boolean;
    disabled?: boolean;
    /** Auto-save delay in ms. When set, form auto-saves after this many ms of inactivity. */
    autoSaveDelay?: number;
    /** Callback when dirty state changes. */
    onDirtyChange?: (isDirty: boolean) => void;
    /** When true, render Submit/Reset buttons at the bottom. */
    showActions?: boolean;
    /** Custom Submit button label. */
    submitLabel?: string;
    /** Custom Reset button label. */
    resetLabel?: string;
    /**
     * When provided, a Cancel button is rendered on the LEFT side of the
     * actions row. Used by popup hosts (NiceDataGrid edit popup, NiceKanban
     * edit popup, etc.) to dismiss the modal without submitting.
     */
    onCancel?: () => void;
    /** Custom Cancel button label. */
    cancelLabel?: string;
}

export declare const NiceKanbanBoard: default_2.ForwardRefExoticComponent<NiceKanbanBoardProps & default_2.RefAttributes<HTMLDivElement>>;

/** Props for the {@link NiceKanbanBoard} component � a drag-and-drop kanban board with columns, WIP limits, and custom card rendering. */
export declare interface NiceKanbanBoardProps extends NiceBaseProps, TracelessStorageProps {
    /** Column definitions. */
    columns: NiceKanbanColumn[];
    /** Card data. */
    cards: NiceKanbanCard[];
    /** Called when a card is moved to a different column or reordered. */
    onCardMove?: (cardKey: string | number, targetColumn: string | number, targetIndex: number) => void;
    /** Called when a card is clicked. */
    onCardClick?: (card: NiceKanbanCard) => void;
    /** Custom card renderer. */
    renderCard?: (card: NiceKanbanCard) => default_2.ReactNode;
    /** Allow adding new cards (shows "+" button per column). */
    onAddCard?: (columnKey: string | number) => void;
    /** Disable all interaction. */
    disabled?: boolean;
    /** Size preset. */
    size?: NiceSize;
    /** Allow columns to be collapsed */
    collapsible?: boolean;
    /** Layout mode — `scroll` (default, horizontal scroll when overflowing) or `responsive` (columns wrap to fit container width). */
    layoutMode?: NiceKanbanLayoutMode;
    /** View mode (default, compact, detailed) */
    viewMode?: NiceKanbanViewMode;
    /** Callback when view mode changes */
    onViewModeChange?: (mode: NiceKanbanViewMode) => void;
    /** Initial collapsed columns (controlled) */
    collapsedColumns?: (string | number)[];
    /** Callback when collapsed columns change */
    onCollapsedColumnsChange?: (keys: (string | number)[]) => void;
    /** Form items for the built-in popup editor. When provided clicking a card opens a NiceForm modal. */
    formItems?: NiceFormItem[];
    /** Number of columns for the popup form. Defaults to 1. */
    formColumns?: number;
    /** Escape-hatch: extra props forwarded to the underlying `NiceForm` in the popup (e.g. `labelPosition`, `gap`, `size`, `responsiveColumns`). */
    formProps?: Partial<Omit<NiceFormProps, 'items' | 'data' | 'onFieldChange' | 'columns'>>;
    /** Modal title for editing an existing card. Defaults to "Edit card". */
    editCardTitle?: string;
    /** Modal title for creating a new card. Defaults to "New card". */
    newCardTitle?: string;
    /** Called when an existing card is saved from the popup form. */
    onCardEdit?: (cardKey: string | number, updated: NiceKanbanCard) => void;
    /** Called when a new card is saved from the popup form. */
    onCardCreate?: (newCard: NiceKanbanCard) => void;
    /** Called when the user requests deletion from the popup form. */
    onCardDelete?: (cardKey: string | number) => void;
}

/** A card on the {@link NiceKanbanBoard}. */
export declare interface NiceKanbanCard {
    /** Unique key. */
    key: string | number;
    /** Card title. */
    title: string;
    /** Optional description text. */
    description?: string;
    /** Column key this card belongs to. */
    column: string | number;
    /** Sort order within column. */
    order?: number;
    /** Additional data fields. */
    [extra: string]: unknown;
}

/** A column (swimlane) on the {@link NiceKanbanBoard}. */
export declare interface NiceKanbanColumn {
    /** Unique key. */
    key: string | number;
    /** Column header title. */
    title: string;
    /** Header accent color. */
    color?: string;
    /** Maximum cards allowed in this column. */
    limit?: number;
}

/** Layout mode for the kanban board container.
 * - `scroll`: Columns keep their min/max width and the board scrolls horizontally when they don't fit (default).
 * - `responsive`: Columns wrap onto multiple rows and flex-grow to fill the available width — no horizontal overflow. */
declare type NiceKanbanLayoutMode = 'scroll' | 'responsive';

/** Display mode for kanban cards */
export declare type NiceKanbanViewMode = 'default' | 'compact' | 'detailed';

export declare const NiceList: default_2.FC<NiceListProps>;

/** An item in the {@link NiceList} component. */
declare interface NiceListItem {
    /** Unique key. */
    key: string;
    /** Primary text. */
    text: string;
    /** Leading icon. */
    icon?: default_2.ReactNode;
    /** Disable the item. */
    disabled?: boolean;
    /** Trailing badge content. */
    badge?: default_2.ReactNode;
    /** Additional data fields (index signature). */
    [key: string]: unknown;
}

/** Props for the {@link NiceList} component — a versatile list with selection, grouping, search, reorder, and swipe actions. */
export declare interface NiceListProps extends NiceBaseProps {
    /** List items. */
    items: NiceListItem[];
    /** Currently selected keys (controlled). */
    selectedKeys?: string[];
    /** Called when the selection changes. */
    onSelectionChange?: (keys: string[]) => void;
    /** Selection behavior. */
    selectionMode?: 'none' | 'single' | 'multiple';
    /** Show a search box above the list. */
    searchable?: boolean;
    /** Placeholder for the search box. */
    searchPlaceholder?: string;
    /** Enable grouping. */
    grouped?: boolean;
    /** Field used for grouping items. */
    groupField?: string;
    /** Allow drag-to-reorder. */
    reorderable?: boolean;
    /** Called after an item is reordered. */
    onReorder?: (fromIndex: number, toIndex: number) => void;
    /** Called when an item is clicked. */
    onItemClick?: (item: NiceListItem) => void;
    /** Custom item renderer. */
    renderItem?: (item: NiceListItem) => default_2.ReactNode;
    /** Show checkboxes beside items. */
    showCheckboxes?: boolean;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when items is empty. */
    emptyText?: string;
    /** Size preset. */
    size?: NiceSize;
    /** Show border around the list. */
    bordered?: boolean;
    /** Swipe actions revealed on mobile swipe gesture. */
    swipeActions?: {
        key: string;
        label: string;
        color?: string;
        onClick: (item: NiceListItem) => void;
    }[];
}

/**
 * NiceModuleGrid — Enterprise data grid for OmniVerk ERP modules.
 *
 * - JSON schema column configuration for 527+ entities
 * - Virtual scrolling for 100K+ rows
 * - Server-side pagination, sorting, filtering
 * - Mobile responsive card view
 * - Export to CSV/Excel/PDF
 * - Inline editing with validation
 * - Row grouping and aggregates
 * - Column reorder, resize, pinning
 * - Multi-select with checkbox
 * - Context menu with permissions
 * - View preferences persistence
 * - Dark mode, RTL, WCAG 2.1 AA
 *
 * @example Basic usage
 * ```tsx
 * <NiceModuleGrid
 *   columns={moduleColumns}
 *   data={moduleData}
 *   keyField="id"
 *   selectionMode="checkbox"
 *   onRowClick={(row) => navigate(`/module/${row.id}`)}
 * />
 * ```
 *
 * @example Server-side mode
 * ```tsx
 * <NiceModuleGrid
 *   columns={columns}
 *   onFetch={async (query) => {
 *     const res = await api.fetchModuleData(query);
 *     return { data: res.items, total: res.total, page: query.page, pageSize: query.pageSize, hasMore: res.hasMore };
 *   }}
 *   pagination
 *   sortable
 *   filterable
 * />
 * ```
 */
export declare const NiceModuleGrid: <T extends Record<string, any>>(props: NiceModuleGridProps<T> & {
    ref?: ForwardedRef<HTMLDivElement>;
}) => ReturnType<typeof NiceModuleGridInner>;

declare function NiceModuleGridInner<T extends Record<string, any>>(props: NiceModuleGridProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX_2.Element;

/**
 * Props for NiceModuleGrid — enterprise data grid for OmniVerk modules.
 * Supports 527+ entity definitions with JSON schema configuration.
 */
export declare interface NiceModuleGridProps<T extends Record<string, any> = any> extends NiceBaseProps {
    /** Column definitions from JSON schema */
    columns: ModuleGridColumn<T>[];
    /** Static data array (for client-side mode) */
    data?: T[];
    /** Key field for row identification */
    keyField?: string;
    /** Data source binding for server-side operations */
    dataSource?: NiceDataSource<T>;
    /** Async data fetcher for server-side mode */
    onFetch?: (query: ModuleGridQuery) => Promise<ModuleGridResponse<T>>;
    /** Enable sorting */
    sortable?: boolean;
    /** Current sort specifications */
    sort?: ModuleSortSpec[];
    /** Sort change handler (for server-side) */
    onSortChange?: (sort: ModuleSortSpec[]) => void;
    /** Multi-column sort */
    multiSort?: boolean;
    /** Enable column filtering */
    filterable?: boolean;
    /** Current filter state */
    filter?: ModuleFilterGroup;
    /** Filter change handler */
    onFilterChange?: (filter: ModuleFilterGroup) => void;
    /** Quick search text */
    searchText?: string;
    /** Search change handler */
    onSearchChange?: (text: string) => void;
    /** Search placeholder */
    searchPlaceholder?: string;
    /** Enable pagination */
    pagination?: boolean;
    /** Current page (1-indexed) */
    page?: number;
    /** Page size */
    pageSize?: number;
    /** Available page sizes */
    pageSizeOptions?: number[];
    /** Total row count (for server-side) */
    totalRows?: number;
    /** Page change handler */
    onPageChange?: (page: number, pageSize: number) => void;
    /** Enable virtual scrolling (for 100K+ rows) */
    virtualScroll?: boolean;
    /** Row height for virtual scrolling */
    rowHeight?: number;
    /** Overscan count for virtual scrolling */
    overscan?: number;
    /** Selection mode */
    selectionMode?: ModuleSelectionMode;
    /** Selected row keys */
    selectedKeys?: Set<string>;
    /** Selection change handler */
    onSelectionChange?: (keys: Set<string>, rows: T[]) => void;
    /** Select all with server count */
    selectAllServerCount?: number;
    /** Select all handler for server-side */
    onSelectAll?: () => Promise<Set<string>>;
    /** Enable column reordering */
    columnReorder?: boolean;
    /** Column order change handler */
    onColumnOrderChange?: (order: string[]) => void;
    /** Enable column resizing */
    columnResize?: boolean;
    /** Column width change handler */
    onColumnWidthChange?: (field: string, width: number) => void;
    /** Column visibility change handler */
    onColumnVisibilityChange?: (field: string, visible: boolean) => void;
    /** Group by field */
    groupBy?: string;
    /** Group change handler */
    onGroupByChange?: (field: string | null) => void;
    /** Custom group row renderer */
    groupRowRender?: (group: ModuleGroupedRow<T>) => React.ReactNode;
    /** Expand all groups by default */
    expandAllGroups?: boolean;
    /** Enable inline editing */
    editable?: boolean;
    /** Cell edit handler */
    onCellEdit?: (rowKey: string, field: string, value: unknown, row: T) => Promise<boolean> | boolean;
    /** Row edit handler */
    onRowEdit?: (rowKey: string, values: Partial<T>, row: T) => Promise<boolean> | boolean;
    /** Edit mode: cell or row */
    editMode?: 'cell' | 'row';
    /** Validation error handler */
    onValidationError?: (rowKey: string, field: string, error: string) => void;
    /** Context menu items */
    contextMenuItems?: ModuleContextMenuItem<T>[];
    /** Context menu action handler */
    onContextMenuAction?: (action: string, row: T) => void;
    /** Enable export */
    exportable?: boolean;
    /** Available export formats */
    exportFormats?: ModuleExportFormat[];
    /** Export handler (for server-side) */
    onExport?: (format: ModuleExportFormat, config: ModuleExportConfig) => Promise<void>;
    /** Storage key for preferences persistence */
    preferencesKey?: string;
    /** Initial preferences */
    initialPreferences?: ModuleViewPreferences;
    /** Preferences change handler */
    onPreferencesChange?: (prefs: ModuleViewPreferences) => void;
    /** Display density */
    density?: 'compact' | 'normal' | 'comfortable';
    /** Striped rows */
    striped?: boolean;
    /** Show borders */
    bordered?: boolean;
    /** Hover highlight */
    hoverable?: boolean;
    /** Loading state */
    loading?: boolean;
    /** Empty state configuration */
    emptyState?: ModuleEmptyState;
    /** Custom toolbar */
    toolbar?: React.ReactNode;
    /** Row click handler */
    onRowClick?: (row: T, index: number) => void;
    /** Row double-click handler */
    onRowDoubleClick?: (row: T, index: number) => void;
    /** Custom row class/style */
    rowClassName?: string | ((row: T, index: number) => string);
    rowStyle?: React.CSSProperties | ((row: T, index: number) => React.CSSProperties);
    /** Enable mobile card view */
    mobileCardView?: boolean;
    /** Mobile breakpoint (px) */
    mobileBreakpoint?: number;
    /** Custom mobile card renderer */
    mobileCardRender?: (row: T, index: number) => React.ReactNode;
    /** Primary field for mobile card title */
    mobilePrimaryField?: string;
    /** Secondary field for mobile card subtitle */
    mobileSecondaryField?: string;
    /** Module ID for permissions */
    moduleId?: string;
    /** Module permission for context menu filtering */
    permissions?: Record<string, boolean>;
    /** Component size */
    size?: NiceSize;
    /** Show skeleton loading per column */
    skeletonLoading?: boolean;
    /** Number of skeleton rows */
    skeletonRows?: number;
    /** ARIA label */
    'aria-label'?: string;
    /** ARIA labelledby */
    'aria-labelledby'?: string;
    /** ARIA describedby */
    'aria-describedby'?: string;
    /** Test ID for testing frameworks */
    testId?: string;
}

/** A field definition for the {@link NicePivotGrid} component. */
declare interface NicePivotField {
    /** Data field key. */
    field: string;
    /** Display caption. */
    caption: string;
    /** Pivot area this field belongs to. */
    area?: 'row' | 'column' | 'data' | 'filter';
    /** Aggregation function applied in the data area. */
    summaryType?: 'sum' | 'count' | 'avg' | 'min' | 'max';
    /** Custom value formatter. */
    format?: (value: unknown) => string;
}

export declare const NicePivotGrid: default_2.FC<NicePivotGridProps>;

export declare const NicePivotGridFieldChooser: default_2.FC<NicePivotGridFieldChooserProps>;

/** Props for the {@link NicePivotGridFieldChooser} component — a standalone drag-and-drop field configurator for {@link NicePivotGrid}. */
export declare interface NicePivotGridFieldChooserProps extends NiceBaseProps {
    /** Current field configuration. */
    fields: NicePivotField[];
    /** Called when the user rearranges fields. */
    onChange: (fields: NicePivotField[]) => void;
}

/** Props for the {@link NicePivotGrid} component — a cross-tab / pivot table with drag-and-drop field chooser, CSV export, and drill-through. */
export declare interface NicePivotGridProps extends NiceBaseProps {
    /** Raw data records. */
    data: Record<string, any>[];
    /** Field definitions (row, column, data, filter areas). */
    fields: NicePivotField[];
    /** Called when user rearranges fields. */
    onFieldsChange?: (fields: NicePivotField[]) => void;
    /** Show the field chooser panel. */
    showFieldChooser?: boolean;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when data is empty. */
    emptyText?: string;
    /** Enable CSV export. */
    exportCsv?: boolean;
    /** Filename for CSV export. */
    exportFilename?: string;
    /** Callback when user clicks a cell to drill-through to underlying records. */
    onDrillThrough?: (rowValue: string, colValue: string, records: Record<string, any>[]) => void;
}

/**
 * NiceReconciliationView — Bank reconciliation split-view with drag-drop matching.
 *
 * @example
 * ```tsx
 * <NiceReconciliationView
 *   statements={bankStatements}
 *   entries={bookEntries}
 *   onMatch={handleMatch}
 *   config={{ amountTolerance: 0.01, enableAI: true }}
 * />
 * ```
 */
export declare const NiceReconciliationView: default_2.ForwardRefExoticComponent<NiceReconciliationViewProps & default_2.RefAttributes<ReconciliationViewRef>>;

/**
 * Props for NiceReconciliationView component.
 */
export declare interface NiceReconciliationViewProps extends NiceBaseProps {
    /** Bank statement items */
    statements?: BankStatementItem[];
    /** Alias for `statements`. */
    bankTransactions?: BankStatementItem[];
    /** Book entries from ledger */
    entries?: BookEntry[];
    /** Alias for `entries`. */
    accountingEntries?: BookEntry[];
    /** Existing matches (controlled) */
    matches?: ReconciliationMatch[];
    /** Initial matches (uncontrolled) */
    defaultMatches?: ReconciliationMatch[];
    /** AI suggestions */
    suggestions?: AISuggestion[];
    /** Reconciliation config */
    config?: ReconciliationConfig;
    /** Currency code (alias placed on top-level for convenience). */
    currency?: string;
    /** Show AI confidence column. */
    showConfidence?: boolean;
    /** Statement panel config */
    statementPanelConfig?: PanelConfig;
    /** Entry panel config */
    entryPanelConfig?: PanelConfig;
    /** Called when items are matched */
    onMatch?: OnMatchCallback | ((statementId: string, entryId: string) => void);
    /** Auto-match all using a minimum confidence threshold. */
    onAutoMatch?: (minConfidence: number) => void;
    /** Called when match is removed */
    onUnmatch?: OnUnmatchCallback;
    /** Called for batch actions */
    onBatchAction?: OnBatchActionCallback;
    /** Called when filter changes */
    onFilterChange?: OnFilterChangeCallback;
    /** Called to request AI suggestions */
    onRequestSuggestions?: OnRequestSuggestionsCallback;
    /** Called when selection changes */
    onSelectionChange?: (statementIds: string[], entryIds: string[]) => void;
    /** Called when reconciliation is complete */
    onComplete?: (summary: ReconciliationSummary) => void;
    /** Component size */
    size?: NiceSize;
    /** Show toolbar */
    showToolbar?: boolean;
    /** Show filter panel */
    showFilters?: boolean;
    /** Show summary footer */
    showSummary?: boolean;
    /** Show AI suggestions panel */
    showSuggestions?: boolean;
    /** Panel layout */
    layout?: 'horizontal' | 'vertical';
    /** Initial panel sizes (percentage) */
    panelSizes?: [number, number];
    /** Resizable panels */
    resizable?: boolean;
    /** Collapsible panels */
    collapsible?: boolean;
    /** Enable drag-and-drop */
    enableDragDrop?: boolean;
    /** Enable keyboard shortcuts */
    enableKeyboard?: boolean;
    /** Enable detail panel on double-click (side-by-side view) */
    enableDetailPanel?: boolean;
    /** Loading state */
    loading?: boolean;
    /** Disabled state */
    disabled?: boolean;
    /** Read-only mode */
    readOnly?: boolean;
    /** Locale for number/date formatting */
    locale?: string;
    /** Custom labels */
    labels?: ReconciliationLabels;
    /** Additional class name */
    className?: string;
    /** Inline styles */
    style?: React.CSSProperties;
}

declare interface NiceSavedQuery {
    id: string;
    name: string;
    description?: string;
    icon?: string;
    color?: string;
    filter: NiceFilterState;
    columns?: NiceColumnState[];
    sort?: NiceSortState;
    groupBy?: string;
    isDefault?: boolean;
    isPinned?: boolean;
    isShared?: boolean;
    sharedWith?: string[];
    createdBy: string;
    createdAt: string;
    updatedAt: string;
}

declare type NiceSavedQueryCreate = Pick<NiceSavedQuery, 'name' | 'description' | 'icon' | 'color' | 'filter' | 'columns' | 'sort' | 'isDefault'>;

export declare const NiceSavedQueryPanel: default_2.FC<NiceSavedQueryPanelProps>;

export declare interface NiceSavedQueryPanelProps extends NiceBaseProps {
    queries: NiceSavedQuery[];
    currentFilter?: NiceFilterState;
    currentColumns?: NiceColumnState[];
    currentSort?: NiceSortState;
    onLoad: (query: NiceSavedQuery) => void;
    onSave: (query: NiceSavedQueryCreate) => Promise<NiceSavedQuery>;
    onUpdate: (id: string, query: NiceSavedQueryUpdate) => Promise<void>;
    onDelete: (id: string) => Promise<void>;
    onShare?: (id: string, shareWith: string[]) => Promise<void>;
    onSetDefault?: (id: string) => Promise<void>;
    allowSharing?: boolean;
    allowPinning?: boolean;
    position?: 'dropdown' | 'sidebar' | 'modal';
}

declare type NiceSavedQueryUpdate = Partial<NiceSavedQueryCreate>;

declare interface NiceSortState {
    field: string;
    direction: 'asc' | 'desc';
}

export declare const NiceSpreadsheet: ForwardRefExoticComponent<NiceSpreadsheetProps & RefAttributes<HTMLDivElement>>;

/** A single cell in a {@link NiceSpreadsheetSheet}. */
export declare interface NiceSpreadsheetCell {
    /** Display / raw value. */
    value: NiceSpreadsheetCellValue;
    /** Excel-style formula (e.g. "=SUM(A1:A5)"). */
    formula?: string;
    /** Value formatting hint. */
    format?: 'text' | 'number' | 'percent' | 'currency' | 'date';
    /** Bold text. */
    bold?: boolean;
    /** Italic text. */
    italic?: boolean;
    /** Horizontal alignment. */
    align?: 'left' | 'center' | 'right';
    /** Cell background color. */
    bgColor?: string;
    /** Text color. */
    color?: string;
    /** Prevent editing of this cell. */
    readOnly?: boolean;
    /** Comment / note for this cell. */
    comment?: string;
    /** Merge span � how many columns this cell covers. */
    colSpan?: number;
    /** Merge span � how many rows this cell covers. */
    rowSpan?: number;
    /** Whether this cell is hidden by a merge (covered by another cell). */
    mergedInto?: string;
}

/** Primitive cell value type in the {@link NiceSpreadsheet}. */
declare type NiceSpreadsheetCellValue = string | number | boolean | null;

/** Props for the {@link NiceSpreadsheet} component � an Excel-like spreadsheet with formulas, multi-sheet tabs, toolbar, and frozen panes. */
export declare interface NiceSpreadsheetProps extends NiceBaseProps {
    /** Sheet data (controlled). */
    sheets?: NiceSpreadsheetSheet[];
    /** Index of the active sheet. */
    activeSheet?: number;
    /** Default number of rows. */
    rows?: number;
    /** Default number of columns. */
    cols?: number;
    /** Show formatting toolbar. */
    showToolbar?: boolean;
    /** Show the formula bar. */
    showFormulaBar?: boolean;
    /** Show sheet tabs at the bottom. */
    showSheetTabs?: boolean;
    /** Make the entire spreadsheet read-only. */
    readOnly?: boolean;
    /** Called when any cell data changes. */
    onChange?: (sheets: NiceSpreadsheetSheet[]) => void;
    /** Called when the active sheet tab changes. */
    onActiveSheetChange?: (index: number) => void;
    /** Called when a cell is selected. */
    onCellSelect?: (sheet: number, row: number, col: number) => void;
    /** Called when cells are copied. Return false to prevent default clipboard handling. */
    onCopy?: (range: {
        startRow: number;
        startCol: number;
        endRow: number;
        endCol: number;
    }) => boolean | void;
    /** Called when cells are pasted. */
    onPaste?: (data: string[][], row: number, col: number) => boolean | void;
    /** Called when a column or row is inserted. */
    onInsert?: (type: 'row' | 'column', index: number) => void;
    /** Called when a column or row is deleted. */
    onRemove?: (type: 'row' | 'column', index: number) => void;
    /** Maximum undo history size. */
    maxUndo?: number;
    /** Enable column sorting. */
    sortable?: boolean;
    /** Enable column filtering. */
    filterable?: boolean;
    /** Enable cell range selection. */
    rangeSelection?: boolean;
}

/** A worksheet tab in the {@link NiceSpreadsheet}. */
declare interface NiceSpreadsheetSheet {
    /** Tab name. */
    name: string;
    /** Cell map keyed by address (e.g. "A1", "B3"). */
    data: Record<string, NiceSpreadsheetCell>;
    /** Column width overrides (0-based index ? px). */
    colWidths?: Record<number, number>;
    /** Row height overrides (0-based index ? px). */
    rowHeights?: Record<number, number>;
    /** Number of top rows frozen. */
    frozenRows?: number;
    /** Number of left columns frozen. */
    frozenCols?: number;
    /** Active sort column index. */
    sortColumn?: number;
    /** Sort direction. */
    sortDirection?: 'asc' | 'desc';
    /** Conditional formatting rules. */
    conditionalFormats?: NiceConditionalFormatRule[];
    /** Column filter values. */
    columnFilters?: Record<number, string>;
}

export declare function NiceTable<T extends Record<string, any>>({ columns, data, striped, compact, emptyText, className, style, accessMode, id, displayStyle, }: NiceTableProps<T>): JSX_2.Element | null;

/** Column definition for the {@link NiceTable} component. */
declare interface NiceTableColumn<T = any> {
    /** Data field key. */
    field: string;
    /** Column header text. */
    header: string;
    /** Custom cell renderer. */
    render?: (value: any, row: T) => default_2.ReactNode;
    /** Text alignment. */
    align?: 'left' | 'center' | 'right';
    /** Enable sorting for this column. */
    sortable?: boolean;
    /** Column width (px or CSS string). */
    width?: string | number;
}

/** Props for the {@link NiceTable} component — a simple read-only HTML table with optional striping and sorting. */
export declare interface NiceTableProps<T extends Record<string, any> = any> extends NiceBaseProps {
    /** Column definitions. */
    columns: NiceTableColumn<T>[];
    /** Row data. */
    data: T[];
    /** Alternate row coloring. */
    striped?: boolean;
    /** Reduced padding. */
    compact?: boolean;
    /** Text shown when `data` is empty. */
    emptyText?: string;
}

export declare function NiceTileView<T extends NiceTileViewItem>({ items, tileWidth, tileHeight, direction, renderTile, onTileClick, loading, emptyText, className, style, }: NiceTileViewProps<T>): JSX_2.Element;

/** A tile item displayed by the {@link NiceTileView} component. */
declare interface NiceTileViewItem {
    /** Unique key. */
    key: string;
    /** Primary text. */
    text?: string;
    /** Image URL. */
    image?: string;
    /** Additional data fields. */
    [field: string]: any;
}

/** Props for the {@link NiceTileView} component — a scrollable tile strip (horizontal or vertical). */
export declare interface NiceTileViewProps<T extends NiceTileViewItem = NiceTileViewItem> extends NiceBaseProps {
    /** Tile items. */
    items: T[];
    /** Fixed tile width in px. */
    tileWidth?: number;
    /** Fixed tile height in px. */
    tileHeight?: number;
    /** Scroll direction. */
    direction?: 'horizontal' | 'vertical';
    /** Custom tile renderer. */
    renderTile?: (item: T) => default_2.ReactNode;
    /** Called when a tile is clicked. */
    onTileClick?: (item: T) => void;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when items is empty. */
    emptyText?: string;
}

/** A context-menu action for {@link NiceTreeView} nodes. */
declare interface NiceTreeContextMenuItem {
    /** Unique key. */
    key: string;
    /** Menu label. */
    label: string;
    /** Optional icon. */
    icon?: default_2.ReactNode;
    /** Disable the action. */
    disabled?: boolean;
}

export declare function NiceTreeGrid<T extends NiceTreeGridNode>({ columns, data, keyField, parentKeyField, nested, childrenField, expandedKeys: controlledExpanded, onExpandedChange, defaultExpandAll, sortable, sortField: controlledSortField, sortDirection: controlledSortDir, onSort, selectable, selectedKeys: controlledSelected, onSelectionChange, searchable, searchPlaceholder, striped, compact, loading, emptyText, toolbar, onRowClick, className, style, }: NiceTreeGridProps<T>): JSX_2.Element;

/** A row node in the {@link NiceTreeGrid} (supports index-signature for dynamic fields). */
export declare interface NiceTreeGridNode {
    [field: string]: unknown;
}

/** Props for the {@link NiceTreeGrid} component — a hierarchical data grid with sorting, selection, search, and NiceDataGrid column features. */
export declare interface NiceTreeGridProps<T extends NiceTreeGridNode = NiceTreeGridNode> extends NiceBaseProps {
    /** Column definitions (reuses NiceDataGridColumn). */
    columns: NiceDataGridColumn<T>[];
    /** Row data. */
    data: T[];
    /** Field used as unique key. */
    keyField?: string;
    /** Field pointing to parent key (flat data). */
    parentKeyField?: string;
    /** When true, data is already nested in `childrenField`. */
    nested?: boolean;
    /** Field containing nested children array (default "children"). */
    childrenField?: string;
    /** Currently expanded keys. */
    expandedKeys?: string[];
    /** Called when expanded keys change. */
    onExpandedChange?: (keys: string[]) => void;
    /** Expand all nodes by default. */
    defaultExpandAll?: boolean;
    /** Enable sorting. */
    sortable?: boolean;
    /** Currently sorted field. */
    sortField?: string;
    /** Sort direction. */
    sortDirection?: SortDirection;
    /** Called when sort changes. */
    onSort?: (field: string, direction: SortDirection) => void;
    /** Enable row selection. */
    selectable?: boolean;
    /** Currently selected keys. */
    selectedKeys?: Set<string>;
    /** Called when selection changes. */
    onSelectionChange?: (keys: Set<string>) => void;
    /** Show a search box. */
    searchable?: boolean;
    /** Search input placeholder. */
    searchPlaceholder?: string;
    /** Alternate row coloring. */
    striped?: boolean;
    /** Reduced padding. */
    compact?: boolean;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when data is empty. */
    emptyText?: string;
    /** Toolbar content rendered above the grid. */
    toolbar?: default_2.ReactNode;
    /** Called when a row is clicked. */
    onRowClick?: (row: T) => void;
}

export declare function NiceTreeList<T extends NiceTreeListNode>({ columns, data, keyField, parentKeyField, expandedKeys: controlledExpanded, onExpandedChange, selectedKeys, onSelectionChange, selectable, loading, emptyText, className, style, accessMode, id, }: NiceTreeListProps<T>): JSX_2.Element | null;

/** A tree-list node for the {@link NiceTreeList} component. */
declare interface NiceTreeListNode {
    /** Unique key. */
    key: string;
    /** Reference to parent node (flat data). */
    parentKey?: string | null;
    /** Nested children (pre-structured data). */
    children?: NiceTreeListNode[];
    /** Additional data fields. */
    [field: string]: any;
}

/** Props for the {@link NiceTreeList} component — a tree-structured data grid with expandable parent rows and NiceDataGrid columns. */
export declare interface NiceTreeListProps<T extends NiceTreeListNode = NiceTreeListNode> extends NiceBaseProps {
    /** Column definitions (reuses NiceDataGridColumn). */
    columns: NiceDataGridColumn<T>[];
    /** Row data (flat or nested). */
    data: T[];
    /** Field used as the unique key. */
    keyField?: string;
    /** Field pointing to parent key (flat data mode). */
    parentKeyField?: string;
    /** Currently expanded node keys. */
    expandedKeys?: string[];
    /** Called when expanded keys change. */
    onExpandedChange?: (keys: string[]) => void;
    /** Currently selected keys. */
    selectedKeys?: string[];
    /** Called when selection changes. */
    onSelectionChange?: (keys: string[]) => void;
    /** Enable row selection. */
    selectable?: boolean;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Text shown when data is empty. */
    emptyText?: string;
}

/** A node in the {@link NiceTreeView} hierarchy. */
declare interface NiceTreeNode {
    /** Unique key. */
    key: string;
    /** Display text. */
    text: string;
    /** Leading icon. */
    icon?: default_2.ReactNode;
    /** Child nodes. */
    children?: NiceTreeNode[];
    /** Disable the node. */
    disabled?: boolean;
    /** Default expanded state. */
    expanded?: boolean;
    /** If true, children are loaded lazily via onLoadChildren. */
    leaf?: boolean;
    /** Additional data fields. */
    [key: string]: any;
}

export declare const NiceTreeView: default_2.FC<NiceTreeViewProps>;

/** Props for the {@link NiceTreeView} component — a hierarchical tree with selection, drag-drop, lazy loading, inline editing, and context menu. */
export declare interface NiceTreeViewProps extends NiceBaseProps {
    /** Root nodes. */
    nodes: NiceTreeNode[];
    /** Currently selected node keys. */
    selectedKeys?: string[];
    /** Currently expanded node keys. */
    expandedKeys?: string[];
    /** Called when selection changes. */
    onSelectionChange?: (keys: string[]) => void;
    /** Called when expanded keys change. */
    onExpandedChange?: (keys: string[]) => void;
    /** Selection behavior. */
    selectionMode?: 'none' | 'single' | 'multiple';
    /** Show checkboxes beside nodes. */
    showCheckboxes?: boolean;
    /** Show a search box above the tree. */
    searchable?: boolean;
    /** Search input placeholder. */
    searchPlaceholder?: string;
    /** Called when a node is clicked. */
    onNodeClick?: (node: NiceTreeNode) => void;
    /** Custom node renderer. */
    renderNode?: (node: NiceTreeNode) => default_2.ReactNode;
    /** Show tree guide lines. */
    showLines?: boolean;
    /** Show a loading skeleton. */
    loading?: boolean;
    /** Drag-and-drop reordering. */
    draggable?: boolean;
    /** Called after a node is dropped. */
    onNodeDrop?: (dragKey: string, dropKey: string, position: 'before' | 'inside' | 'after') => void;
    /** Lazy loading: called when expanding a node with no children and leaf !== true. */
    onLoadChildren?: (node: NiceTreeNode) => Promise<NiceTreeNode[]>;
    /** Context menu items shown on right-click. */
    contextMenuItems?: NiceTreeContextMenuItem[];
    /** Called when a context-menu action is selected. */
    onContextMenuAction?: (action: string, node: NiceTreeNode) => void;
    /** Enable inline editing on double-click. */
    editable?: boolean;
    /** Called when a node label is edited. */
    onNodeEdit?: (key: string, newText: string) => void;
}

/**
 * Callback for batch operations.
 */
export declare type OnBatchActionCallback = (action: 'autoMatch' | 'approveAll' | 'clearAll' | 'exportMatched', matches: ReconciliationMatch[]) => void | Promise<void>;

/**
 * Callback when filter changes.
 */
export declare type OnFilterChangeCallback = (filter: ReconciliationFilter) => void;

/**
 * Callback when items are matched.
 */
export declare type OnMatchCallback = (match: ReconciliationMatch, statements: BankStatementItem[], entries: BookEntry[]) => void | Promise<void>;

/**
 * Callback for AI suggestions request.
 */
export declare type OnRequestSuggestionsCallback = (statementIds: string[]) => Promise<AISuggestion[]>;

/**
 * Callback when match is removed.
 */
export declare type OnUnmatchCallback = (matchId: string, statementIds: string[], entryIds: string[]) => void | Promise<void>;

/**
 * Panel customization.
 */
export declare interface PanelConfig {
    /** Panel title */
    title?: string;
    /** Show totals footer */
    showTotals?: boolean;
    /** Visible columns */
    columns?: string[];
    /** Allow sorting */
    sortable?: boolean;
    /** Allow filtering */
    filterable?: boolean;
    /** Row height */
    rowHeight?: number;
    /** Custom row renderer */
    renderRow?: (item: BankStatementItem | BookEntry, context: RowContext) => ReactNode;
    /** Custom header */
    renderHeader?: () => ReactNode;
    /** Empty state message */
    emptyMessage?: string;
}

/** Quick filter chip definition. */
declare interface QuickFilter<T = any> {
    key: string;
    label: string;
    icon?: React.ReactNode;
    filter: (row: T) => boolean;
    color?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'secondary';
}

/**
 * Reconciliation view configuration.
 */
export declare interface ReconciliationConfig {
    /** Amount tolerance for matching (absolute value) */
    amountTolerance?: number;
    /** Amount tolerance as percentage (0-100) */
    amountTolerancePercent?: number;
    /** Date tolerance in days */
    dateTolerance?: number;
    /** Allow N:M matching */
    allowMultiMatch?: boolean;
    /** Allow partial matches */
    allowPartialMatch?: boolean;
    /** Enable AI suggestions */
    enableAI?: boolean;
    /** AI confidence threshold for auto-match */
    aiAutoMatchThreshold?: number;
    /** Currency for display */
    currency?: string;
    /** Locale for formatting */
    locale?: string;
    /** Matching rules */
    rules?: MatchingRule[];
}

/**
 * Filter configuration for reconciliation view.
 */
export declare interface ReconciliationFilter {
    /** Date range start */
    dateFrom?: Date | string;
    /** Date range end */
    dateTo?: Date | string;
    /** Status filter */
    status?: ReconciliationStatus[];
    /** Amount range min */
    amountMin?: number;
    /** Amount range max */
    amountMax?: number;
    /** Search text */
    searchText?: string;
    /** Show only AI suggestions */
    onlyWithSuggestions?: boolean;
    /** Minimum AI confidence */
    minConfidence?: number;
}

/**
 * Custom labels for localization.
 */
export declare interface ReconciliationLabels {
    statementPanelTitle?: string;
    entryPanelTitle?: string;
    matched?: string;
    partial?: string;
    unmatched?: string;
    excluded?: string;
    autoMatch?: string;
    clearAll?: string;
    approveAll?: string;
    exportMatched?: string;
    noStatements?: string;
    noEntries?: string;
    noMatches?: string;
    aiSuggestions?: string;
    applySuggestion?: string;
    ignoreSuggestion?: string;
    confidence?: string;
    difference?: string;
    summary?: string;
    total?: string;
    matchedAmount?: string;
    unmatchedAmount?: string;
    statementDetails?: string;
    entryDetails?: string;
    transactionInfo?: string;
    entryInfo?: string;
    matchedWith?: string;
    matchedByAI?: string;
    matchedManually?: string;
    statementTotal?: string;
    entryTotal?: string;
    date?: string;
    description?: string;
    amount?: string;
    counterparty?: string;
    accountNumber?: string;
    party?: string;
    documentRef?: string;
    reference?: string;
    matchedEntries?: string;
    matchedStatements?: string;
}

/**
 * A match between bank statement and book entries.
 * Supports 1:1, 1:N, N:1, N:M matching.
 */
export declare interface ReconciliationMatch {
    /** Unique match ID */
    id: string;
    /** Bank statement item IDs */
    statementIds: string[];
    /** Book entry IDs */
    entryIds: string[];
    /** Match status */
    status: ReconciliationStatus;
    /** Total statement amount */
    statementTotal: number;
    /** Total book amount */
    entryTotal: number;
    /** Difference */
    difference: number;
    /** AI confidence score (0-100) */
    confidence: number;
    /** Match reason / explanation */
    reason?: string;
    /** Matched by user or auto */
    matchedBy: 'user' | 'auto' | 'ai';
    /** Timestamp */
    matchedAt: Date | string;
    /** Notes / comments */
    notes?: string;
}

/**
 * Reconciliation match status.
 */
export declare type ReconciliationStatus = 'matched' | 'partial' | 'unmatched' | 'excluded' | 'suggested';

/**
 * Reconciliation summary statistics.
 */
export declare interface ReconciliationSummary {
    /** Total statement items */
    totalStatements: number;
    /** Total book entries */
    totalEntries: number;
    /** Matched statement items */
    matchedStatements: number;
    /** Matched book entries */
    matchedEntries: number;
    /** Unmatched statement items */
    unmatchedStatements: number;
    /** Unmatched book entries */
    unmatchedEntries: number;
    /** Total statement amount */
    statementTotal: number;
    /** Total entry amount */
    entryTotal: number;
    /** Matched amount */
    matchedAmount: number;
    /** Unmatched statement amount */
    unmatchedStatementAmount: number;
    /** Unmatched entry amount */
    unmatchedEntryAmount: number;
    /** Difference */
    difference: number;
    /** Match percentage */
    matchPercentage: number;
    /** Number of matches */
    matchCount: number;
    /** Partial matches */
    partialMatchCount: number;
    /** AI suggestions pending */
    pendingSuggestions: number;
}

/**
 * Imperative handle for NiceReconciliationView.
 */
export declare interface ReconciliationViewRef {
    /** Get current matches */
    getMatches(): ReconciliationMatch[];
    /** Get unmatched statement items */
    getUnmatchedStatements(): BankStatementItem[];
    /** Get unmatched book entries */
    getUnmatchedEntries(): BookEntry[];
    /** Create a match programmatically */
    createMatch(statementIds: string[], entryIds: string[]): ReconciliationMatch | null;
    /** Remove a match */
    removeMatch(matchId: string): void;
    /** Run auto-matching */
    autoMatch(): Promise<ReconciliationMatch[]>;
    /** Request AI suggestions */
    getSuggestions(statementIds?: string[]): Promise<AISuggestion[]>;
    /** Apply AI suggestion */
    applySuggestion(suggestion: AISuggestion): ReconciliationMatch | null;
    /** Approve all matched items */
    approveAll(): void;
    /** Clear all matches */
    clearAll(): void;
    /** Export matched data */
    exportMatched(format: 'csv' | 'json' | 'xlsx'): void;
    /** Get reconciliation summary */
    getSummary(): ReconciliationSummary;
    /** Reset view state */
    reset(): void;
    /** Focus statement panel */
    focusStatements(): void;
    /** Focus entries panel */
    focusEntries(): void;
}

/**
 * Row render context.
 */
export declare interface RowContext {
    /** Is row selected */
    isSelected: boolean;
    /** Is row being dragged */
    isDragging: boolean;
    /** Is row a drop target */
    isDropTarget: boolean;
    /** Match suggestion if any */
    suggestion?: AISuggestion;
    /** Status */
    status: ReconciliationStatus;
    /** Index */
    index: number;
}

/** Sort direction for grid columns (`null` = unsorted). */
declare type SortDirection = 'asc' | 'desc' | null;

/**
 * Factor contributing to AI suggestion.
 */
export declare interface SuggestionFactor {
    /** Factor name */
    name: string;
    /** Contribution weight */
    weight: number;
    /** Matched values */
    statementValue?: string;
    entryValue?: string;
}

/**
 * Standard props that can be added to any component to support Traceless policy.
 */
declare interface TracelessStorageProps {
    /** Whether this component may use cookies */
    cookies?: boolean;
    /** Whether this component may use localStorage */
    localStorage?: boolean;
    /** Whether this component may use sessionStorage */
    sessionStorage?: boolean;
    /** Override storage mode for this component */
    storageMode?: TracelessMode;
    /** Storage key for persisting component state */
    storageKey?: string;
}

export { }
