Skip to content

[T] TypeInfoProvider

type TypeInfoProvider = (context) => TypeInfo | undefined;

Provides extra information about a given type.

A library registers one by exporting a $provideTypeInfo function (typically via defineTypeInfoProvider). Unlike the $onValidate lifecycle hook, a provider is never run during compilation and must not mutate the type graph. It is invoked lazily and on demand (e.g. by the language server when computing hover documentation, or by tooling querying Program.getTypeInfo).

Providers are gated behind the experimental type-info-provider compiler feature.

ParameterType
contextTypeInfoContext

TypeInfo | undefined