Got basic typescript tools working

This commit is contained in:
Stefan Zermatten
2022-10-09 17:33:43 +02:00
parent aa8f2d230d
commit 5cb835c536
5 changed files with 362 additions and 18 deletions

View File

@@ -1,15 +1,30 @@
import { EJSON } from 'meteor/ejson';
import createGraph from 'ngraph.graph';
import createGraph, { Graph } from 'ngraph.graph';
import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js';
interface CreatureProperty {
_id: string;
type: string;
}
export default class CreatureComputation {
constructor(properties, creature, variables){
originalPropsById: object;
propsById: object;
propsWithTag: object;
scope: object;
props: Array<CreatureProperty>;
dependencyGraph: Graph;
errors: Array<object>;
creature: object;
variables: object;
constructor(properties: Array<CreatureProperty>, creature: object, variables: object) {
// Set up fields
this.originalPropsById = {};
this.propsById = {};
this.originalPropsById = {};
this.propsById = {};
this.propsWithTag = {};
this.scope = {};
this.props = properties;
this.props = properties;
this.dependencyGraph = createGraph();
this.errors = [];
this.creature = creature;

View File

@@ -12,7 +12,7 @@ import computeToggleDependencies from './buildComputation/computeToggleDependenc
import linkCalculationDependencies from './buildComputation/linkCalculationDependencies.js';
import linkTypeDependencies from './buildComputation/linkTypeDependencies.js';
import computeSlotQuantityFilled from './buildComputation/computeSlotQuantityFilled.js';
import CreatureComputation from './CreatureComputation.js';
import CreatureComputation from './CreatureComputation.ts';
import removeSchemaFields from './buildComputation/removeSchemaFields.js';
/**