[F] defineInfoHook
function defineInfoHook(hook): OnInfoHook;Define a $onInfo hook that contributes extra information about types to IDE hover
documentation and tooling. This helper only provides typing; export the result as $onInfo
from your library’s entry point.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
hook | OnInfoHook |
Returns
Section titled “Returns”Example
Section titled “Example”export const $onInfo = defineInfoHook(({ program, target }) => { if (target.kind !== "Operation") return undefined; return [{ content: `Operation ${target.name}` }];});