typescript-extract-function.ts

internal

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 also

  • ``typescript-extract-shared.ts`` for shared helpers (signatures, overloads, generics, reactivity)

view source

Declarations
#

2 declarations

extractFunctionInfo
#

typescript-extract-function.ts view source

internal

Used by `analyzeDeclaration` — not part of the public barrel export.

(node: Node, symbol: Symbol, declaration: DeclarationJsonBuild, tsdoc: TsdocParsedComment | undefined, ctx: ExtractContext): void import {extractFunctionInfo} from 'svelte-docinfo/typescript-extract-function.js';

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

node

the declaration AST node

type Node

symbol

the TypeScript symbol

type Symbol

declaration

the declaration to populate

tsdoc

parsed TSDoc comment (if available)

type TsdocParsedComment | undefined

ctx

the extraction pass's context

returns

void

mutates

  • declaration — adds typeSignature, returnType, returnDescription, parameters, genericParams, overloads (and `partial: true` on signature failure)
  • ctx.diagnostics — adds `signature_analysis_failed` diagnostic on checker error

extractVariableInfo
#

typescript-extract-function.ts view source

internal

Used by `analyzeDeclaration` — not part of the public barrel export.

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

Extract variable information.

node

the declaration AST node

type Node

symbol

the TypeScript symbol

type Symbol

declaration

the declaration to populate

ctx

the extraction pass's context

returns

void

mutates

  • declaration — adds typeSignature, reactivity (when initialized with a Svelte rune)

Depends on
#

Imported by
#