strictcli v0.39.0 /typescript/src/describe
On this page

describe.ts -- dev-only self-dump of the TS public API surface, shape- aligned with the conformance/describe_go/main.go reference dumper's output.

#typescript/src/describe

#typescript/src/describe

describe.ts -- dev-only self-dump of the TS public API surface, shape- aligned with the conformance/describe_go/main.go reference dumper's output. Sections cover schema_version, package, structs, option_constructors, functions, methods, and constants. TypeScript has no runtime type info, so instead of reflection the surface is a hand-maintained registry (SURFACE below) whose accuracy is enforced by tests/describe.test.ts in both directions: every listed name must exist on the real exports (runtime typeof checks plus compile-time keyof equality assertions), and every src/index.ts export must be listed.

TS analogs of the Go dumper's sections:

  • structs: member lists of exported interfaces/classes that carry data

(spec/option object types owned by a factory live under that factory's option_keys instead of here).

  • option_constructors: factories that take an options/spec object, with

the object's keys; flag/arg additionally record per-carrier applicability (never-typed keys are inexpressible for that carrier).

  • functions: exported value functions that take only positional args.
  • methods: receiver + name for interface/class method surfaces.
  • constants: exported non-function values.
  • classes / types / check_system: TS-only sections. classes are exported

class values, types are the type-only index.ts exports (no Go analog -- Go types are all values of the AST), check_system is the flat list of check-system public names.

This module is intentionally NOT exported through index.ts: it is dev tooling, not public API. Bin-style usage: node dist/describe.js

#SCHEMA_VERSION

TS typescript
export const SCHEMA_VERSION = 1

#SURFACE

TS typescript
export const SURFACE =

The single source of truth for the TS public API surface. Set-like name lists (option_keys, per_carrier, functions, classes, types, check_system) are kept alphabetically sorted; struct member lists are in declaration order (mirroring the Go dumper, which sorts every list except struct fields). Phantom type-only members that never exist at runtime (_out) are listed because keyof sees them; tests filter them for runtime key checks.

#SurfaceDump

TS typescript
export interface SurfaceDump

JSON dump shape (the plain-object mirror of SURFACE, deterministically sorted).

#describeSurface

TS typescript
export function describeSurface(): SurfaceDump

Returns the surface as a deterministically-sorted plain object, applying the Go dumper's sort discipline: every list is sorted by name before emission EXCEPT struct member lists, which retain declaration order.

#describeSurfaceJson

TS typescript
export function describeSurfaceJson(): string

The dump as pretty-printed JSON with a trailing newline (bin output).

Search