typescript

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package typescript implements import extraction for TypeScript and JavaScript source files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor extracts import facts from TypeScript/JavaScript source files using tree-sitter with the TSX grammar (superset of TS, JS, and JSX).

func New

func New() *Extractor

New returns a new TypeScript/JavaScript extractor.

func (*Extractor) Clone

func (e *Extractor) Clone() extractor.Extractor

func (*Extractor) Extensions

func (e *Extractor) Extensions() []string

func (*Extractor) Extract

func (e *Extractor) Extract(filePath string, content []byte) ([]model.ImportFact, error)

Extract parses TypeScript/JavaScript source and returns all import facts.

func (*Extractor) ExtractDefinitions

func (e *Extractor) ExtractDefinitions(content []byte, symbolNames []string) []string

ExtractDefinitions returns signature strings for the given symbol names using tree-sitter to find function, class, interface, type alias, and variable declarations.

func (*Extractor) Language

func (e *Extractor) Language() string

Jump to

Keyboard shortcuts

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