Skip to content

Type Alias: ExpressionDto

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ExpressionDto

ExpressionDto = { name: string; type: "Variable"; } | { type: "Literal"; value: FunctionValueDto; } | { left: ExpressionDto; op: BinaryOperatorDto; right: ExpressionDto; type: "BinaryOp"; } | { arguments: ExpressionDto[]; functionName: string; type: "FunctionCall"; } | { op: UnaryOperatorDto; operand: ExpressionDto; type: "UnaryOp"; } | { branches: ConditionalBranchDto[]; default?: ExpressionDto | null; type: "Conditional"; } | { items: ExpressionDto[]; type: "List"; } | { path: string[]; type: "PathAccess"; variable: string; }

Defined in: src/types/functions.ts:72

Arithmetic/logical expression used in function bodies and guards.

{ name: string; type: "Variable"; }


{ type: "Literal"; value: FunctionValueDto; }


{ left: ExpressionDto; op: BinaryOperatorDto; right: ExpressionDto; type: "BinaryOp"; }


{ arguments: ExpressionDto[]; functionName: string; type: "FunctionCall"; }


{ op: UnaryOperatorDto; operand: ExpressionDto; type: "UnaryOp"; }


{ branches: ConditionalBranchDto[]; default?: ExpressionDto | null; type: "Conditional"; }

branches: ConditionalBranchDto[]

Branches, tried in order; the first whose when holds supplies the value.

optional default?: ExpressionDto | null

The value when no branch holds. null when the conditional has none.

type: "Conditional"


{ items: ExpressionDto[]; type: "List"; }

A list built from expressions.


{ path: string[]; type: "PathAccess"; variable: string; }

A feature path read from a bound variable (variable.path[0].path[1]…).

A recursive tagged union. BinaryOp contains nested ExpressionDto children. FunctionCall allows calling other user-defined functions within an expression.