Interface InferClassLiteral<Specifics, T>

Depending on whether the class is structurally or nominally typed, different values might be specified, e.g. 'inputValuesForFields' could be empty for nominal classes.

interface InferClassLiteral<
    Specifics extends TypirSpecifics,
    T extends Specifics["LanguageType"] = Specifics["LanguageType"],
> {
    filter?: (languageNode: Specifics["LanguageType"]) => languageNode is T;
    inputValuesForFields: (languageNode: T) => Map<string, Specifics>;
    languageKey?: string | string[];
    matching?: (languageNode: T, typeToInfer: ClassType) => boolean;
    skipThisRuleIfThisTypeAlreadyExists?:
        | boolean
        | (existingType: ClassType) => boolean;
    validation?:
        | InferCurrentTypeValidationRule<ClassType, Specifics, T>
        | InferCurrentTypeValidationRule<ClassType, Specifics, T>[];
}

Type Parameters

Hierarchy (View Summary)

Properties

filter?: (languageNode: Specifics["LanguageType"]) => languageNode is T
inputValuesForFields: (languageNode: T) => Map<string, Specifics>
languageKey?: string | string[]
matching?: (languageNode: T, typeToInfer: ClassType) => boolean
skipThisRuleIfThisTypeAlreadyExists?:
    | boolean
    | (existingType: ClassType) => boolean

This validation will be applied to all language nodes for which the current type is inferred according to this inference rule. This validation is specific for this inference rule and this inferred type.