import type { ColumnStyleOption, ColumnTypeOption } from './column'; import type { CellLocation, CellPivotRole, CellRange, FieldData, FieldDef } from './table-engine'; import type { Rect } from '../tools/Rect'; import type { BaseTableAPI } from './base-table'; import type { StylePropertyFunctionArg } from './style-define'; export type MaybePromise = T | Promise; export type MaybeCall = T | ((...args: A) => T); export type MaybePromiseOrUndefined = any | undefined | Promise; export type MaybePromiseOrCallOrUndefined = any | undefined | Promise | ((...args: any) => any); export type PromiseMaybeUndefOrCall = Promise | ((...args: A) => T); export type AnyFunction = (...args: any[]) => any; export interface RectProps { left: number; right: number; top: number; bottom: number; width: number; height: number; } export interface CellPosition { col: number; row: number; } export type ColorsDef = string | (string | null)[]; export type LineWidthsDef = number | (number | null)[]; export type LineDashsDef = number[] | (number[] | null)[]; export type shadowColorsDef = { from: string; to: string; } | ({ from: string; to: string; } | null)[]; export type PaddingsDef = number | (number | null)[]; export type SortOption = boolean | ((v1: any, v2: any, order: SortOrder) => -1 | 0 | 1); export type MergeCellOption = boolean | ((v1: any, v2: any, extraArgs: { source: CellPosition; target: CellPosition; table: BaseTableAPI; }) => boolean); export type BaseCellInfo = { row: number; col: number; value: FieldData; dataValue: FieldData; }; export type MergeCellInfo = { colStart: number; colEnd: number; rowStart: number; rowEnd: number; }; export type CellInfo = { col: number; row: number; title?: string | (() => string) | undefined; field?: FieldDef; cellHeaderPaths?: ICellHeaderPaths; cellRange?: Rect; originData?: any; value?: FieldData; dataValue?: FieldData; cellLocation?: CellLocation; cellType?: ColumnTypeOption; }; export type ICellHeaderPaths = IListTableCellHeaderPaths | IPivotTableCellHeaderPaths; export type IListTableCellHeaderPaths = { readonly colHeaderPaths?: { field: FieldDef; }[]; readonly rowHeaderPaths?: { field: FieldDef; }[]; cellLocation: CellLocation; }; export type IPivotTableCellHeaderPaths = { readonly colHeaderPaths?: IDimensionInfo[]; readonly rowHeaderPaths?: IDimensionInfo[]; cellLocation: CellLocation; role?: CellPivotRole; }; export interface IDimensionInfo { dimensionKey?: string; value?: string; indicatorKey?: string; isPivotCorner?: boolean; virtual?: boolean; role?: CellPivotRole; } export declare enum InteractionState { 'default' = "default", 'grabing' = "grabing", 'scrolling' = "scrolling" } export declare enum HighlightScope { 'single' = "single", 'column' = "column", 'row' = "row", 'cross' = "cross", 'none' = "none" } export type SortOrder = 'asc' | 'desc' | 'normal' | 'ASC' | 'DESC' | 'NORMAL'; export type CustomCellStyle = { id: string; style: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption); }; export type CustomCellStyleArrangement = { cellPosition: { col?: number; row?: number; range?: CellRange; }; customStyleId: string; };