typescript

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package typescript implements the TypeScript language extractor.

Mirrors src/main/java/.../intelligence/extractor/typescript/TypeScriptLanguageExtractor.java. The tree-sitter TypeScript grammar parses .ts/.tsx and is also used (via the typescript alias in the orchestrator) for plain JavaScript files — the grammar is a superset.

Capabilities:

  • METHOD nodes: emit CALLS edges for call_expression children of the matching function_declaration / method_definition / arrow_function. Callee names come from the call_expression's `function` field.
  • MODULE nodes: emit a `module_exports` type-hint listing every export_statement declaration in the file.

Confidence: PARTIAL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

Extractor implements LanguageExtractor for TypeScript. Stateless.

func New

func New() *Extractor

New returns a TypeScript extractor.

func (*Extractor) Extract

func (e *Extractor) Extract(ctx extractor.Context, node *model.CodeNode) extractor.Result

Extract dispatches by node kind: METHOD -> call edges, MODULE -> exports hint. Single-node convenience wrapper; production paths use ExtractFromTree.

func (*Extractor) ExtractFromTree

func (e *Extractor) ExtractFromTree(ctx extractor.Context, tree *parser.Tree, nodes []*model.CodeNode) []extractor.Result

ExtractFromTree walks the pre-parsed tree once per input node, returning one Result per node in matching order. tree may be nil.

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "typescript".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL