import { IStoreState, IRow, ID, FormulaManagerConfig } from '../../index.data'; import { IRowWithCell } from '../../SpreadSheetProvider/index.data'; import * as R from 'rambda'; import { SimpleNodeContext } from 'valor-app-utils/dist/tree/context'; import { Store } from 'unistore'; import { SpreadSheetRuntime } from '../../RuntimeContext'; /** * 可插入一行, 或一个子树 * 注意: 调用此方法前, 必须保证参数是正常的 ( 可以正常插入, 并且rowsToInsert一定不空... ) * 本方法不检查参数!!! * @param state * @param type * @param baseI 基准行 * @param rowsToInsert * @param index 插入为基准行的第index个子 */ export declare function insertTreeRow(state: IStoreState, type: 'sibling' | 'child', baseI: number, // 鼠标选中的那一行 rowsToInsert: IRowWithCell[], index: number | undefined, helpers: { normalizeRow: (rows: IRow[], row: IRowWithCell) => IRowWithCell; }, runtime: SpreadSheetRuntime): { rows: IRow[]; treeContext: Record; cells: Record; cellDeps: Record; varDeps: Record; }; export declare function getInsertAtIndex(state: IStoreState, type: 'sibling', baseI: number): number; export declare function getInsertAtIndex(state: IStoreState, type: 'child', baseI: number, index?: number): number; /** * 可删除一行, 或一棵子树 * 注意: 调用此方法前, 必须保证参数正常 * 本方法不检查参数, 假定删除可正常进行 */ export declare function deleteTreeRow(state: IStoreState, i: number, helpers: { normalizeRow: (rows: IRow[], row: IRowWithCell) => IRowWithCell; }, runtime: SpreadSheetRuntime): { rows: IRow[]; treeContext: Record; cells: Record; cellDeps: Record; varDeps: Record; }; /** * 对受影响的行, 校正formulaDisabled并重算 * @param state * @param affectedRowIds_formula 需要重新确定公式的行 * @param affectedRowIds_deps 受操作影响, 需要重新计算的行(应包含前者) */ export declare function amendFormulaDisabledAndRecaculate(state: IStoreState, affectedRowIds_formula: ID[], affectedRowIds_deps: ID[], helpers: { normalizeRow: (rows: IRow[], row: IRowWithCell) => IRowWithCell; }, formulaConfig: FormulaManagerConfig, batchMode: boolean): { rows: IRow[]; treeContext: Record; cells: Record; cellDeps: Record; varDeps: Record; }; /** * 对行 升级或降级 * 本方法不校验参数 */ export declare function pushTreeRow(state: IStoreState, type: 'left' | 'right', i: number, helpers: { normalizeRow: (rows: IRow[], row: IRowWithCell) => IRowWithCell; }, runtime: SpreadSheetRuntime): { rows: IRow[]; treeContext: Record; cells: Record; cellDeps: Record; varDeps: Record; } | null; /** * 上移下移行 * 本方法不检验参数 * 不需要重置formulaDisabled */ export declare function moveTreeRow(state: IStoreState, type: 'up' | 'down', i: number): { rows: IRow[]; treeContext: R.Dictionary; } | null; /** * 由于rows顺序发生改变, 需要重算 rowDimensions * 方法是: 重新根据 rowIds 的顺序, 计算row.top * @param rowDimensions 修改之前的rowDimensions */ /** * 根据 rows 的自然排序, 修正 row.i * @param rows 待修正的rows ( 中间状态, 自然排序是正确的 , 但row.i 是不正确的) */ /** * 根据 row 的变化, 修正 row.cells 里的 cell.i * @param rows 修正后的row * @param cells 待修正的cells */ export declare function inferHostRowsByInsert(state: IStoreState, parentRowIndex: number, insertIds: ID[]): ID[]; export declare function inferHostRowsByDelete(state: IStoreState, i: number): ID[]; export declare function inferHostRowsByPush(stateBeforePush: IStoreState, stateAfterPush: IStoreState, i: number, newParentRowId: ID): ID[]; export declare function ensureSelectionWhenTreeDelete(store: Store, deleteId: ID, runtime: SpreadSheetRuntime, action: any): void; export declare function deleteTreeRowOperation(store: Store, deleteI: number, helpers: { normalizeRow: (rows: IRow[], row: IRowWithCell) => IRowWithCell; }, runtime: SpreadSheetRuntime): void; /** * patch某个row * 暂时不允许修改row.cells * 目前仅有的需求: 修改additions */ export declare function setRowData(state: IStoreState, id: ID, rowData: Partial, replace?: boolean): { rows?: undefined; } | { rows: IRow[]; };