Skip to content
internal/extractors/typescript
On this page

Reading TypeScript and JavaScript source: the exported functions, classes, interfaces and type aliases, with the JSDoc or TSDoc written above each one.

#internal/extractors/typescript

#internal/extractors/typescript

Package typescript reads TypeScript and JavaScript source for selfdoc.

It answers directives by scanning source text with regular expressions rather than by parsing it: no TypeScript toolchain is required, and a file that does not compile still documents. What it reads out of a file is the module's own JSDoc block, the declarations it exports (functions, classes, interfaces, type aliases, enums and constants, plus re-export lists), an interface's or object type's fields, the describe/it/test blocks of a test file, and the help or usage string constants of a command-line entry point.

The JSDoc parser is exported, because the Svelte extractor documents a component from the JSDoc block inside its

Search