Interface ValidationRuleLifecycle<Specifics, RootType, InputType>

Describes a complex validation rule which has a state. 'beforeValidation' can be used to set-up some data structures like a map, in order to store some information which are calculated during 'validation', which are finally evaluated in 'afterValidation'.

interface ValidationRuleLifecycle<
    Specifics extends TypirSpecifics,
    RootType extends Specifics["LanguageType"] = Specifics["LanguageType"],
    InputType extends Specifics["LanguageType"] = Specifics["LanguageType"],
> {
    afterValidation?: (
        languageRoot: RootType,
        accept: ValidationProblemAcceptor<Specifics>,
        typir: TypirServices<Specifics>,
    ) => void;
    beforeValidation?: (
        languageRoot: RootType,
        accept: ValidationProblemAcceptor<Specifics>,
        typir: TypirServices<Specifics>,
    ) => void;
    validation: ValidationRuleFunctional<Specifics, InputType>;
}

Type Parameters

Implemented by

Properties

afterValidation?: (
    languageRoot: RootType,
    accept: ValidationProblemAcceptor<Specifics>,
    typir: TypirServices<Specifics>,
) => void
beforeValidation?: (
    languageRoot: RootType,
    accept: ValidationProblemAcceptor<Specifics>,
    typir: TypirServices<Specifics>,
) => void