@ricsam/formula-engine 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/core/engine-snapshot.ts"],
4
4
  "sourcesContent": [
5
- "import type { ContextDependency } from \"../evaluator/evaluation-context.cjs\";\nimport type { DependencyNode } from \"./managers/dependency-node.cjs\";\nimport type {\n CellAddress,\n CellInRangeResult,\n CellValue,\n ConditionalStyle,\n DirectCellStyle,\n FormulaError,\n NamedExpression,\n RangeAddress,\n RangeMetadata,\n RelativeRange,\n SpreadsheetRange,\n TableDefinition,\n TrackedReference,\n Workbook,\n} from \"./types.cjs\";\n\nexport const ENGINE_SNAPSHOT_VERSION = 5 as const;\n\nexport type NodeSnapshotId = string;\n\nexport type NamedExpressionManagerSnapshot = {\n sheetExpressions: Map<string, Map<string, Map<string, NamedExpression>>>;\n workbookExpressions: Map<string, Map<string, NamedExpression>>;\n globalExpressions: Map<string, NamedExpression>;\n};\n\nexport type WorkbookManagerSnapshot = Map<string, Workbook>;\n\nexport type TableManagerSnapshot = Map<string, Map<string, TableDefinition>>;\n\nexport type StyleManagerSnapshot = {\n conditionalStyles: ConditionalStyle[];\n cellStyles: DirectCellStyle[];\n};\n\nexport type RangeMetadataManagerSnapshot = RangeMetadata[];\n\nexport type ReferenceManagerSnapshot = Map<string, TrackedReference>;\n\nexport type SerializedValueEvaluationResultSnapshot = {\n type: \"value\";\n result: CellValue;\n sourceCell?: CellAddress;\n};\n\nexport type SerializedErrorEvaluationResultSnapshot = {\n type: \"error\";\n err: FormulaError;\n message: string;\n errAddressId: NodeSnapshotId;\n sourceCell?: CellAddress;\n};\n\nexport type SerializedSingleEvaluationResultSnapshot =\n | SerializedValueEvaluationResultSnapshot\n | SerializedErrorEvaluationResultSnapshot;\n\nexport type SerializedCellInRangeResultSnapshot = {\n relativePos: CellInRangeResult[\"relativePos\"];\n result: SerializedSingleEvaluationResultSnapshot;\n};\n\nexport type SerializedEvaluateAllCellsResultSnapshot =\n | SerializedErrorEvaluationResultSnapshot\n | {\n type: \"values\";\n values: SerializedCellInRangeResultSnapshot[];\n };\n\nexport type SerializedMaterializedSpillSnapshot = {\n kind: \"materialized\";\n relativeSpillArea: RelativeRange;\n source: string;\n sourceCell?: CellAddress;\n sourceRange?: RangeAddress;\n values: SerializedCellInRangeResultSnapshot[];\n};\n\nexport type SerializedSourceRangeSpillSnapshot = {\n kind: \"source-range\";\n relativeSpillArea: RelativeRange;\n source: string;\n sourceCell?: CellAddress;\n sourceRange: RangeAddress;\n};\n\nexport type SerializedSpillResultSnapshot =\n | SerializedMaterializedSpillSnapshot\n | SerializedSourceRangeSpillSnapshot;\n\nexport type SerializedSpilledValuesEvaluationResultSnapshot = {\n type: \"spilled-values\";\n spill: SerializedSpillResultSnapshot;\n};\n\nexport type SerializedFunctionEvaluationResultSnapshot =\n | SerializedSingleEvaluationResultSnapshot\n | SerializedSpilledValuesEvaluationResultSnapshot;\n\nexport type SerializedSpillMetaEvaluationResultSnapshot =\n | SerializedErrorEvaluationResultSnapshot\n | SerializedSpilledValuesEvaluationResultSnapshot\n | {\n type: \"does-not-spill\";\n };\n\ntype SerializedBaseNodeSnapshot = {\n snapshotId: NodeSnapshotId;\n key: string;\n dependencies: NodeSnapshotId[];\n};\n\nexport type SerializedCellValueNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"cell-value\";\n evaluationResult: SerializedSingleEvaluationResultSnapshot;\n spillMetaSnapshotId?: NodeSnapshotId;\n};\n\nexport type SerializedSpillMetaNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"spill-meta\";\n evaluationResult: SerializedSpillMetaEvaluationResultSnapshot;\n};\n\nexport type SerializedEmptyCellNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"empty\";\n evaluationResult: SerializedSingleEvaluationResultSnapshot;\n};\n\nexport type SerializedRangeNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"range\";\n result: SerializedEvaluateAllCellsResultSnapshot;\n};\n\nexport type SerializedAstNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"ast\";\n contextDependency: ContextDependency;\n evaluationResult: SerializedFunctionEvaluationResultSnapshot;\n};\n\nexport type SerializedResourceNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"resource\";\n};\n\nexport type SerializedDependencyNodeSnapshot =\n | SerializedCellValueNodeSnapshot\n | SerializedSpillMetaNodeSnapshot\n | SerializedEmptyCellNodeSnapshot\n | SerializedRangeNodeSnapshot\n | SerializedAstNodeSnapshot\n | SerializedResourceNodeSnapshot;\n\nexport type DependencyManagerSnapshot = {\n nodes: SerializedDependencyNodeSnapshot[];\n spilledValues: Array<[string, { origin: CellAddress; spillOnto: SpreadsheetRange }]>;\n};\n\nexport type SerializedSCCSnapshot = {\n id: number;\n nodes: NodeSnapshotId[];\n evaluationOrder: NodeSnapshotId[];\n resolved: boolean;\n hardEdgeSCCs: NodeSnapshotId[][];\n};\n\nexport type SerializedEvaluationOrderSnapshot = {\n nodeKey: string;\n evaluationOrder: NodeSnapshotId[];\n hasCycle: boolean;\n cycleNodes?: NodeSnapshotId[];\n hash: string;\n};\n\nexport type CacheManagerSnapshot = {\n evaluationOrders: SerializedEvaluationOrderSnapshot[];\n sccs: Array<{\n hash: string;\n scc: SerializedSCCSnapshot;\n }>;\n};\n\ntype EngineSnapshotManagers = {\n workbook: WorkbookManagerSnapshot;\n namedExpression: NamedExpressionManagerSnapshot;\n table: TableManagerSnapshot;\n style: StyleManagerSnapshot;\n rangeMetadata: RangeMetadataManagerSnapshot;\n reference: ReferenceManagerSnapshot;\n dependency: DependencyManagerSnapshot;\n cache: CacheManagerSnapshot;\n};\n\nexport type EngineSnapshot = {\n version: typeof ENGINE_SNAPSHOT_VERSION;\n managers: EngineSnapshotManagers;\n};\n\nexport function getAstNodeSnapshotId(\n node: DependencyNode & { getContextDependency(): ContextDependency }\n): NodeSnapshotId {\n return `${node.key}::${JSON.stringify(node.getContextDependency())}`;\n}\n"
5
+ "import type { ContextDependency } from \"../evaluator/evaluation-context.cjs\";\nimport type { DependencyNode } from \"./managers/dependency-node.cjs\";\nimport type {\n CellAddress,\n CellInRangeResult,\n CellValue,\n ConditionalStyle,\n DirectCellStyle,\n FormulaError,\n NamedExpression,\n RangeAddress,\n RangeMetadata,\n RelativeRange,\n SpreadsheetRange,\n TableDefinition,\n TrackedReference,\n Workbook,\n} from \"./types.cjs\";\n\nexport const ENGINE_SNAPSHOT_VERSION = 5 as const;\n\nexport type NodeSnapshotId = string;\n\nexport type NamedExpressionManagerSnapshot = {\n sheetExpressions: Map<string, Map<string, Map<string, NamedExpression>>>;\n workbookExpressions: Map<string, Map<string, NamedExpression>>;\n globalExpressions: Map<string, NamedExpression>;\n};\n\nexport type WorkbookManagerSnapshot = Map<string, Workbook>;\n\nexport type TableManagerSnapshot = Map<string, Map<string, TableDefinition>>;\n\nexport type StyleManagerSnapshot = {\n conditionalStyles: ConditionalStyle[];\n cellStyles: DirectCellStyle[];\n};\n\nexport type RangeMetadataManagerSnapshot = RangeMetadata[];\n\nexport type ReferenceManagerSnapshot = Map<string, TrackedReference>;\n\nexport type EngineHistorySnapshotManagers = {\n workbook: WorkbookManagerSnapshot;\n namedExpression: NamedExpressionManagerSnapshot;\n table: TableManagerSnapshot;\n style: StyleManagerSnapshot;\n rangeMetadata: RangeMetadataManagerSnapshot;\n reference: ReferenceManagerSnapshot;\n};\n\nexport type EngineHistorySnapshot = {\n version: typeof ENGINE_SNAPSHOT_VERSION;\n managers: EngineHistorySnapshotManagers;\n};\n\nexport type SerializedValueEvaluationResultSnapshot = {\n type: \"value\";\n result: CellValue;\n sourceCell?: CellAddress;\n};\n\nexport type SerializedErrorEvaluationResultSnapshot = {\n type: \"error\";\n err: FormulaError;\n message: string;\n errAddressId: NodeSnapshotId;\n sourceCell?: CellAddress;\n};\n\nexport type SerializedSingleEvaluationResultSnapshot =\n | SerializedValueEvaluationResultSnapshot\n | SerializedErrorEvaluationResultSnapshot;\n\nexport type SerializedCellInRangeResultSnapshot = {\n relativePos: CellInRangeResult[\"relativePos\"];\n result: SerializedSingleEvaluationResultSnapshot;\n};\n\nexport type SerializedEvaluateAllCellsResultSnapshot =\n | SerializedErrorEvaluationResultSnapshot\n | {\n type: \"values\";\n values: SerializedCellInRangeResultSnapshot[];\n };\n\nexport type SerializedMaterializedSpillSnapshot = {\n kind: \"materialized\";\n relativeSpillArea: RelativeRange;\n source: string;\n sourceCell?: CellAddress;\n sourceRange?: RangeAddress;\n values: SerializedCellInRangeResultSnapshot[];\n};\n\nexport type SerializedSourceRangeSpillSnapshot = {\n kind: \"source-range\";\n relativeSpillArea: RelativeRange;\n source: string;\n sourceCell?: CellAddress;\n sourceRange: RangeAddress;\n};\n\nexport type SerializedSpillResultSnapshot =\n | SerializedMaterializedSpillSnapshot\n | SerializedSourceRangeSpillSnapshot;\n\nexport type SerializedSpilledValuesEvaluationResultSnapshot = {\n type: \"spilled-values\";\n spill: SerializedSpillResultSnapshot;\n};\n\nexport type SerializedFunctionEvaluationResultSnapshot =\n | SerializedSingleEvaluationResultSnapshot\n | SerializedSpilledValuesEvaluationResultSnapshot;\n\nexport type SerializedSpillMetaEvaluationResultSnapshot =\n | SerializedErrorEvaluationResultSnapshot\n | SerializedSpilledValuesEvaluationResultSnapshot\n | {\n type: \"does-not-spill\";\n };\n\ntype SerializedBaseNodeSnapshot = {\n snapshotId: NodeSnapshotId;\n key: string;\n dependencies: NodeSnapshotId[];\n};\n\nexport type SerializedCellValueNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"cell-value\";\n evaluationResult: SerializedSingleEvaluationResultSnapshot;\n spillMetaSnapshotId?: NodeSnapshotId;\n};\n\nexport type SerializedSpillMetaNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"spill-meta\";\n evaluationResult: SerializedSpillMetaEvaluationResultSnapshot;\n};\n\nexport type SerializedEmptyCellNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"empty\";\n evaluationResult: SerializedSingleEvaluationResultSnapshot;\n};\n\nexport type SerializedRangeNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"range\";\n result: SerializedEvaluateAllCellsResultSnapshot;\n};\n\nexport type SerializedAstNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"ast\";\n contextDependency: ContextDependency;\n evaluationResult: SerializedFunctionEvaluationResultSnapshot;\n};\n\nexport type SerializedResourceNodeSnapshot = SerializedBaseNodeSnapshot & {\n kind: \"resource\";\n};\n\nexport type SerializedDependencyNodeSnapshot =\n | SerializedCellValueNodeSnapshot\n | SerializedSpillMetaNodeSnapshot\n | SerializedEmptyCellNodeSnapshot\n | SerializedRangeNodeSnapshot\n | SerializedAstNodeSnapshot\n | SerializedResourceNodeSnapshot;\n\nexport type DependencyManagerSnapshot = {\n nodes: SerializedDependencyNodeSnapshot[];\n spilledValues: Array<[string, { origin: CellAddress; spillOnto: SpreadsheetRange }]>;\n};\n\nexport type SerializedSCCSnapshot = {\n id: number;\n nodes: NodeSnapshotId[];\n evaluationOrder: NodeSnapshotId[];\n resolved: boolean;\n hardEdgeSCCs: NodeSnapshotId[][];\n};\n\nexport type SerializedEvaluationOrderSnapshot = {\n nodeKey: string;\n evaluationOrder: NodeSnapshotId[];\n hasCycle: boolean;\n cycleNodes?: NodeSnapshotId[];\n hash: string;\n};\n\nexport type CacheManagerSnapshot = {\n evaluationOrders: SerializedEvaluationOrderSnapshot[];\n sccs: Array<{\n hash: string;\n scc: SerializedSCCSnapshot;\n }>;\n};\n\ntype EngineSnapshotManagers = EngineHistorySnapshotManagers & {\n dependency: DependencyManagerSnapshot;\n cache: CacheManagerSnapshot;\n};\n\nexport type EngineSnapshot = {\n version: typeof ENGINE_SNAPSHOT_VERSION;\n managers: EngineSnapshotManagers;\n};\n\nexport function getAstNodeSnapshotId(\n node: DependencyNode & { getContextDependency(): ContextDependency }\n): NodeSnapshotId {\n return `${node.key}::${JSON.stringify(node.getContextDependency())}`;\n}\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,0BAA0B;AAoLhC,SAAS,oBAAoB,CAClC,MACgB;AAAA,EAChB,OAAO,GAAG,KAAK,QAAQ,KAAK,UAAU,KAAK,qBAAqB,CAAC;AAAA;",
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,0BAA0B;AA4LhC,SAAS,oBAAoB,CAClC,MACgB;AAAA,EAChB,OAAO,GAAG,KAAK,QAAQ,KAAK,UAAU,KAAK,qBAAqB,CAAC;AAAA;",
8
8
  "debugId": "BC7158447FA0E78F64756E2164756E21",
9
9
  "names": []
10
10
  }