Type Alias ValidationChecks<T>

ValidationChecks<T>: {
    [K in keyof T]?: T[K] extends AstNode
        ? ValidationCheck<T[K]> | ValidationCheck<T[K]>[]
        : never
} & {
    AstNode?: ValidationCheck<AstNode> | ValidationCheck<AstNode>[];
}

A utility type for associating non-primitive AST types to corresponding validation checks. For example:

  const checks: ValidationChecks<StatemachineAstType> = {
State: validator.checkStateNameStartsWithCapital
};

If an AST type does not extend AstNode, e.g. if it describes a union of string literals, that type's name must not occur as a key in objects of type ValidationCheck<...>.

Type Parameters

  • T

    a type definition mapping language specific type names (keys) to the corresponding types (values)