import { ID, ICell, IStoreState, ICellNN } from '../../index.data'; import { ParsedResult } from '../../formula-parser/data'; import Parser from '../../formula-parser/parser'; import { FormulaManagerConfig } from '../../formula-manager/index.data'; export interface CellWithDepsInState { cells: Record; cellDeps: Record; varDeps: Record; } export declare function restoreCellRefIfNeeded(state: IStoreState, cellWithDeps: CellWithDepsInState): CellWithDepsInState; export declare function extractChangedCells(state: IStoreState, cells: ICell[]): ICellNN[]; /** * 将parser计算出的结果, 转换为state的patch * partialState_dangeously 会被内部改动 (性能原因) */ export declare function mergeParsedResults(partialState_dangeously: CellWithDepsInState, parsedResults: Record): CellWithDepsInState; /** * 将 主体->[依赖1, 依赖2] => [依赖1: [主体], 依赖2: [主体]], 以便适配有向无环图 * 单元格3有依赖[4,5], 4,5的变动将触发3的变动 * 那么从parser中计算出的结果是: [4,5] * 需要转换为需要的格式(有向无环图, 4:[3] 表示4变动将触发3变动): * {4:[3], 5: [3]} */ export declare function setCellDeps(cellDeps: Record, hostCellId: any, deps: ID[]): Record; export declare function setVarDeps(varDeps: Record, hostCellId: any, deps: ID[]): Record; /** * 获取默认的公式parser, ( 不会递归计算 ) */ export declare function getParser(state: IStoreState, id: ID, options?: FormulaManagerConfig): Parser; /** * 若存在 varDeps: [A1], cellDeps: {B: [A1, A2]} * 则 remove A1 后, 会变成 varDeps:[], cellDeps: {B: [A2]} */ export declare function removeCellFromDeps(cellId: ID, { varDeps, cellDeps }: { varDeps: Record; cellDeps: Record; }): { varDeps: {}; cellDeps: {}; };