@rsconcept/domain 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/cctext/index.d.ts +1 -0
- package/dist/cctext/index.js +42 -0
- package/dist/cctext/index.js.map +1 -0
- package/dist/cctext/language-api.d.ts +43 -0
- package/dist/cctext/language-api.js +252 -0
- package/dist/cctext/language-api.js.map +1 -0
- package/dist/cctext/language.d.ts +58 -0
- package/dist/cctext/language.js +44 -0
- package/dist/cctext/language.js.map +1 -0
- package/dist/graph/graph.d.ts +62 -0
- package/dist/graph/graph.js +385 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.js +384 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +5851 -0
- package/dist/index.js.map +1 -0
- package/dist/library/folder-tree.d.ts +32 -0
- package/dist/library/folder-tree.js +136 -0
- package/dist/library/folder-tree.js.map +1 -0
- package/dist/library/index.d.ts +17 -0
- package/dist/library/index.js +2800 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/library-api.d.ts +6 -0
- package/dist/library/library-api.js +13 -0
- package/dist/library/library-api.js.map +1 -0
- package/dist/library/library.d.ts +56 -0
- package/dist/library/library.js +23 -0
- package/dist/library/library.js.map +1 -0
- package/dist/library/oss-api.d.ts +47 -0
- package/dist/library/oss-api.js +1105 -0
- package/dist/library/oss-api.js.map +1 -0
- package/dist/library/oss-layout-api.d.ts +36 -0
- package/dist/library/oss-layout-api.js +330 -0
- package/dist/library/oss-layout-api.js.map +1 -0
- package/dist/library/oss-layout.d.ts +25 -0
- package/dist/library/oss-layout.js +1 -0
- package/dist/library/oss-layout.js.map +1 -0
- package/dist/library/oss.d.ts +136 -0
- package/dist/library/oss.js +30 -0
- package/dist/library/oss.js.map +1 -0
- package/dist/library/rsengine.d.ts +116 -0
- package/dist/library/rsengine.js +2604 -0
- package/dist/library/rsengine.js.map +1 -0
- package/dist/library/rsform-api.d.ts +74 -0
- package/dist/library/rsform-api.js +879 -0
- package/dist/library/rsform-api.js.map +1 -0
- package/dist/library/rsform.d.ts +206 -0
- package/dist/library/rsform.js +32 -0
- package/dist/library/rsform.js.map +1 -0
- package/dist/library/rsmodel-api.d.ts +43 -0
- package/dist/library/rsmodel-api.js +836 -0
- package/dist/library/rsmodel-api.js.map +1 -0
- package/dist/library/rsmodel.d.ts +52 -0
- package/dist/library/rsmodel.js +25 -0
- package/dist/library/rsmodel.js.map +1 -0
- package/dist/library/structure-planner.d.ts +33 -0
- package/dist/library/structure-planner.js +481 -0
- package/dist/library/structure-planner.js.map +1 -0
- package/dist/parsing/ast.d.ts +49 -0
- package/dist/parsing/ast.js +93 -0
- package/dist/parsing/ast.js.map +1 -0
- package/dist/parsing/index.d.ts +3 -0
- package/dist/parsing/index.js +141 -0
- package/dist/parsing/index.js.map +1 -0
- package/dist/parsing/lezer-tree.d.ts +13 -0
- package/dist/parsing/lezer-tree.js +50 -0
- package/dist/parsing/lezer-tree.js.map +1 -0
- package/dist/rslang/api.d.ts +53 -0
- package/dist/rslang/api.js +846 -0
- package/dist/rslang/api.js.map +1 -0
- package/dist/rslang/ast-annotations.d.ts +18 -0
- package/dist/rslang/ast-annotations.js +56 -0
- package/dist/rslang/ast-annotations.js.map +1 -0
- package/dist/rslang/error.d.ts +85 -0
- package/dist/rslang/error.js +159 -0
- package/dist/rslang/error.js.map +1 -0
- package/dist/rslang/eval/calculator.d.ts +43 -0
- package/dist/rslang/eval/calculator.js +1639 -0
- package/dist/rslang/eval/calculator.js.map +1 -0
- package/dist/rslang/eval/evaluation-cache.d.ts +36 -0
- package/dist/rslang/eval/evaluation-cache.js +310 -0
- package/dist/rslang/eval/evaluation-cache.js.map +1 -0
- package/dist/rslang/eval/evaluator.d.ts +70 -0
- package/dist/rslang/eval/evaluator.js +1514 -0
- package/dist/rslang/eval/evaluator.js.map +1 -0
- package/dist/rslang/eval/value-api.d.ts +48 -0
- package/dist/rslang/eval/value-api.js +490 -0
- package/dist/rslang/eval/value-api.js.map +1 -0
- package/dist/rslang/eval/value.d.ts +36 -0
- package/dist/rslang/eval/value.js +118 -0
- package/dist/rslang/eval/value.js.map +1 -0
- package/dist/rslang/index.d.ts +17 -0
- package/dist/rslang/index.js +4314 -0
- package/dist/rslang/index.js.map +1 -0
- package/dist/rslang/labels.d.ts +16 -0
- package/dist/rslang/labels.js +315 -0
- package/dist/rslang/labels.js.map +1 -0
- package/dist/rslang/parser/expression-generator.d.ts +10 -0
- package/dist/rslang/parser/expression-generator.js +451 -0
- package/dist/rslang/parser/expression-generator.js.map +1 -0
- package/dist/rslang/parser/normalize.d.ts +11 -0
- package/dist/rslang/parser/normalize.js +507 -0
- package/dist/rslang/parser/normalize.js.map +1 -0
- package/dist/rslang/parser/parser.d.ts +5 -0
- package/dist/rslang/parser/parser.js +24 -0
- package/dist/rslang/parser/parser.js.map +1 -0
- package/dist/rslang/parser/parser.terms.d.ts +42 -0
- package/dist/rslang/parser/parser.terms.js +84 -0
- package/dist/rslang/parser/parser.terms.js.map +1 -0
- package/dist/rslang/parser/syntax-errors.d.ts +11 -0
- package/dist/rslang/parser/syntax-errors.js +403 -0
- package/dist/rslang/parser/syntax-errors.js.map +1 -0
- package/dist/rslang/parser/token.d.ts +79 -0
- package/dist/rslang/parser/token.js +95 -0
- package/dist/rslang/parser/token.js.map +1 -0
- package/dist/rslang/semantic/analyzer.d.ts +39 -0
- package/dist/rslang/semantic/analyzer.js +2604 -0
- package/dist/rslang/semantic/analyzer.js.map +1 -0
- package/dist/rslang/semantic/arguments-extractor.d.ts +42 -0
- package/dist/rslang/semantic/arguments-extractor.js +366 -0
- package/dist/rslang/semantic/arguments-extractor.js.map +1 -0
- package/dist/rslang/semantic/type-auditor.d.ts +73 -0
- package/dist/rslang/semantic/type-auditor.js +1570 -0
- package/dist/rslang/semantic/type-auditor.js.map +1 -0
- package/dist/rslang/semantic/typification-api.d.ts +27 -0
- package/dist/rslang/semantic/typification-api.js +320 -0
- package/dist/rslang/semantic/typification-api.js.map +1 -0
- package/dist/rslang/semantic/typification-parser.d.ts +12 -0
- package/dist/rslang/semantic/typification-parser.js +226 -0
- package/dist/rslang/semantic/typification-parser.js.map +1 -0
- package/dist/rslang/semantic/typification.d.ts +119 -0
- package/dist/rslang/semantic/typification.js +74 -0
- package/dist/rslang/semantic/typification.js.map +1 -0
- package/dist/rslang/semantic/value-auditor.d.ts +43 -0
- package/dist/rslang/semantic/value-auditor.js +523 -0
- package/dist/rslang/semantic/value-auditor.js.map +1 -0
- package/dist/rslang/semantic/value-class.d.ts +10 -0
- package/dist/rslang/semantic/value-class.js +9 -0
- package/dist/rslang/semantic/value-class.js.map +1 -0
- package/dist/rslang/typification-graph.d.ts +33 -0
- package/dist/rslang/typification-graph.js +311 -0
- package/dist/rslang/typification-graph.js.map +1 -0
- package/dist/shared/branded.d.ts +7 -0
- package/dist/shared/branded.js +1 -0
- package/dist/shared/branded.js.map +1 -0
- package/dist/shared/hash.d.ts +6 -0
- package/dist/shared/hash.js +18 -0
- package/dist/shared/hash.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +18 -0
- package/dist/shared/index.js.map +1 -0
- package/package.json +184 -0
- package/src/cctext/index.ts +9 -0
- package/src/cctext/language-api.test.ts +149 -0
- package/src/cctext/language-api.ts +285 -0
- package/src/cctext/language.ts +80 -0
- package/src/graph/graph.test.ts +392 -0
- package/src/graph/graph.ts +433 -0
- package/src/graph/index.ts +1 -0
- package/src/index.ts +96 -0
- package/src/library/folder-tree.test.ts +47 -0
- package/src/library/folder-tree.ts +156 -0
- package/src/library/index.ts +46 -0
- package/src/library/library-api.test.ts +32 -0
- package/src/library/library-api.ts +11 -0
- package/src/library/library.ts +61 -0
- package/src/library/oss-api.ts +449 -0
- package/src/library/oss-layout-api.ts +377 -0
- package/src/library/oss-layout.ts +27 -0
- package/src/library/oss.ts +150 -0
- package/src/library/rsengine.ts +593 -0
- package/src/library/rsform-api.ts +533 -0
- package/src/library/rsform.ts +228 -0
- package/src/library/rsmodel-api.ts +340 -0
- package/src/library/rsmodel.ts +50 -0
- package/src/library/structure-planner.ts +143 -0
- package/src/parsing/ast.ts +136 -0
- package/src/parsing/index.ts +15 -0
- package/src/parsing/lezer-tree.ts +69 -0
- package/src/rslang/api.test.ts +116 -0
- package/src/rslang/api.ts +183 -0
- package/src/rslang/ast-annotations.ts +70 -0
- package/src/rslang/error.ts +129 -0
- package/src/rslang/eval/calculator.test.ts +124 -0
- package/src/rslang/eval/calculator.ts +121 -0
- package/src/rslang/eval/evaluation-cache.ts +257 -0
- package/src/rslang/eval/evaluator.test.ts +352 -0
- package/src/rslang/eval/evaluator.ts +935 -0
- package/src/rslang/eval/value-api.test.ts +105 -0
- package/src/rslang/eval/value-api.ts +444 -0
- package/src/rslang/eval/value.ts +102 -0
- package/src/rslang/index.ts +23 -0
- package/src/rslang/labels.ts +191 -0
- package/src/rslang/parser/expression-generator.test.ts +100 -0
- package/src/rslang/parser/expression-generator.ts +466 -0
- package/src/rslang/parser/normalize.test.ts +99 -0
- package/src/rslang/parser/normalize.ts +462 -0
- package/src/rslang/parser/parser.terms.ts +42 -0
- package/src/rslang/parser/parser.test.ts +153 -0
- package/src/rslang/parser/parser.ts +20 -0
- package/src/rslang/parser/rslang.grammar +251 -0
- package/src/rslang/parser/syntax-errors.ts +209 -0
- package/src/rslang/parser/token.ts +106 -0
- package/src/rslang/semantic/analyzer.test.ts +59 -0
- package/src/rslang/semantic/analyzer.ts +179 -0
- package/src/rslang/semantic/arguments-extractor.ts +327 -0
- package/src/rslang/semantic/type-auditor.test.ts +326 -0
- package/src/rslang/semantic/type-auditor.ts +1049 -0
- package/src/rslang/semantic/typification-api.test.ts +46 -0
- package/src/rslang/semantic/typification-api.ts +321 -0
- package/src/rslang/semantic/typification-parser.test.ts +50 -0
- package/src/rslang/semantic/typification-parser.ts +220 -0
- package/src/rslang/semantic/typification.ts +180 -0
- package/src/rslang/semantic/value-auditor.test.ts +206 -0
- package/src/rslang/semantic/value-auditor.ts +332 -0
- package/src/rslang/semantic/value-class.ts +11 -0
- package/src/rslang/typification-graph.ts +155 -0
- package/src/shared/branded.ts +6 -0
- package/src/shared/hash.ts +17 -0
- package/src/shared/index.ts +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/library/oss.ts","../../src/library/oss-layout-api.ts"],"sourcesContent":["/**\n * Module: Schema of Synthesis Operations.\n */\n\nimport { type Graph } from '../graph';\n\nimport { type LibraryItem } from './library';\nimport { type NodePosition, type OssLayout } from './oss-layout';\n\n/** Represents OSS node type. */\nexport const NodeType = {\n OPERATION: 1,\n BLOCK: 2\n} as const;\nexport type NodeType = (typeof NodeType)[keyof typeof NodeType];\n\n/** Represents OSS graph node. */\ninterface OssNode extends NodePosition {\n nodeType: NodeType;\n parent: number | null;\n}\n\n/** Represents {@link Operation} type. */\nexport const OperationType = {\n INPUT: 'input',\n SYNTHESIS: 'synthesis',\n REPLICA: 'replica'\n} as const;\nexport type OperationType = (typeof OperationType)[keyof typeof OperationType];\n\n/** Represents {@link Substitution} extended data. */\nexport interface CstSubstituteInfo {\n original: number;\n substitution: number;\n operation: number;\n original_schema: number;\n original_alias: string;\n original_term: string;\n substitution_schema: number;\n substitution_alias: string;\n substitution_term: string;\n}\n\n/** Represents Operation common attributes. */\ninterface OperationBase extends OssNode {\n id: number;\n alias: string;\n title: string;\n description: string;\n operation_type: OperationType;\n result: number | null;\n nodeType: typeof NodeType.OPERATION;\n has_additions: boolean;\n}\n\n/** Represents Input Operation. */\nexport interface OperationInput extends OperationBase {\n operation_type: typeof OperationType.INPUT;\n is_import: boolean;\n}\n\n/** Represents Replica Operation. */\ninterface OperationReplica extends OperationBase {\n operation_type: typeof OperationType.REPLICA;\n target: number;\n}\n\n/** Represents Synthesis Operation. */\nexport interface OperationSynthesis extends OperationBase {\n operation_type: typeof OperationType.SYNTHESIS;\n is_consolidation: boolean; // aka 'diamond synthesis'\n substitutions: CstSubstituteInfo[];\n arguments: number[];\n}\n\n/** Represents Operation. */\nexport type Operation = OperationInput | OperationReplica | OperationSynthesis;\n\n/** Represents Block. */\nexport interface Block extends OssNode {\n id: number;\n oss: number;\n title: string;\n description: string;\n parent: number | null;\n nodeType: typeof NodeType.BLOCK;\n}\n\n/** Represents item of OperationSchema. */\nexport type OssItem = Operation | Block;\n\n/** Represents {@link OperationSchema} statistics. */\nexport interface OperationSchemaStats {\n count_all: number;\n count_inputs: number;\n count_synthesis: number;\n count_schemas: number;\n count_owned: number;\n count_block: number;\n count_references: number;\n}\n\n/** Represents OperationSchema. */\nexport interface OperationSchema extends LibraryItem {\n editors: number[];\n operations: Operation[];\n blocks: Block[];\n replicas: {\n original: number;\n replica: number;\n }[];\n layout: OssLayout;\n arguments: {\n operation: number;\n argument: number;\n }[];\n substitutions: CstSubstituteInfo[];\n\n graph: Graph;\n extendedGraph: Graph;\n hierarchy: Graph<string>;\n schemas: number[];\n stats: OperationSchemaStats;\n operationByID: Map<number, Operation>;\n blockByID: Map<number, Block>;\n itemByNodeID: Map<string, OssItem>;\n}\n\n/** Represents substitution error description. */\nexport interface SubstitutionErrorDescription {\n errorType: SubstitutionErrorType;\n params: string[];\n}\n\n/** Represents Substitution table error types. */\nexport const SubstitutionErrorType = {\n invalidIDs: 0,\n incorrectCst: 1,\n invalidClasses: 2,\n invalidBasic: 3,\n invalidConstant: 4,\n typificationCycle: 5,\n baseSubstitutionNotSet: 6,\n unequalTypification: 7,\n unequalExpressions: 8,\n unequalArgsCount: 9,\n unequalArgs: 10,\n invalidNominal: 11\n} as const;\nexport type SubstitutionErrorType = (typeof SubstitutionErrorType)[keyof typeof SubstitutionErrorType];\n","import { NodeType, type OperationSchema, OperationType } from './oss';\nimport { type NodePosition, type OssLayout, type Position2D, type Rectangle2D } from './oss-layout';\n\nexport const GRID_SIZE = 10; // pixels - size of OSS grid\nconst MIN_DISTANCE = 2 * GRID_SIZE; // pixels - minimum distance between nodes\n\nexport const OPERATION_NODE_WIDTH = 150;\nexport const OPERATION_NODE_HEIGHT = 40;\n\n/** Layout manipulations for {@link OperationSchema}. */\nexport class LayoutManager {\n public oss: OperationSchema;\n public layout: OssLayout;\n\n constructor(oss: OperationSchema, layout?: OssLayout) {\n this.oss = oss;\n if (layout) {\n this.layout = layout;\n } else {\n this.layout = this.oss.layout;\n }\n }\n\n /** Calculate insert position for a new {@link Operation} */\n newOperationPosition(position: Rectangle2D, parent: number | null, args: number[] = []): Rectangle2D {\n const result = { ...position };\n const parentNode = this.layout.find(pos => pos.nodeID === `b${parent}`) ?? null;\n const operations = this.layout.filter(pos => pos.nodeID.startsWith('o'));\n const hasArguments = args.length !== 0;\n if (hasArguments) {\n const pos = calculatePositionFromArgs(operations.filter(node => args.includes(Number(node.nodeID.slice(1)))));\n result.x = pos.x;\n result.y = pos.y;\n } else if (parentNode) {\n result.x = parentNode.x + MIN_DISTANCE;\n result.y = parentNode.y + MIN_DISTANCE;\n } else {\n const pos = this.calculatePositionForFreeOperation(result);\n result.x = pos.x;\n result.y = pos.y;\n }\n\n const siblingBlocks = this.oss.blocks.filter(block => block.parent === parent).map(block => block.nodeID);\n preventOverlap(\n result,\n this.layout.filter(node => siblingBlocks.includes(node.nodeID)),\n {\n moveX: !hasArguments,\n moveY: hasArguments\n }\n );\n\n preventOverlap(result, operations);\n this.extendParentBounds(parentNode, result);\n\n return result;\n }\n\n /** Calculate insert position for a new {@link Block} */\n newBlockPosition(position: Rectangle2D, parent: number | null, blocks: number[], operations: number[]): Rectangle2D {\n const blockNodes = blocks.map(id => this.layout.find(block => block.nodeID === `b${id}`)).filter(node => !!node);\n const operationNodes = operations\n .map(id => this.layout.find(operation => operation.nodeID === `o${id}`))\n .filter(node => !!node);\n const parentNode = this.layout.find(pos => pos.nodeID === `b${parent}`) ?? null;\n const parentID = parentNode ? parent : null;\n\n let result: Rectangle2D = { ...position };\n\n if (blockNodes.length !== 0 || operationNodes.length !== 0) {\n result = calculatePositionFromChildren(position, operationNodes, blockNodes);\n } else if (parentNode) {\n result = {\n x: parentNode.x + MIN_DISTANCE,\n y: parentNode.y + MIN_DISTANCE,\n width: position.width,\n height: position.height\n };\n } else {\n result = this.calculatePositionForFreeBlock(result);\n }\n\n if (blockNodes.length === 0 && operationNodes.length === 0) {\n const siblings = this.oss.blocks.filter(block => block.parent === parentID).map(block => block.nodeID);\n preventOverlap(\n result,\n this.layout.filter(node => siblings.includes(node.nodeID))\n );\n }\n\n this.extendParentBounds(parentNode, result);\n return result;\n }\n\n /** Calculate insert position for a new clone of {@link Operation} */\n newClonePosition(targetID: string): Rectangle2D | null {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return null;\n } else {\n return {\n x: targetNode.x + targetNode.width / 2 + GRID_SIZE,\n y: targetNode.y + targetNode.height / 2 + GRID_SIZE,\n width: OPERATION_NODE_WIDTH,\n height: OPERATION_NODE_HEIGHT\n };\n }\n }\n\n /** Update layout when parent changes */\n onChangeParent(targetID: string, newParent: string | null) {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return;\n }\n\n const parentNode = this.layout.find(pos => pos.nodeID === newParent) ?? null;\n const offset = this.calculateOffsetForParentChange(targetNode, parentNode);\n if (offset.x === 0 && offset.y === 0) {\n return;\n }\n\n targetNode.x += offset.x;\n targetNode.y += offset.y;\n\n const children = this.oss.hierarchy.expandAllOutputs([targetID]);\n const childrenPositions = this.layout.filter(pos => children.includes(pos.nodeID));\n for (const child of childrenPositions) {\n child.x += offset.x;\n child.y += offset.y;\n }\n\n this.extendParentBounds(parentNode, targetNode);\n }\n\n /** Calculate closest node to the left */\n selectLeft(targetID: string): string | null {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return null;\n }\n const operationNodes = this.layout.filter(pos => pos.nodeID !== targetID && pos.nodeID.startsWith('o'));\n const leftNodes = operationNodes.filter(pos => pos.x <= targetNode.x);\n if (leftNodes.length === 0) {\n return null;\n }\n const similarYNodes = leftNodes.filter(pos => Math.abs(pos.y - targetNode.y) <= MIN_DISTANCE);\n let closestNode: typeof targetNode | null = null;\n if (similarYNodes.length > 0) {\n closestNode = similarYNodes.reduce((prev, curr) => (curr.x > prev.x ? curr : prev));\n } else {\n closestNode = findClosestNodeByDistance(leftNodes, targetNode);\n }\n return closestNode?.nodeID ?? null;\n }\n\n /** Calculate closest node to the right */\n selectRight(targetID: string): string | null {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return null;\n }\n const operationNodes = this.layout.filter(pos => pos.nodeID !== targetID && pos.nodeID.startsWith('o'));\n const rightNodes = operationNodes.filter(pos => pos.x >= targetNode.x);\n if (rightNodes.length === 0) {\n return null;\n }\n const similarYNodes = rightNodes.filter(pos => Math.abs(pos.y - targetNode.y) <= MIN_DISTANCE);\n let closestNode: typeof targetNode | null = null;\n if (similarYNodes.length > 0) {\n closestNode = similarYNodes.reduce((prev, curr) => (curr.x < prev.x ? curr : prev));\n } else {\n closestNode = findClosestNodeByDistance(rightNodes, targetNode);\n }\n return closestNode?.nodeID ?? null;\n }\n\n /** Calculate closest node upwards */\n selectUp(targetID: string): string | null {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return null;\n }\n\n const operationNodes = this.layout.filter(pos => pos.nodeID !== targetID && pos.nodeID.startsWith('o'));\n const upperNodes = operationNodes.filter(pos => pos.y <= targetNode.y - MIN_DISTANCE);\n const targetOperation = this.oss.itemByNodeID.get(targetID);\n if (upperNodes.length === 0 || !targetOperation || targetOperation.nodeType === NodeType.BLOCK) {\n return null;\n }\n\n const predecessors = this.oss.graph.expandAllInputs([targetOperation.id]);\n const predecessorNodes = upperNodes.filter(pos => predecessors.includes(Number(pos.nodeID.slice(1))));\n\n let closestNode: typeof targetNode | null = null;\n if (predecessorNodes.length > 0) {\n closestNode = findClosestNodeByDistance(predecessorNodes, targetNode);\n } else {\n closestNode = findClosestNodeByDistance(upperNodes, targetNode);\n }\n return closestNode?.nodeID ?? null;\n }\n\n /** Calculate closest node downwards */\n selectDown(targetID: string): string | null {\n const targetNode = this.layout.find(pos => pos.nodeID === targetID);\n if (!targetNode) {\n return null;\n }\n\n const operationNodes = this.layout.filter(pos => pos.nodeID !== targetID && pos.nodeID.startsWith('o'));\n const lowerNodes = operationNodes.filter(pos => pos.y >= targetNode.y - MIN_DISTANCE);\n const targetOperation = this.oss.itemByNodeID.get(targetID);\n if (lowerNodes.length === 0 || !targetOperation || targetOperation.nodeType === NodeType.BLOCK) {\n return null;\n }\n\n const descendants = this.oss.graph.expandAllOutputs([targetOperation.id]);\n const descendantsNodes = lowerNodes.filter(pos => descendants.includes(Number(pos.nodeID.slice(1))));\n\n let closestNode: typeof targetNode | null = null;\n if (descendantsNodes.length > 0) {\n closestNode = findClosestNodeByDistance(descendantsNodes, targetNode);\n } else {\n closestNode = findClosestNodeByDistance(lowerNodes, targetNode);\n }\n return closestNode?.nodeID ?? null;\n }\n\n private extendParentBounds(parent: NodePosition | null, child: Rectangle2D) {\n if (!parent) {\n return;\n }\n const borderX = child.x + child.width + MIN_DISTANCE;\n const borderY = child.y + child.height + MIN_DISTANCE;\n parent.width = Math.max(parent.width, borderX - parent.x);\n parent.height = Math.max(parent.height, borderY - parent.y);\n }\n\n private calculatePositionForFreeOperation(initial: Position2D): Position2D {\n if (this.oss.operations.length === 0) {\n return initial;\n }\n\n const freeInputs = this.oss.operations\n .filter(\n operation =>\n operation.parent === null &&\n (operation.operation_type !== OperationType.SYNTHESIS || operation.arguments.length === 0)\n )\n .map(operation => operation.nodeID);\n let inputsPositions = this.layout.filter(pos => freeInputs.includes(pos.nodeID));\n if (inputsPositions.length === 0) {\n inputsPositions = this.layout.filter(pos => pos.nodeID.startsWith('o'));\n }\n const maxX = Math.max(...inputsPositions.map(node => node.x));\n const minY = Math.min(...inputsPositions.map(node => node.y));\n return {\n x: maxX + OPERATION_NODE_WIDTH + MIN_DISTANCE + GRID_SIZE,\n y: minY\n };\n }\n\n private calculatePositionForFreeBlock(initial: Rectangle2D): Rectangle2D {\n const rootBlocks = this.oss.blocks.filter(block => block.parent === null).map(block => block.nodeID);\n const blocksPositions = this.layout.filter(pos => rootBlocks.includes(pos.nodeID));\n if (blocksPositions.length === 0) {\n return initial;\n }\n const maxX = Math.max(...blocksPositions.map(node => node.x + node.width));\n const minY = Math.min(...blocksPositions.map(node => node.y));\n return { ...initial, x: maxX + MIN_DISTANCE, y: minY };\n }\n\n private calculateOffsetForParentChange(target: NodePosition, parent: NodePosition | null): Position2D {\n const newPosition = { ...target };\n if (parent === null) {\n const rootElements = this.oss.hierarchy.rootNodes();\n const positions = this.layout.filter(pos => rootElements.includes(pos.nodeID));\n preventOverlap(newPosition, positions);\n } else if (!rectanglesStrictOverlap(target, parent)) {\n newPosition.x = parent.x + MIN_DISTANCE;\n newPosition.y = parent.y + MIN_DISTANCE;\n\n const siblings = this.oss.hierarchy.at(parent.nodeID)?.outputs ?? [];\n const siblingsPositions = this.layout.filter(pos => siblings.includes(pos.nodeID));\n preventOverlap(newPosition, siblingsPositions);\n }\n return { x: newPosition.x - target.x, y: newPosition.y - target.y };\n }\n}\n\n// ======= Internals =======\nfunction rectanglesOverlap(a: Rectangle2D, b: Rectangle2D): boolean {\n return !(\n a.x + a.width + MIN_DISTANCE <= b.x ||\n b.x + b.width + MIN_DISTANCE <= a.x ||\n a.y + a.height + MIN_DISTANCE <= b.y ||\n b.y + b.height + MIN_DISTANCE <= a.y\n );\n}\n\nfunction rectanglesStrictOverlap(a: Rectangle2D, b: Rectangle2D): boolean {\n return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);\n}\n\nfunction preventOverlap(\n target: Rectangle2D,\n fixedRectangles: Rectangle2D[],\n options: { moveX?: boolean; moveY?: boolean } = { moveX: true, moveY: true }\n) {\n if ((!options.moveX && !options.moveY) || fixedRectangles.length === 0) {\n return;\n }\n let hasOverlap: boolean;\n do {\n hasOverlap = false;\n for (const fixed of fixedRectangles) {\n if (rectanglesOverlap(target, fixed)) {\n hasOverlap = true;\n if (options.moveX) {\n target.x += MIN_DISTANCE;\n }\n if (options.moveY) {\n target.y += MIN_DISTANCE;\n }\n break;\n }\n }\n } while (hasOverlap);\n}\n\nfunction calculatePositionFromArgs(args: NodePosition[]): Position2D {\n const maxY = Math.max(...args.map(node => node.y));\n const minX = Math.min(...args.map(node => node.x));\n const maxX = Math.max(...args.map(node => node.x));\n return {\n x: Math.ceil((maxX + minX) / 2 / GRID_SIZE) * GRID_SIZE,\n y: maxY + 2 * OPERATION_NODE_HEIGHT + MIN_DISTANCE\n };\n}\n\nfunction calculatePositionFromChildren(\n initial: Rectangle2D,\n operations: NodePosition[],\n blocks: NodePosition[]\n): Rectangle2D {\n const allNodes = [...blocks, ...operations];\n if (allNodes.length === 0) {\n return initial;\n }\n\n const left = Math.min(...allNodes.map(n => n.x)) - MIN_DISTANCE;\n const top = Math.min(...allNodes.map(n => n.y)) - MIN_DISTANCE;\n const right = Math.max(...allNodes.map(n => n.x + n.width)) + MIN_DISTANCE;\n const bottom = Math.max(...allNodes.map(n => n.y + n.height)) + MIN_DISTANCE;\n\n return {\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n };\n}\n\nfunction findClosestNodeByDistance(nodes: NodePosition[], target: NodePosition): NodePosition | null {\n let minDist = Infinity;\n let minNode = null;\n for (const curr of nodes) {\n const currDist = Math.hypot(curr.x - target.x, curr.y - target.y);\n if (currDist < minDist) {\n minDist = currDist;\n minNode = curr;\n }\n }\n return minNode;\n}\n"],"mappings":";AAUO,IAAM,WAAW;AAAA,EACtB,WAAW;AAAA,EACX,OAAO;AACT;AAUO,IAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AACX;;;ACxBO,IAAM,YAAY;AACzB,IAAM,eAAe,IAAI;AAElB,IAAM,uBAAuB;AAC7B,IAAM,wBAAw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G,SAAS,IAAI,OAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI;AAC9D,QAAM,SAAS,KAAK,IAAI,GAAG,SAAS,IAAI,OAAK,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI;AAEhE,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,OAAO,QAAQ;AAAA,IACf,QAAQ,SAAS;AAAA,EACnB;AACF;AAEA,SAAS,0BAA0B,OAAuB,QAA2C;AACnG,MAAI,UAAU;AACd,MAAI,UAAU;AACd,aAAW,QAAQ,OAAO;AACxB,UAAM,WAAW,KAAK,MAAM,KAAK,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC;AAChE,QAAI,WAAW,SAAS;AACtB,gBAAU;AACV,gBAAU;AAAA,IACZ;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module: OSS graphical representation.
|
|
3
|
+
*/
|
|
4
|
+
/** Represents XY Position. */
|
|
5
|
+
interface Position2D {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
/** Represents XY Position and dimensions. */
|
|
10
|
+
interface Rectangle2D extends Position2D {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
/** Represents a node in {@link OssLayout}. */
|
|
15
|
+
interface NodePosition {
|
|
16
|
+
nodeID: string;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
/** Represents {@link OperationSchema} layout. */
|
|
23
|
+
type OssLayout = NodePosition[];
|
|
24
|
+
|
|
25
|
+
export type { NodePosition, OssLayout, Position2D, Rectangle2D };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=oss-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Graph } from '../graph/graph.js';
|
|
2
|
+
import { LibraryItem } from './library.js';
|
|
3
|
+
import { NodePosition, OssLayout } from './oss-layout.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Module: Schema of Synthesis Operations.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Represents OSS node type. */
|
|
10
|
+
declare const NodeType: {
|
|
11
|
+
readonly OPERATION: 1;
|
|
12
|
+
readonly BLOCK: 2;
|
|
13
|
+
};
|
|
14
|
+
type NodeType = (typeof NodeType)[keyof typeof NodeType];
|
|
15
|
+
/** Represents OSS graph node. */
|
|
16
|
+
interface OssNode extends NodePosition {
|
|
17
|
+
nodeType: NodeType;
|
|
18
|
+
parent: number | null;
|
|
19
|
+
}
|
|
20
|
+
/** Represents {@link Operation} type. */
|
|
21
|
+
declare const OperationType: {
|
|
22
|
+
readonly INPUT: "input";
|
|
23
|
+
readonly SYNTHESIS: "synthesis";
|
|
24
|
+
readonly REPLICA: "replica";
|
|
25
|
+
};
|
|
26
|
+
type OperationType = (typeof OperationType)[keyof typeof OperationType];
|
|
27
|
+
/** Represents {@link Substitution} extended data. */
|
|
28
|
+
interface CstSubstituteInfo {
|
|
29
|
+
original: number;
|
|
30
|
+
substitution: number;
|
|
31
|
+
operation: number;
|
|
32
|
+
original_schema: number;
|
|
33
|
+
original_alias: string;
|
|
34
|
+
original_term: string;
|
|
35
|
+
substitution_schema: number;
|
|
36
|
+
substitution_alias: string;
|
|
37
|
+
substitution_term: string;
|
|
38
|
+
}
|
|
39
|
+
/** Represents Operation common attributes. */
|
|
40
|
+
interface OperationBase extends OssNode {
|
|
41
|
+
id: number;
|
|
42
|
+
alias: string;
|
|
43
|
+
title: string;
|
|
44
|
+
description: string;
|
|
45
|
+
operation_type: OperationType;
|
|
46
|
+
result: number | null;
|
|
47
|
+
nodeType: typeof NodeType.OPERATION;
|
|
48
|
+
has_additions: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Represents Input Operation. */
|
|
51
|
+
interface OperationInput extends OperationBase {
|
|
52
|
+
operation_type: typeof OperationType.INPUT;
|
|
53
|
+
is_import: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Represents Replica Operation. */
|
|
56
|
+
interface OperationReplica extends OperationBase {
|
|
57
|
+
operation_type: typeof OperationType.REPLICA;
|
|
58
|
+
target: number;
|
|
59
|
+
}
|
|
60
|
+
/** Represents Synthesis Operation. */
|
|
61
|
+
interface OperationSynthesis extends OperationBase {
|
|
62
|
+
operation_type: typeof OperationType.SYNTHESIS;
|
|
63
|
+
is_consolidation: boolean;
|
|
64
|
+
substitutions: CstSubstituteInfo[];
|
|
65
|
+
arguments: number[];
|
|
66
|
+
}
|
|
67
|
+
/** Represents Operation. */
|
|
68
|
+
type Operation = OperationInput | OperationReplica | OperationSynthesis;
|
|
69
|
+
/** Represents Block. */
|
|
70
|
+
interface Block extends OssNode {
|
|
71
|
+
id: number;
|
|
72
|
+
oss: number;
|
|
73
|
+
title: string;
|
|
74
|
+
description: string;
|
|
75
|
+
parent: number | null;
|
|
76
|
+
nodeType: typeof NodeType.BLOCK;
|
|
77
|
+
}
|
|
78
|
+
/** Represents item of OperationSchema. */
|
|
79
|
+
type OssItem = Operation | Block;
|
|
80
|
+
/** Represents {@link OperationSchema} statistics. */
|
|
81
|
+
interface OperationSchemaStats {
|
|
82
|
+
count_all: number;
|
|
83
|
+
count_inputs: number;
|
|
84
|
+
count_synthesis: number;
|
|
85
|
+
count_schemas: number;
|
|
86
|
+
count_owned: number;
|
|
87
|
+
count_block: number;
|
|
88
|
+
count_references: number;
|
|
89
|
+
}
|
|
90
|
+
/** Represents OperationSchema. */
|
|
91
|
+
interface OperationSchema extends LibraryItem {
|
|
92
|
+
editors: number[];
|
|
93
|
+
operations: Operation[];
|
|
94
|
+
blocks: Block[];
|
|
95
|
+
replicas: {
|
|
96
|
+
original: number;
|
|
97
|
+
replica: number;
|
|
98
|
+
}[];
|
|
99
|
+
layout: OssLayout;
|
|
100
|
+
arguments: {
|
|
101
|
+
operation: number;
|
|
102
|
+
argument: number;
|
|
103
|
+
}[];
|
|
104
|
+
substitutions: CstSubstituteInfo[];
|
|
105
|
+
graph: Graph;
|
|
106
|
+
extendedGraph: Graph;
|
|
107
|
+
hierarchy: Graph<string>;
|
|
108
|
+
schemas: number[];
|
|
109
|
+
stats: OperationSchemaStats;
|
|
110
|
+
operationByID: Map<number, Operation>;
|
|
111
|
+
blockByID: Map<number, Block>;
|
|
112
|
+
itemByNodeID: Map<string, OssItem>;
|
|
113
|
+
}
|
|
114
|
+
/** Represents substitution error description. */
|
|
115
|
+
interface SubstitutionErrorDescription {
|
|
116
|
+
errorType: SubstitutionErrorType;
|
|
117
|
+
params: string[];
|
|
118
|
+
}
|
|
119
|
+
/** Represents Substitution table error types. */
|
|
120
|
+
declare const SubstitutionErrorType: {
|
|
121
|
+
readonly invalidIDs: 0;
|
|
122
|
+
readonly incorrectCst: 1;
|
|
123
|
+
readonly invalidClasses: 2;
|
|
124
|
+
readonly invalidBasic: 3;
|
|
125
|
+
readonly invalidConstant: 4;
|
|
126
|
+
readonly typificationCycle: 5;
|
|
127
|
+
readonly baseSubstitutionNotSet: 6;
|
|
128
|
+
readonly unequalTypification: 7;
|
|
129
|
+
readonly unequalExpressions: 8;
|
|
130
|
+
readonly unequalArgsCount: 9;
|
|
131
|
+
readonly unequalArgs: 10;
|
|
132
|
+
readonly invalidNominal: 11;
|
|
133
|
+
};
|
|
134
|
+
type SubstitutionErrorType = (typeof SubstitutionErrorType)[keyof typeof SubstitutionErrorType];
|
|
135
|
+
|
|
136
|
+
export { type Block, type CstSubstituteInfo, NodeType, type Operation, type OperationInput, type OperationSchema, type OperationSchemaStats, type OperationSynthesis, OperationType, type OssItem, type SubstitutionErrorDescription, SubstitutionErrorType };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/library/oss.ts
|
|
2
|
+
var NodeType = {
|
|
3
|
+
OPERATION: 1,
|
|
4
|
+
BLOCK: 2
|
|
5
|
+
};
|
|
6
|
+
var OperationType = {
|
|
7
|
+
INPUT: "input",
|
|
8
|
+
SYNTHESIS: "synthesis",
|
|
9
|
+
REPLICA: "replica"
|
|
10
|
+
};
|
|
11
|
+
var SubstitutionErrorType = {
|
|
12
|
+
invalidIDs: 0,
|
|
13
|
+
incorrectCst: 1,
|
|
14
|
+
invalidClasses: 2,
|
|
15
|
+
invalidBasic: 3,
|
|
16
|
+
invalidConstant: 4,
|
|
17
|
+
typificationCycle: 5,
|
|
18
|
+
baseSubstitutionNotSet: 6,
|
|
19
|
+
unequalTypification: 7,
|
|
20
|
+
unequalExpressions: 8,
|
|
21
|
+
unequalArgsCount: 9,
|
|
22
|
+
unequalArgs: 10,
|
|
23
|
+
invalidNominal: 11
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
NodeType,
|
|
27
|
+
OperationType,
|
|
28
|
+
SubstitutionErrorType
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=oss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/library/oss.ts"],"sourcesContent":["/**\n * Module: Schema of Synthesis Operations.\n */\n\nimport { type Graph } from '../graph';\n\nimport { type LibraryItem } from './library';\nimport { type NodePosition, type OssLayout } from './oss-layout';\n\n/** Represents OSS node type. */\nexport const NodeType = {\n OPERATION: 1,\n BLOCK: 2\n} as const;\nexport type NodeType = (typeof NodeType)[keyof typeof NodeType];\n\n/** Represents OSS graph node. */\ninterface OssNode extends NodePosition {\n nodeType: NodeType;\n parent: number | null;\n}\n\n/** Represents {@link Operation} type. */\nexport const OperationType = {\n INPUT: 'input',\n SYNTHESIS: 'synthesis',\n REPLICA: 'replica'\n} as const;\nexport type OperationType = (typeof OperationType)[keyof typeof OperationType];\n\n/** Represents {@link Substitution} extended data. */\nexport interface CstSubstituteInfo {\n original: number;\n substitution: number;\n operation: number;\n original_schema: number;\n original_alias: string;\n original_term: string;\n substitution_schema: number;\n substitution_alias: string;\n substitution_term: string;\n}\n\n/** Represents Operation common attributes. */\ninterface OperationBase extends OssNode {\n id: number;\n alias: string;\n title: string;\n description: string;\n operation_type: OperationType;\n result: number | null;\n nodeType: typeof NodeType.OPERATION;\n has_additions: boolean;\n}\n\n/** Represents Input Operation. */\nexport interface OperationInput extends OperationBase {\n operation_type: typeof OperationType.INPUT;\n is_import: boolean;\n}\n\n/** Represents Replica Operation. */\ninterface OperationReplica extends OperationBase {\n operation_type: typeof OperationType.REPLICA;\n target: number;\n}\n\n/** Represents Synthesis Operation. */\nexport interface OperationSynthesis extends OperationBase {\n operation_type: typeof OperationType.SYNTHESIS;\n is_consolidation: boolean; // aka 'diamond synthesis'\n substitutions: CstSubstituteInfo[];\n arguments: number[];\n}\n\n/** Represents Operation. */\nexport type Operation = OperationInput | OperationReplica | OperationSynthesis;\n\n/** Represents Block. */\nexport interface Block extends OssNode {\n id: number;\n oss: number;\n title: string;\n description: string;\n parent: number | null;\n nodeType: typeof NodeType.BLOCK;\n}\n\n/** Represents item of OperationSchema. */\nexport type OssItem = Operation | Block;\n\n/** Represents {@link OperationSchema} statistics. */\nexport interface OperationSchemaStats {\n count_all: number;\n count_inputs: number;\n count_synthesis: number;\n count_schemas: number;\n count_owned: number;\n count_block: number;\n count_references: number;\n}\n\n/** Represents OperationSchema. */\nexport interface OperationSchema extends LibraryItem {\n editors: number[];\n operations: Operation[];\n blocks: Block[];\n replicas: {\n original: number;\n replica: number;\n }[];\n layout: OssLayout;\n arguments: {\n operation: number;\n argument: number;\n }[];\n substitutions: CstSubstituteInfo[];\n\n graph: Graph;\n extendedGraph: Graph;\n hierarchy: Graph<string>;\n schemas: number[];\n stats: OperationSchemaStats;\n operationByID: Map<number, Operation>;\n blockByID: Map<number, Block>;\n itemByNodeID: Map<string, OssItem>;\n}\n\n/** Represents substitution error description. */\nexport interface SubstitutionErrorDescription {\n errorType: SubstitutionErrorType;\n params: string[];\n}\n\n/** Represents Substitution table error types. */\nexport const SubstitutionErrorType = {\n invalidIDs: 0,\n incorrectCst: 1,\n invalidClasses: 2,\n invalidBasic: 3,\n invalidConstant: 4,\n typificationCycle: 5,\n baseSubstitutionNotSet: 6,\n unequalTypification: 7,\n unequalExpressions: 8,\n unequalArgsCount: 9,\n unequalArgs: 10,\n invalidNominal: 11\n} as const;\nexport type SubstitutionErrorType = (typeof SubstitutionErrorType)[keyof typeof SubstitutionErrorType];\n"],"mappings":";AAUO,IAAM,WAAW;AAAA,EACtB,WAAW;AAAA,EACX,OAAO;AACT;AAUO,IAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AACX;AA4GO,IAAM,wBAAwB;AAAA,EACnC,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,gBAAgB;AAClB;","names":[]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { AstNode } from '../parsing/ast.js';
|
|
2
|
+
import { RSCalculator, CalculatorResult, CalculatorEvaluateOptions } from '../rslang/eval/calculator.js';
|
|
3
|
+
import { Value } from '../rslang/eval/value.js';
|
|
4
|
+
import { RSForm, CstType } from './rsform.js';
|
|
5
|
+
import { RSModel, BasicsContext, BasicBinding, EvalStatus } from './rsmodel.js';
|
|
6
|
+
import '@lezer/common';
|
|
7
|
+
import '../rslang/error.js';
|
|
8
|
+
import '../rslang/semantic/typification.js';
|
|
9
|
+
import '../shared/branded.js';
|
|
10
|
+
import '../graph/graph.js';
|
|
11
|
+
import '../rslang/semantic/analyzer.js';
|
|
12
|
+
import '../rslang/semantic/value-class.js';
|
|
13
|
+
import './library.js';
|
|
14
|
+
|
|
15
|
+
/** Services for {@link RSEngine}. */
|
|
16
|
+
interface RSEngineServices {
|
|
17
|
+
setCstValue: (args: {
|
|
18
|
+
itemID: number;
|
|
19
|
+
data: {
|
|
20
|
+
target: number;
|
|
21
|
+
type: string;
|
|
22
|
+
data: Value | BasicBinding;
|
|
23
|
+
}[];
|
|
24
|
+
}) => Promise<unknown>;
|
|
25
|
+
clearValues: (args: {
|
|
26
|
+
itemID: number;
|
|
27
|
+
data: {
|
|
28
|
+
items: number[];
|
|
29
|
+
};
|
|
30
|
+
}) => Promise<unknown>;
|
|
31
|
+
}
|
|
32
|
+
/** Notifications for {@link RSEngine}. */
|
|
33
|
+
interface RSEngineNotifications {
|
|
34
|
+
onInvalidSetValue: () => void;
|
|
35
|
+
onCalculationSuccess: (timeSpent: string) => void;
|
|
36
|
+
onEvaluationError: (message: string) => void;
|
|
37
|
+
}
|
|
38
|
+
/** Calculation engine for {@link RSModel}. */
|
|
39
|
+
declare class RSEngine {
|
|
40
|
+
modelID: number;
|
|
41
|
+
schema: RSForm | null;
|
|
42
|
+
data: RSModel | null;
|
|
43
|
+
calculator: RSCalculator;
|
|
44
|
+
basics: BasicsContext;
|
|
45
|
+
private services;
|
|
46
|
+
private notifications;
|
|
47
|
+
private invalidData;
|
|
48
|
+
private calculatedSet;
|
|
49
|
+
private valueSubscribers;
|
|
50
|
+
private statusSubscribers;
|
|
51
|
+
private changeSubscribers;
|
|
52
|
+
private changeGeneration;
|
|
53
|
+
private pendingChange;
|
|
54
|
+
private coalescedEmitTimeout;
|
|
55
|
+
constructor(modelID: number, services: RSEngineServices, notifications?: RSEngineNotifications | null);
|
|
56
|
+
/** Updates data for {@link RSEngine}. */
|
|
57
|
+
loadData(schema: RSForm, model: RSModel): void;
|
|
58
|
+
/** Updates services for {@link RSEngine}. */
|
|
59
|
+
updateServices(services: RSEngineServices): void;
|
|
60
|
+
/** Updates notifications for {@link RSEngine}. */
|
|
61
|
+
updateNotifications(notifications: RSEngineNotifications | null): void;
|
|
62
|
+
/** Gets value of {@link Constituenta}. */
|
|
63
|
+
getCstValue(cstID: number): Value | null;
|
|
64
|
+
/** Gets status of {@link Constituenta}. */
|
|
65
|
+
getCstStatus(cstID: number): EvalStatus;
|
|
66
|
+
/** Subscribe to value change of {@link Constituenta}. */
|
|
67
|
+
subscribeValue(cstID: number, callbackFn: () => void): () => void;
|
|
68
|
+
/** Subscribe to status change of {@link Constituenta}. */
|
|
69
|
+
subscribeStatus(cstID: number, callbackFn: () => void): () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Subscribe to any engine change that can affect evaluation (values, status, or loaded data).
|
|
72
|
+
*/
|
|
73
|
+
subscribeChanges(callbackFn: () => void): () => void;
|
|
74
|
+
/** Monotonic counter bumped whenever the engine emits a change to {@link RSEngine.subscribeChanges} listeners. */
|
|
75
|
+
getChangeGeneration(): number;
|
|
76
|
+
/**
|
|
77
|
+
* Runs pending {@link RSEngine.subscribeChanges} notifications immediately and clears the coalescing queue.
|
|
78
|
+
* Use after a synchronous batch of engine updates when listeners must observe a bumped {@link getChangeGeneration}
|
|
79
|
+
* in the same turn.
|
|
80
|
+
*/
|
|
81
|
+
flushPendingChanges(): void;
|
|
82
|
+
/** Sets value for {@link Constituenta} from {@link Value}. */
|
|
83
|
+
setStructureValue(cstID: number, data: Value): Promise<void>;
|
|
84
|
+
/** Sets value for {@link Constituenta} from {@link BasicBinding}. */
|
|
85
|
+
setBasicValue(cstID: number, data: BasicBinding): Promise<void>;
|
|
86
|
+
/** Resets value for {@link Constituenta}. */
|
|
87
|
+
resetValue(cstID: number): Promise<void>;
|
|
88
|
+
/** Evaluates expression for {@link RSEngine}. */
|
|
89
|
+
evaluateExpression(expression: string, cstType: CstType): CalculatorResult;
|
|
90
|
+
/** Evaluates AST for {@link RSEngine}. */
|
|
91
|
+
evaluateAst(ast: AstNode, options?: CalculatorEvaluateOptions): CalculatorResult;
|
|
92
|
+
/** Calculates value for {@link Constituenta}. */
|
|
93
|
+
calculateCst(cstID: number): CalculatorResult;
|
|
94
|
+
/** Recalculate model for all inferrable expressions. */
|
|
95
|
+
recalculateAll(): void;
|
|
96
|
+
/** Notify subscribers about value and status change of {@link Constituenta}. */
|
|
97
|
+
private notifyCst;
|
|
98
|
+
/** Notify all subscribers about value change. */
|
|
99
|
+
private notifyValue;
|
|
100
|
+
/** Notify all subscribers about status change. */
|
|
101
|
+
private notifyStatus;
|
|
102
|
+
/** Notify all subscribers about value and status change. */
|
|
103
|
+
private notifyAll;
|
|
104
|
+
private scheduleCoalescedEmitChange;
|
|
105
|
+
private emitChange;
|
|
106
|
+
private prepareAst;
|
|
107
|
+
private prepareValues;
|
|
108
|
+
private setupEmptySets;
|
|
109
|
+
private collectChanged;
|
|
110
|
+
private onChangeDefinitions;
|
|
111
|
+
private cascadeReset;
|
|
112
|
+
private prepareEvaluation;
|
|
113
|
+
private recalculateInternal;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { RSEngine, type RSEngineNotifications, type RSEngineServices };
|