This is a TypeScript exported class, function, type and documentation parser.
It outputs everything needed to automatically generate documentation and better understand a project's public API.
Information is extracted using TypeScript's Compiler API.
.memberList IdentifierSpec[]
Public properties.
.doc string
JSDoc comment.
Hooks to change how parts of type definitions are converted to strings.
Source code: <>
Properties:
.unknown? FormatHook
.ref? FormatHook
.array? FormatHook
.union? FormatHook
.intersection? FormatHook
.generic? FormatHook
Function or method with any number of overloaded signatures.
Source code: <>
Methods:
new( ) ⇒ FunctionSpec <>
▪ spec SymbolSpec
Properties:
.name string
Function name.
.signatureList SignatureSpec[]
List of signatures, one for each overload.
Property, function / method parameter or variable.
Source code: <>
Properties:
.name string
Identifier name.
.pos SourcePos
.type TypeSpec
Type definition.
.value? any
Literal type value
.optional boolean
Interface members and function / method parameters may be optional.
.doc string
JSDoc comment.
Index signature.
Source code: <>
Properties:
.signature TypeSpec
Singature type.
.value TypeSpec
Value type
Module or source file.
Source code: <>
Methods:
.isEmpty( ) ⇒ boolean <>
Test if nothing is exported.
Properties:
.enumList EnumSpec[]
Definitions of exported enums.
.classList ClassSpec[]
Definitions of exported classes.
.interfaceList ClassSpec[]
Definitions of exported interfaces.
.functionList FunctionSpec[]
Definitions of exported functions.
.variableList IdentifierSpec[]
Definitions of exported variables.
Main parser class with public methods, also holding its internal state.
Source code: <>
Methods:
.parseConfig( ) ⇒ ParsedCommandLine <>
Parse a tsconfig.json file using TypeScript services API.
▪ tsconfigPath string
.parse( ) ⇒ ModuleSpec[] <>
Parse a TypeScript project using TypeScript services API and configuration.
▪ config ParsedCommandLine
▫ nameFilter? (pathName: string) => boolean
▫ extension? string
Source code: <>
Properties:
.name? string
.symbol? Symbol
.class? ClassSpec
.enum? EnumSpec
Function or method signature defining input and output types.
Source code: <>
Methods:
new( ) ⇒ SignatureSpec <>
▪ pos SourcePos
▪ returnType TypeSpec
▪ doc string
Properties:
.pos SourcePos
.paramList IdentifierSpec[]
List of parameters.
.returnType TypeSpec
Return type definition.
.doc string
JSDoc comment.
Source code: <>
Properties:
.sourcePath string
.firstLine number
.lastLine number
Type definition.
Source code: <>
Methods:
.format( ) ⇒ string <>
Convert to string, with optional hooks replacing default formatting code.
▫ hooks? FormatHooks
▫ needParens? boolean
Properties:
.name string
Name of the type, only present if not composed of other type or class etc.
.value? string | number
Value of the type, only present if literal type
.ref RefSpec
Definition of what the type points to, if available.
.unionOf TypeSpec[]
If the type is a union, list of the possible types.
.intersectionOf TypeSpec[]
If the type is an intersection, list of the possible types.
.arrayOf TypeSpec
If the type is an array, its element type.
.argumentList TypeSpec[]
Arguments of a generic type.