Interface Evaluable

Evaluable

interface Evaluable {
    type: EvaluableType;
    evaluate(ctx: Context): Result;
    serialize(options: Options): Input;
    simplify(ctx: Context, strictKeys?: string[] | Set<string>, optionalKeys?: string[] | Set<string>): Result | Evaluable;
    toString(): string;
}

Properties

type: EvaluableType

Methods

  • Serializes the Evaluable to its input format.

    Parameters

    • options: Options

      parser options

    Returns Input

  • Simplifies this Evaluable when possible.

    Parameters

    • ctx: Context

      context for the evaluation

    • OptionalstrictKeys: string[] | Set<string>

      keys to be considered present even if they are not present in the context. Passing as a Set is recommended for performance reasons.

    • OptionaloptionalKeys: string[] | Set<string>

      keys to be considered not present unless they are in the context or in strictKeys; when strictKeys is undefined and optionalKeys is an array, every key that is not in optionalKeys is considered to be present and thus will be evaluated. Passing as a Set is recommended for performance reasons.

    Returns Result | Evaluable

    simplified value or itself

  • Get the strict representation of the evaluable expression.

    Returns string