typescript-extract-function.ts

Per-declaration extractors for TypeScript functions and variables.

Both extractFunctionInfo and extractVariableInfo mutate a DeclarationJsonBuild with rich metadata derived from the TypeScript checker. Called by analyzeDeclaration in typescript-exports.ts once kind dispatch is settled.

@see typescript-extract-shared.ts for shared helpers (signatures, overloads, generics, reactivity)

Declarations
#

2 declarations

view source

extractFunctionInfo
#

typescript-extract-function.ts view source

(node: Node, symbol: Symbol, checker: TypeChecker, declaration: DeclarationJsonBuild, tsdoc: TsdocParsedComment | undefined, diagnostics: ({ ...; } | ... 12 more ... | { ...; })[]): void

Extract function/method information including parameters with descriptions and default values.

node

the declaration AST node

type Node

symbol

the TypeScript symbol

type Symbol

checker

TypeScript type checker

type TypeChecker

declaration

the declaration to populate

tsdoc

parsed TSDoc comment (if available)

type TsdocParsedComment | undefined

diagnostics

diagnostics collector for non-fatal issues

type ({ symbolName: string; file: string; message: string; severity: "error" | "warning"; kind: "type_extraction_failed"; line?: number | undefined; column?: number | undefined; } | { functionName: string; ... 5 more ...; column?: number | undefined; } | ... 11 more ... | { ...; })[]

returns

void

extractVariableInfo
#

typescript-extract-function.ts view source

(node: Node, symbol: Symbol, checker: TypeChecker, declaration: DeclarationJsonBuild, diagnostics: ({ symbolName: string; file: string; ... 4 more ...; column?: number | undefined; } | ... 12 more ... | { ...; })[]): void

Extract variable information.

node

the declaration AST node

type Node

symbol

the TypeScript symbol

type Symbol

checker

TypeScript type checker

type TypeChecker

declaration

the declaration to populate

diagnostics

diagnostics collector for non-fatal issues

type ({ symbolName: string; file: string; message: string; severity: "error" | "warning"; kind: "type_extraction_failed"; line?: number | undefined; column?: number | undefined; } | { functionName: string; ... 5 more ...; column?: number | undefined; } | ... 11 more ... | { ...; })[]

returns

void

Depends on
#

Imported by
#