import type { ViewerOption } from './viewers/types';
export interface CellData {
    value?: any;
    text?: string;
    style?: CellStyle;
    merge?: [number, number];
    editable?: boolean;
    [key: string]: any;
}
export interface CellStyle {
    bgcolor?: string;
    align?: 'left' | 'center' | 'right';
    valign?: 'top' | 'middle' | 'bottom';
    textwrap?: boolean;
    underline?: boolean;
    color?: string;
    bold?: boolean;
    italic?: boolean;
    strike?: boolean;
    font?: {
        name?: string;
        size?: number;
    };
    border?: {
        top?: string[];
        bottom?: string[];
        left?: string[];
        right?: string[];
    };
    [key: string]: any;
}
export interface RowData {
    cells: {
        [key: number]: CellData;
    };
    height?: number;
    [key: string]: any;
}
export interface ColData {
    width?: number;
    [key: string]: any;
}
export interface DataGridOptions {
    rows?: {
        [key: number]: RowData;
    };
    cols?: {
        [key: number]: ColData;
    };
    merges?: string[];
    freeze?: string;
    styles?: CellStyle[];
    validations?: any[];
    autofilter?: any;
    /** 自定义 StyleManager Token 覆盖（如字体族），由宿主应用通过 DataGridInitOptions.customTokens 传入 */
    customTokens?: Record<string, any>;
    [key: string]: any;
}
export interface Position {
    x: number;
    y: number;
}
export interface Size {
    width: number;
    height: number;
}
export interface Rect extends Position, Size {
}
export interface Range {
    sri: number;
    sci: number;
    eri: number;
    eci: number;
}
export interface CellRange {
    row: number;
    col: number;
    rowspan?: number;
    colspan?: number;
}
export interface HistoryItem {
    type: string;
    data: any;
}
export interface ValidatorRule {
    type?: 'list' | 'number' | 'date' | 'phone' | 'email';
    required?: boolean;
    pattern?: string | RegExp;
    min?: number;
    max?: number;
    options?: string[];
    immediate?: boolean;
    [key: string]: any;
}
/**
 * All supported column types, including built-in types and registered viewer types.
 * Custom viewer types can be registered via ViewerRegistry.register().
 */
export type ColumnType = 'text' | 'number' | 'select' | 'date' | 'datetime' | 'month' | 'time' | 'image' | 'nested' | 'nested-child' | 'person' | 'progress' | 'boolean' | 'checkbox' | 'status' | 'group-header' | 'group-name' | 'separator-row' | 'punch' | 'hyperlink' | 'file' | 'task-node' | 'module' | 'text-with-switcher' | 'upstream' | 'table-action-button' | (string & Record<string, never>);
export interface ColumnConfig {
    title: string;
    key: string;
    label?: string;
    size?: 'mini' | 'small' | 'medium' | 'large';
    fixed?: 'left' | 'right' | '';
    fixedLeft?: boolean;
    fixedRight?: boolean;
    readonly?: boolean;
    align?: 'left' | 'center' | 'right';
    baseline?: 'top' | 'middle' | 'bottom';
    type?: ColumnType;
    options?: ViewerOption[];
    render?: (value: any) => string;
    rule?: ValidatorRule;
    children?: ColumnConfig[];
    level?: number;
    rowspan?: number;
    colspan?: number;
    index?: number;
    width?: number;
    minWidth?: number;
    maxWidth?: number | 'unset';
    originWidth?: number;
    parentKey?: string;
    nestedKey?: string;
    nestedChildOffset?: number;
    color?: string;
    sortDisabled?: boolean;
    /** Whether to show the filter icon on hover. When explicitly false, filter icon is suppressed (sort icons preserved). Default: true */
    showFilterIcon?: boolean;
    /** 筛选命中该列时为 true：筛选图标常驻显示且显示激活色 */
    filterIconActive?: boolean;
    /**
     * 是否接受外部 OS 文件 drop（从浏览器外拖文件到本列的 cell）。
     * - 默认 undefined：由 DataGrid 内部判断 column.type === 'image' | 'file' 决定。
     * - 显式 false：完全禁用该列的外部 drop（即便列类型是 image/file 也不响应）。
     * - 显式 true：与 image/file 类型守卫一致，由业务层（columnAdapter）显式开启。
     */
    acceptExternalFileDrop?: boolean;
    [key: string]: any;
}
export interface SelectorState {
    show: boolean;
    isSelected: boolean;
    xArr: [number, number];
    yArr: [number, number];
}
export interface EditorState {
    show: boolean;
    xIndex: number;
    yIndex: number;
}
export interface AutofillState {
    enable: boolean;
    xIndex: number;
    yIndex: number;
    xArr: [number, number];
    yArr: [number, number];
}
export interface RangeState {
    minX: number;
    minY: number;
    maxY: number;
    maxX?: number;
}
export interface DrawOptions {
    borderColor?: string;
    borderWidth?: number;
    fillColor?: string;
    shadowBlur?: number;
    shadowColor?: string;
    shadowOffsetX?: number;
    shadowOffsetY?: number;
    lineDash?: number[];
    lineCap?: CanvasLineCap;
    lineJoin?: CanvasLineJoin;
}
export interface TextOptions {
    font?: string;
    color?: string;
    align?: 'left' | 'center' | 'right';
    baseLine?: 'top' | 'middle' | 'bottom';
    icon?: HTMLImageElement | null;
    iconWidth?: number;
    iconHeight?: number;
    iconOffsetX?: number;
    iconOffsetY?: number;
}
export interface ClipboardState {
    show: boolean;
    isPaste: boolean;
    xArr: [number, number];
    yArr: [number, number];
}
export interface EventHandlers {
    [key: string]: (e: Event) => void;
}
export type Direction = 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM';
export type ScrollDirection = 'HORIZONTAL' | 'VERTICAL';
/**
 * Group level enumeration for multi-level grouping (max 3 levels)
 * 0 = First level (most prominent)
 * 1 = Second level
 * 2 = Third level
 */
