typescript-extract-class.ts

Per-declaration extractor for TypeScript classes.

extractClassInfo mutates a DeclarationJsonBuild with rich metadata derived from the class declaration: heritage clauses, generic parameters, properties, methods, constructors, and accessor pairs (getters/setters merged by name). Called by analyzeDeclaration in typescript-exports.ts once kind dispatch is settled.

@see typescript-extract-shared.ts for shared helpers

view source

Declarations
#

extractClassInfo
#

typescript-extract-class.ts view source

(node: Node, checker: TypeChecker, declaration: DeclarationJsonBuild, diagnostics: ({ symbolName: string; file: string; message: string; severity: "error" | "warning"; kind: "type_extraction_failed"; line?: number | undefined; column?: number | undefined; } | ... 12 more ... | { ...; })[]): void import {extractClassInfo} from 'svelte-docinfo/typescript-extract-class.js';

Extract class information with rich member metadata.

node

the declaration AST node

type Node

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

mutates

  • declaration — adds extends, implements, genericParams, members

Depends on
#

Imported by
#