import { IStoreState, ID, ICell } from '../../index.data'; import { FormulaManagerConfig } from '../../formula-manager/index.data'; import { isExternalCell, getExternalCellById } from '../formula_support/externalCell'; // 用于避免递归依赖 export function _getCell(state: IStoreState, id: ID, config?: FormulaManagerConfig): ICell { if (isExternalCell(id)) { if (!config) throw new Error('_getCell出错, 获取外部单元格需要使用config'); return getExternalCellById(id + '', config); } return state.cells![id]; }