typescript-extract-type.ts

Per-declaration extractors for TypeScript type aliases, interfaces, and enums.

extractTypeInfo handles type aliases and interfaces (including index/method/ call/construct signatures and intersection filtering). extractEnumInfo handles regular and const enums. Both mutate a DeclarationJsonBuild with rich metadata derived from the TypeScript checker. Called by analyzeDeclaration in typescript-exports.ts once kind dispatch is settled.

Type-alias property walking (named properties, index/call/construct signatures) lives in typescript-extract-type-properties.ts to keep this module focused on top-level dispatch.

@see typescript-extract-shared.ts for shared helpers @see typescript-extract-type-properties.ts for type-alias property walking

view source

Declarations
#

2 declarations

extractEnumInfo
#

typescript-extract-type.ts view source

(node: Node, declaration: DeclarationJsonBuild, ctx: ExtractContext): void import {extractEnumInfo} from 'svelte-docinfo/typescript-extract-type.js';

Extract enum member information from an enum declaration.

Iterates node.members to extract each enum member's name, initializer value, type, and JSDoc. Members are represented as MemberJson with kind 'variable'.

node

type Node

declaration

ctx

returns

void

mutates

  • declaration — adds members and typeSignature

extractTypeInfo
#

typescript-extract-type.ts view source

(node: Node, declaration: DeclarationJsonBuild, ctx: ExtractContext): void import {extractTypeInfo} from 'svelte-docinfo/typescript-extract-type.js';

Extract type/interface information with rich property metadata.

node

the declaration AST node

type Node

declaration

the declaration to populate

ctx

the extraction pass's context

returns

void

mutates

  • declaration — adds typeSignature, genericParams, extends, externalTypes, members (and `partial: true` on extraction failure)

Depends on
#

Imported by
#