export type GroupLevel = 0 | 1 | 2;
/**
 * Separate row level enumeration
 */
export type SeparateLevel = 0 | 1 | 2;
/**
 * Base interface for all row types in grouped table
 */
export interface BaseGroupedRowData {
    id: string | number;
    [key: string]: any;
}
/**
 * Group header row data
 * Represents a collapsible group header in the table
 */
export interface GroupRowData extends BaseGroupedRowData {
    /** Identifies this row as a group header */
    isGroup: true;
    /** Group name - can be string or array (e.g., list of people) */
    name: string | string[];
    /** Raw group name */
    rawName?: string | string[];
    /** Nesting level of the group (0, 1, or 2) */
    groupLevel: GroupLevel;
    /** Whether the group is expanded */
    expanded: boolean;
    /** Number of items in this group */
    count?: number;
    /** Whether to show the count badge */
    showCount?: boolean;
    /** Whether to show user working hours icon */
    showUserWorkingHours?: boolean;
    /** Whether this group has children */
    hasChildren?: boolean;
    /** Parent group ID */
    parentId?: string | number;
    /** Whether this is a leaf group (no sub-groups) */
    isLeafGroup?: boolean;
    /** Multi-level group name array */
    multiGroupName?: string[];
    /** Multi-level group value array */
    multiValue?: any[];
    /** Group path */
    path?: any[];
    /** Value path */
    valuePath?: any[];
    /** Property name for grouping */
    property?: string;
    /** Group value */
    value?: any;
    /** Custom row height (optional) */
    rowHeight?: number;
    /** Children rows (for nested structure) */
    children?: GroupedTableRowData[];
    /** Separate rows (for nested structure) */
    separate?: SeparateRowData[];
    /** 组头各列的统计数据 */
    aggregations?: FooterData;
    /** 分组名称的 viewer 类型（如 person/dropdown/status 等），不传则使用默认文本渲染 */
    groupNameViewerType?: string;
    /** 分组名称的 viewer 数据，与 groupNameViewerType 配合使用 */
    groupNameViewerData?: any;
    /** 分组校验数据，包含 validation_fields 和 validation_style */
    validation?: {
        validation_fields?: string[];
        validation_style?: Record<string, {
            color: string;
            icon: string;
            image: number;
            content: string;
        }>;
        [key: string]: any;
    };
    /** 组头 checkbox 是否选中 */
    checked?: boolean;
    /** 勾选图标颜色，用于在组头左侧展示状态图标 */
    hook_mark?: 'green' | 'blue';
    /** 图标容器背景色 */
    mark_bg_color?: 'purple';
    /**
     * 组头行是否被快捷搜索命中（searchMatchList 中存在 isGroupHeader: true 且 id 匹配的条目）。
     * 由 rowDataAdapter.preprocessRow 在组头行上注入，供 GroupRow 渲染时查询。
     */
    _groupHeaderSearchMatched?: boolean;
    /**
     * 组头行是否是"当前高亮"命中项（命中条目中存在 highlight: true 的 field）。
     * 当为 true 时 GroupRow 会绘制 2px 橙色 inset 边框。
     */
    _groupHeaderSearchCurrentHighlight?: boolean;
}
/**
 * Separate row data
 * Represents a visual separator between groups
 */
