Interface CreateFunctionTypeDetails<T>

Contains properties which are be relevant for all types to create, i.e. it is used for specifying details of all types to create.

interface CreateFunctionTypeDetails<T> {
    associatedLanguageNode?: unknown;
    functionName: string;
    inferenceRuleForCalls?: InferFunctionCall<T>;
    inferenceRuleForDeclaration?: (languageNode: unknown) => boolean;
    inputParameters: CreateParameterDetails[];
    outputParameter: undefined | CreateParameterDetails;
    validationForCall?: FunctionCallValidationRule<T>;
}

Type Parameters

  • T

Hierarchy (View Summary)

Properties

associatedLanguageNode?: unknown

A node from the language might be associated with the new type to create, e.g. the declaration node in the AST (e.g. a FunctionDeclarationNode is associated with the corresponding FunctionType).

functionName: string
inferenceRuleForCalls?: InferFunctionCall<T>

for function calls => returns the return type of the function

inferenceRuleForDeclaration?: (languageNode: unknown) => boolean

for function declarations => returns the funtion type (the whole signature including all names)

inputParameters: CreateParameterDetails[]
outputParameter: undefined | CreateParameterDetails

The order of parameters is important!

validationForCall?: FunctionCallValidationRule<T>

This validation will be applied to all language nodes which represent calls of the functions.