import type { IColumnDefine, IFilterConfig, IFilterState, ISheetDefine, SheetData } from './index'; import type { CellCoord, CellRange, CellValue } from './base'; import type { ListTableConstructorOptions } from '@visactor/vtable'; export interface IWorkSheetOptions extends Omit { sheetKey: string; sheetTitle: string; container?: HTMLElement; width?: number; height?: number; data?: SheetData; showHeader?: boolean; firstRowAsHeader?: boolean; filter?: boolean | IFilterConfig; filterState?: IFilterState; columns?: IColumnDefine[]; dragOrder?: { enableDragColumnOrder?: boolean; enableDragRowOrder?: boolean; }; } export interface IWorkSheetAPI { getCellValue: (col: number, row: number) => CellValue; setCellValue: (col: number, row: number, value: CellValue) => void; getCellByAddress: (address: string) => { coord: CellCoord; value: CellValue; }; addressFromCoord: (coord: CellCoord) => string; coordFromAddress: (address: string) => CellCoord; getSelection: () => CellRange | null; getData: () => SheetData; getRowCount: () => number; getColumnCount: () => number; } export interface ISheetManager { getActiveSheet: () => ISheetDefine | null; setActiveSheet: (sheetKey: string) => void; addSheet: (sheet: ISheetDefine) => void; removeSheet: (sheetKey: string) => void; renameSheet: (sheetKey: string, newTitle: string) => void; getAllSheets: () => ISheetDefine[]; getSheet: (sheetKey: string) => ISheetDefine | null; getSheetCount: () => number; getSheetAPI: (sheetKey: string) => IWorkSheetAPI | null; onSheetChange: (callback: (sheets: ISheetDefine[]) => void) => void; offSheetChange: (callback: (sheets: ISheetDefine[]) => void) => void; onActiveSheetChange: (callback: (sheet: ISheetDefine) => void) => void; offActiveSheetChange: (callback: (sheet: ISheetDefine) => void) => void; }