export interface SeparateRowData extends BaseGroupedRowData {
    /** Identifies this row as a separator */
    isSeparateRow: true;
    /** Nesting level of the separator */
    separateLevel: SeparateLevel;
    /** Group level context */
    groupLevel?: GroupLevel;
    /** Whether this is the end level */
    isEndLevel?: boolean;
    /** Row height - typically 12px for separators */
    rowHeight?: number;
    /** Group name context */
    groupName?: {
        multi_group_name: string[];
        multi_value: any[];
    };
    /** Filter match status */
    filterMatched?: boolean;
}
/**
 * Normal data row (not a group header or separator)
 */
export interface NormalRowData extends BaseGroupedRowData {
    /** Identifies this row as NOT a group header */
    isGroup?: false;
    /** Identifies this row as NOT a separator */
    isSeparateRow?: false;
    /** Proxied data object (contains actual row data) */
    proxyedData?: {
        id: string | number;
        name?: string;
        [key: string]: any;
    };
    /** Custom row height (optional) */
    rowHeight?: number;
    /** Parent ID for grouping context */
    parentId?: string | number;
    /** Group name context */
    groupName?: {
        multi_group_name: string[];
        multi_value: any[];
    };
    /** Filter match status */
    filterMatched?: boolean;
    [key: string]: any;
}
/**
 * Union type for all row types in a grouped table
 */
export type GroupedTableRowData = GroupRowData | SeparateRowData | NormalRowData;
/**
 * Type guard to check if a row is a group header
 */
export declare function isGroupRow(row: unknown): row is GroupRowData;
/**
 * Type guard to check if a row is a separator
 */
export declare function isSeparateRow(row: unknown): row is SeparateRowData;
/**
 * Type guard to check if a row is a normal data row
 */
export declare function isNormalRow(row: unknown): row is NormalRowData;
/**
 * Constants for grouped table rendering
 */
export declare const GROUP_TABLE_CONSTANTS: {
    /** Default row height for group headers */
    GROUP_HEADER_HEIGHT: number;
    /** Default row height for separators */
    SEPARATOR_HEIGHT: number;
    /** Default row height for normal rows */
    NORMAL_ROW_HEIGHT: number;
    /** @deprecated Use LEVEL0_WIDTH / LEVEL1_WIDTH instead */
    LEVEL_INDENT: number;
    /** Level 0 color bar width (px) — matches DOM nested div width */
    LEVEL0_WIDTH: number;
    /** Level 1 color bar width (px) — matches DOM nested div width */
    LEVEL1_WIDTH: number;
    /** Arrow icon size (16x16, matching DOM version's i.ah-icon_singlearrowright) */
    ARROW_SIZE: number;
    /** Padding for group header content */
    GROUP_PADDING: number;
    /** 组头 checkbox 尺寸（hover 时显示） */
    GROUP_CHECKBOX_SIZE: number;
};
/**
 * Group row style configuration
 */
export interface GroupRowStyle {
    /** Background color for group level 0 */
    level0BgColor: string;
    /** Background color for group level 1 */
    level1BgColor: string;
    /** Background color for group level 2 */
    level2BgColor: string;
    /** Text color for group headers */
    textColor: string;
    /** Border color for group color bar right edge */
    barBorderColor: string;
    /** Font weight for group headers */
    fontWeight: string;
    /** Font size for group headers */
    fontSize: number;
}
/**
 * Separator row style configuration
 */
