Skip to main content

TypeScript

Struct TypeScript 

Source
pub struct TypeScript { /* private fields */ }
Expand description

The TypeScript language implementation.

Implementations§

Source§

impl TypeScript

Source

pub fn new(build_command: Option<String>) -> Self

Trait Implementations§

Source§

impl BodyAnalysisSemantics for TypeScript

Source§

fn analyze_changed_body( &self, old_body: &str, new_body: &str, func_name: &str, file_path: &str, ) -> Vec<BodyAnalysisResult>

Run deterministic analysis on a changed function’s body. Read more
Source§

impl Clone for TypeScript

Source§

fn clone(&self) -> TypeScript

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeScript

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TypeScript

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HierarchySemantics<TsSymbolData> for TypeScript

Source§

fn family_source_paths( &self, repo: &Path, git_ref: &str, family_name: &str, ) -> Vec<String>

Get file paths belonging to a component family directory. Read more
Source§

fn family_name_from_symbols( &self, symbols: &[&Symbol<TsSymbolData>], ) -> Option<String>

Get a human-readable family name from a group of symbols. Read more
Source§

fn is_hierarchy_candidate(&self, sym: &Symbol<TsSymbolData>) -> bool

Whether a symbol is a candidate for hierarchy inference. Read more
Source§

fn cross_family_relationships( &self, repo: &Path, git_ref: &str, ) -> Vec<(String, String, String)>

Detect cross-family relationships (e.g., React context imports). Read more
Source§

fn compute_deterministic_hierarchy( &self, new_surface: &ApiSurface<TsSymbolData>, structural_changes: &[StructuralChange], ) -> HashMap<String, HashMap<String, Vec<ExpectedChild>>>

Compute component hierarchy deterministically. Read more
Source§

fn related_family_content( &self, repo: &Path, git_ref: &str, family_name: &str, relationship_names: &[String], ) -> Option<String>

Read related component signatures for cross-family context. Read more
Source§

fn min_components_for_hierarchy(&self) -> usize

Minimum number of exported types for a family to qualify for hierarchy inference. Default: 2.
Source§

impl Language for TypeScript

Source§

const RENAMEABLE_SYMBOL_KINDS: &'static [SymbolKind]

Symbol kinds that represent type definitions eligible for rename inference. TypeScript: &[SymbolKind::Interface, SymbolKind::Class] Go: &[SymbolKind::Struct, SymbolKind::Interface]
Source§

const NAME: &'static str = "typescript"

Language identifier for serialization dispatch.
Source§

const MANIFEST_FILES: &'static [&'static str]

Manifest file path(s) for this language’s package system. Read more
Source§

const SOURCE_FILE_PATTERNS: &'static [&'static str]

Source file glob patterns for git diff --name-only filtering. Read more
Source§

type SymbolData = TsSymbolData

Per-symbol metadata type carried in Symbol<M>.language_data. Read more
Source§

type Category = TsCategory

Behavioral change categories for this language.
Source§

type ManifestChangeType = TsManifestChangeType

Manifest change types for this language’s package system.
Source§

type Evidence = TsEvidence

Evidence data carried on behavioral changes.
Source§

type ReportData = TsReportData

Language-specific report data.
Source§

type AnalysisExtensions = TsAnalysisExtensions

Language-specific analysis extensions. Read more
Source§

fn extract( &self, repo: &Path, git_ref: &str, degradation: Option<&DegradationTracker>, ) -> Result<ApiSurface<TsSymbolData>>

Extract the public API surface from source code at a git ref. Read more
Source§

fn extract_keeping_worktree( &self, repo: &Path, git_ref: &str, degradation: Option<&DegradationTracker>, ) -> Result<ExtractionWithWorktree<TsSymbolData>>

Extract the API surface and optionally keep the worktree alive. Read more
Source§

fn parse_changed_functions( &self, repo: &Path, from_ref: &str, to_ref: &str, ) -> Result<Vec<ChangedFunction>>

Parse the diff between two git refs and identify all functions whose bodies changed (public AND private).
Source§

fn find_callers(&self, file: &Path, symbol_name: &str) -> Result<Vec<Caller>>

Given a function, find what calls it (callers, not callees).
Source§

fn find_references( &self, file: &Path, symbol_name: &str, ) -> Result<Vec<Reference>>

Given a public symbol, find all references to it across the project.
Source§

fn find_tests(&self, repo: &Path, source_file: &Path) -> Result<Vec<TestFile>>

Given a source file, find its associated test file(s) by convention.
Source§

fn diff_test_assertions( &self, repo: &Path, test_file: &TestFile, from_ref: &str, to_ref: &str, ) -> Result<TestDiff>

Diff the test file between two refs. Returns changed assertion lines.
Source§

fn build_report( &self, results: &AnalysisResult<Self>, repo: &Path, from_ref: &str, to_ref: &str, ) -> AnalysisReport<Self>

Build the language-specific report from analysis results. Read more
Source§

fn behavioral_change_kind( &self, evidence_type: &EvidenceType, ) -> BehavioralChangeKind

Determine the behavioral change kind from the evidence type. TypeScript: LLM/body analysis → Class (component-level), test delta → Function Default: always Function
Source§

fn extract_referenced_symbols(&self, description: &str) -> Vec<String>

Extract symbol references from a behavioral change description. TypeScript: extracts PascalCase component names (e.g., <Modal>, `Button`) Default: empty vec
Source§

fn display_name(&self, qualified_name: &str) -> String

