Possibility
API / publicodes / Possibility
type Possibility = object;
Defined in: packages/core/src/parsePossibilité.ts:11
Represents a single possibility value in a “une possibilité” mechanism. It can be a constant value (string or number), or a reference to an existing rule.
Type declaration
Name | Type | Description | Defined in |
---|---|---|---|
dottedName ? | string | The dotted name of the referenced rule, if the possibility is a reference. | packages/core/src/parsePossibilité.ts:43 |
nodeValue | string | number | The value of the possibility, as it appears in the evaluated node. | packages/core/src/parsePossibilité.ts:34 |
notApplicable | ASTNode | If the possibility is a reference, this contains a node that evaluates the applicability conditions of the referenced rule. Otherwise, it contains a constant node evaluating to false (as constant possibility are always applicable, for now) | packages/core/src/parsePossibilité.ts:17 |
publicodesValue | string | Representation of this possibility’s value in publicodes syntax, can be used in Engine.setSituation to set the value of the rule. String are wrapped in single quotes, and numbers are represented as number followed by an optional unit Example "'value'" "42 m/s" | packages/core/src/parsePossibilité.ts:29 |
type | "number" | "string" | "reference" | - | packages/core/src/parsePossibilité.ts:12 |
unit ? | Unit | The unit of the possibility value, if it is a number See serializeUnit | packages/core/src/parsePossibilité.ts:39 |