Skip to content

[T] OnInfoHook

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

Library hook returning extra information about a given type.

A library provides this by exporting a $onInfo function (typically via defineInfoHook). Unlike $onValidate, this hook 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).

This hook is gated behind the experimental type-info-hook compiler feature.

ParameterType
contextInfoContext

TypeInfo | undefined