Format a qualified name for display in reports. TypeScript: src/Modal.tsx::ModalModal Default: return the qualified name as-is
Source§

fn llm_categories(&self) -> Vec<LlmCategoryDefinition>

Return the behavioral change categories for LLM prompts. Read more
Source§

fn diff_manifest_content(old: &str, new: &str) -> Vec<ManifestChange<Self>>

Diff manifest content between two versions. Read more
Source§

fn discover_package_manifests( repo: &Path, git_ref: &str, ) -> Vec<(String, String)>

Discover per-package manifest files in monorepos. Read more
Source§

fn should_exclude_from_analysis(path: &Path) -> bool

Whether a file path should be excluded from BU analysis. Read more
Source§

fn run_extended_analysis( &self, params: &ExtendedAnalysisParams, ) -> Result<TsAnalysisExtensions>

Run language-specific extended analysis. Read more
Source§

fn finalize_extensions( &self, extensions: &mut Self::AnalysisExtensions, structural_changes: Arc<Vec<StructuralChange>>, repo: &Path, from_ref: &str, to_ref: &str, ) -> Arc<Vec<StructuralChange>>

Post-process extensions after both TD and extended analysis complete. Read more
Source§

fn extensions_log_summary( &self, extensions: &Self::AnalysisExtensions, ) -> Vec<String>

Return log-friendly summary lines for the extended analysis results. Read more
Source§

impl LanguageSemantics<TsSymbolData> for TypeScript

Source§

fn is_member_addition_breaking( &self, container: &Symbol<TsSymbolData>, member: &Symbol<TsSymbolData>, ) -> bool

Is adding this member to this container a breaking change? Read more
Source§

fn same_family( &self, a: &Symbol<TsSymbolData>, b: &Symbol<TsSymbolData>, ) -> bool

Are these two symbols part of the same logical family/group? Read more
Source§

fn same_identity( &self, a: &Symbol<TsSymbolData>, b: &Symbol<TsSymbolData>, ) -> bool

Are these two symbols the same concept, possibly at different paths? Read more
Source§

fn visibility_rank(&self, v: Visibility) -> u8

Numeric rank for a visibility level (higher = more visible). Read more
Source§

fn parse_union_values(&self, type_str: &str) -> Option<BTreeSet<String>>

Parse union/constrained type values for fine-grained diffing. Read more
Source§

fn post_process(&self, changes: &mut Vec<StructuralChange>)

Post-process the change list before returning from diff_surfaces. Read more
Source§

fn hierarchy(&self) -> Option<&dyn HierarchySemantics<TsSymbolData>>

If this language supports component hierarchy inference (e.g., React, Vue, Django templates), return the hierarchy semantics implementation. Read more
Source§

fn renames(&self) -> Option<&dyn RenameSemantics>

If this language supports LLM-based rename inference (e.g., CSS physical→logical property renames, interface rename mappings), return the rename semantics implementation. Read more
Source§

fn body_analyzer(&self) -> Option<&dyn BodyAnalysisSemantics>

If this language has deterministic body-level analysis (e.g., JSX diff, CSS variable scanning for TypeScript), return the body analysis implementation. Read more
Source§

fn primitive_type_names(&self) -> &[&str]

Primitive type names for this language, used by the diff engine’s structural similarity comparison. Read more
Source§

fn is_async_wrapper(&self, type_str: &str) -> bool

Whether a return type string represents an async wrapper. Read more
Source§

fn format_import_change( &self, symbol: &str, old_path: &str, new_path: &str, ) -> String

Format an import/use statement change hint for migration descriptions. Read more
Source§

fn should_skip_symbol(&self, sym: &Symbol<TsSymbolData>) -> bool

Should this symbol be excluded from diff analysis? Read more
Source§

fn member_label(&self) -> &'static str

Human-readable label for members when building migration descriptions. Read more
Source§

fn extract_rename_fallback_key( &self, sym: &Symbol<TsSymbolData>, ) -> Option<String>

Extract a fallback key for rename matching from a symbol’s metadata. Read more
Source§

fn canonical_name_for_relocation(&self, qualified_name: &str) -> String

Normalize a qualified name for relocation detection. Read more
Source§

fn classify_relocation( &self, old_qname: &str, new_qname: &str, ) -> Option<&'static str>

Classify a relocation based on old and new qualified names. Read more
Source§

fn derive_import_subpath( &self, package: Option<&str>, qualified_name: &str, ) -> String

Derive the import subpath for a symbol, used in migration descriptions. Read more
Source§

fn diff_language_data( &self, _old: &Symbol<M>, _new: &Symbol<M>, ) -> Vec<StructuralChange>

Produce additional structural changes by diffing language-specific metadata on two matched symbols. Read more
Source§

impl MessageFormatter for TypeScript

Source§

fn describe(&self, change: &StructuralChange) -> String

Produce a human-readable description for a structural change.
Source§

impl RenameSemantics for TypeScript

Source§

fn sample_removed_constants<'a>( &self, removed: &[&'a str], _added: &[&'a str], ) -> Vec<&'a str>

Sample removed constants for rename pattern inference. Read more
Source§

fn sample_added_constants<'a>( &self, _removed: &[&'a str], added: &[&'a str], ) -> Vec<&'a str>

Sample added constants for rename pattern inference. Read more
Source§

fn min_removed_for_constant_inference(&self) -> usize

Minimum count of removed constants to trigger rename inference. Default: 50.
Source§

fn min_removed_for_interface_inference(&self) -> usize

Minimum count of removed interfaces to trigger interface rename inference. Default: 2.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more