Skip to Content

Type expansion outcomes

@Cat class methods

With reflect-metadata enabled, parameter types and the method return type are read from decorator metadata at registration time. AST merge can still refine shapes when expandParamTypes is enabled.

cat / catModule

At registration time, TypeScript erases most static types for plain functions — defaults are:

  • params[].type'unknown' unless you pass options.params.
  • declaredReturn'unknown' unless you pass options.declaredReturn.

AST backfill

When bootstrap runs runASTScanner + mergeASTIntoRegistry, matching registry keys receive checker-derived params and declaredReturn strings from source.

Manual hints

Use CatFunctionOptions.params, declaredReturn, and paramsJsonSchema when you cannot run bootstrap or need to override specific entries.

See also