export interface SeparatorRowStyle {
    /** Background color for separator level 0 */
    level0BgColor: string;
    /** Background color for separator level 1 */
    level1BgColor: string;
    /** Background color for separator level 2 */
    level2BgColor: string;
}
/**
 * Default styles for grouped table
 * 注意：使用 defaultStyleManager（静态单例，永远绑定 default 主题），
 * 仅作为回退值。运行时应使用 getGroupStyles(grid.styleManager) 获取当前主题色。
 */
export declare const DEFAULT_GROUP_STYLES: GroupRowStyle;
export declare const DEFAULT_SEPARATOR_STYLES: SeparatorRowStyle;
/**
 * 运行时获取分组样式（根据当前主题动态计算）
 * 在 GroupRow / RowHeader / AddTaskRow 中应优先使用此函数
 */
export declare function getGroupStyles(sm: import('./StyleManager').StyleManager): GroupRowStyle;
/**
 * 运行时获取分隔行样式（根据当前主题动态计算）
 */
export declare function getSeparatorStyles(sm: import('./StyleManager').StyleManager): SeparatorRowStyle;
/**
 * 统计选项接口
 */
export interface StatisticOption {
    key: string;
    label: string;
}
/**
 * Footer 单元格数据
 */
export interface FooterCellData {
    /** 统计类型标识 */
    statisticType: string;
    /** 格式化后的显示文本，null 表示无数据 */
    value: string | null;
    /** 是否处于 loading 状态（刷新中），控制旋转动画 */
    loading?: boolean;
}
/**
 * Footer 数据，key 为列的 columnKey
 */
export type FooterData = Record<string, FooterCellData>;
/**
 * 组头单元格点击回调信息
 */
export interface GroupHeaderCellClickInfo {
    /** 列标识 */
    columnKey: string;
    /** 列 editor 类型 */
    editor: string;
    /** 当前统计类型 */
    statisticType: string;
    /** 可选统计选项列表 */
    statisticOptions: StatisticOption[];
    /** 分组唯一标识 */
    groupId: string | number;
    /** 多级分组值数组 */
    multiValue: any[];
    /** 点击位置的 clientX */
    clientX: number;
    /** 点击位置的 clientY */
    clientY: number;
    /** 管线父列 key（仅 nested 子列点击时有值） */
    moduleColKey?: string;
    /** 单元格在视口中的边界（用于弹窗定位） */
    cellBounds?: {
        left: number;
        top: number;
        width: number;
        height: number;
    };
}
/**
 * Footer 嵌套列统计刷新回调信息
 */
export interface FooterStatRefreshInfo {
    /** 嵌套子列的列标识 */
    columnKey: string;
    /** 列 editor 类型 */
    editor: string;
    /** 当前统计类型 */
    statisticType: string;
    /** 管线父列 key */
    moduleColKey: string;
    /** 点击位置的 clientX */
    clientX: number;
    /** 点击位置的 clientY */
    clientY: number;
}
/**
 * 组头嵌套列统计刷新回调信息
 */
export interface GroupHeaderStatRefreshInfo {
    /** 嵌套子列的列标识 */
    columnKey: string;
    /** 列 editor 类型 */
    editor: string;
    /** 当前统计类型 */
    statisticType: string;
    /** 管线父列 key */
    moduleColKey: string;
    /** 分组唯一标识 */
    groupId: string | number;
    /** 多级分组值数组 */
    multiValue: any[];
    /** 点击位置的 clientX */
    clientX: number;
    /** 点击位置的 clientY */
    clientY: number;
}
/**
 * Footer 单元格点击回调信息
 */
export interface FooterCellClickInfo {
    /** 列标识 */
    columnKey: string;
    /** 列 editor 类型 */
    editor: string;
    /** 当前统计类型 */
    statisticType: string;
    /** 可选统计选项列表 */
    statisticOptions: StatisticOption[];
    /** 点击位置的 clientX */
    clientX: number;
    /** 点击位置的 clientY */
    clientY: number;
    /** 管线父列 key（仅 nested 子列点击时有值） */
    moduleColKey?: string;
    /** 单元格在视口中的边界（用于弹窗定位） */
    cellBounds?: {
        left: number;
        top: number;
        width: number;
        height: number;
    };
}
