Skip to main content

Crate tsz_core

Crate tsz_core 

Source

Re-exports§

pub use module_resolver::ModuleExtension;
pub use module_resolver::ModuleResolver;
pub use module_resolver::ResolutionFailure;
pub use module_resolver::ResolvedModule;
pub use imports::ImportDeclaration;
pub use imports::ImportKind;
pub use imports::ImportTracker;
pub use imports::ImportedBinding;
pub use exports::ExportDeclaration;
pub use exports::ExportKind;
pub use exports::ExportTracker;
pub use exports::ExportedBinding;
pub use module_graph::CircularDependency;
pub use module_graph::ModuleGraph;
pub use module_graph::ModuleId;
pub use module_graph::ModuleInfo;
pub use tsz_scanner as scanner;
pub use tsz_binder as binder;
pub use tsz_checker as checker;
pub use tsz_solver;
pub use tsz_lsp as lsp;

Modules§

char_codes
Character codes matching TypeScript’s CharacterCodes enum.
comments
Comment Preservation
common
Common types and constants for the compiler
config
context
Context objects for the emitter pipeline.
declaration_emitter
Declaration File (.d.ts) Emitter
diagnostics
Diagnostic Infrastructure
emitter
Emitter - Emitter using NodeArena
enums
Enum Support Module
exports
Export Tracking and Analysis
imports
Import Tracking and Analysis
interner
String Interner for identifier deduplication.
lib_loader
LibLoader - Load and merge lib.d.ts symbols into the binder.
limits
Cross-crate limits and thresholds for the TypeScript compiler.
lowering
Lowering Pass - Phase 1 of the Transform/Print Architecture
module_graph
Module Dependency Graph
module_resolution_debug
Module Resolution Debugging
module_resolver
Module Resolution Implementation
parallel
Parallel Processing Module
parser
Parser types - AST node definitions for TypeScript.
printer
Printer - A clean, safe AST-to-JavaScript printer
safe_slice
Safe string slice utilities that never panic.
scanner_impl
Scanner implementation - the lexical analyzer for TypeScript.
source_file
SourceFile owns source text and provides references for parsing/scanning
source_map
Source Map Generation
source_writer
SourceWriter - Abstraction for writing emitter output with source map tracking
span
Span - Source location tracking for AST nodes and diagnostics
syntax
Syntax utilities - Shared helpers for AST and transforms
transforms
JavaScript Transforms

Structs§

Atom
An interned string identifier.
CheckerState
Type checker state using NodeArena and Solver type system.
Interner
String interner that deduplicates strings and returns Atom handles.
Parser
High-performance parser using Node architecture (16 bytes/node). This is the optimized path for Phase 8 test suite evaluation.
ScannerState
The scanner state that holds the current position and token information.
ShardedInterner
Sharded string interner for concurrent use.
WasmProgram
Multi-file TypeScript program for cross-file type checking.
WasmTransformContext
Opaque wrapper for transform directives across the wasm boundary.

Enums§

Comparison
Comparison result for ordering operations. Matches TypeScript’s Comparison const enum in src/compiler/corePublic.ts
ModuleKind
Module system kind.
NewLineKind
New line kind for source file emission.
ScriptTarget
ECMAScript target version.
SyntaxKind
Syntax kind enum matching TypeScript’s SyntaxKind. This enum contains only the token types produced by the scanner (0-186). AST node types are not included here.
TokenFlags
Token flags indicating special properties of scanned tokens.

Constants§

ALT_DIRECTORY_SEPARATOR
Alternative directory separator (backslash, used on Windows).
DIRECTORY_SEPARATOR
Directory separator used internally (forward slash).
MAX_CALL_DEPTH
Maximum depth for function call resolution.
MAX_INSTANTIATION_DEPTH
Maximum depth for generic type instantiation.

Functions§

compare_strings_case_insensitive
Compare two strings using a case-insensitive ordinal comparison.
compare_strings_case_insensitive_eslint_compatible
Compare two strings using a case-insensitive ordinal comparison (eslint-compatible).
compare_strings_case_sensitive
Compare two strings using a case-sensitive ordinal comparison.
create_parser
Create a new Parser for the given source text. This is the recommended parser for production use.
create_program
Create a new multi-file program.
create_scanner
Create a new scanner for the given source text. This is the wasm-bindgen entry point for creating scanners from JavaScript.
ensure_trailing_directory_separator
Ensures a path has a trailing directory separator.
equate_strings_case_insensitive
Check if two strings are equal (case-insensitive). Uses iterator-based comparison to avoid allocating new strings.
equate_strings_case_sensitive
Check if two strings are equal (case-sensitive).
file_extension_is
Check if path ends with a specific extension.
get_base_file_name
Returns the path except for its containing directory name (basename). Uses char-based operations for UTF-8 safety.
has_extension
Determines whether a path has an extension.
has_trailing_directory_separator
Determines whether a path has a trailing separator (/ or \\).
is_any_directory_separator
Determines whether a charCode corresponds to / or \.
is_ascii_letter
Check if character is an ASCII letter (A-Z, a-z).
is_digit
Check if character is a decimal digit (0-9).
is_hex_digit
Check if character is a hexadecimal digit (0-9, A-F, a-f).
is_line_break
Check if character is a line break (LF, CR, LS, PS).
is_octal_digit
Check if character is an octal digit (0-7).
is_white_space_like
Check if character is any whitespace (including line breaks).
is_white_space_single_line
Check if character is a single-line whitespace (not including line breaks).
is_word_character
Check if character is a word character (A-Z, a-z, 0-9, _).
keyword_to_text
Get the text representation of a keyword token. WASM-exported version that allocates a String for JS compatibility.
keyword_to_text_static
Internal non-allocating version - returns static str reference. Use this for Rust-internal code to avoid allocations.
normalize_slashes
Normalize path separators, converting \ into /.
path_is_relative
Determines whether a path starts with a relative path component (i.e. . or ..).
punctuation_to_text
Get the text representation of a punctuation token. WASM-exported version that allocates a String for JS compatibility.
punctuation_to_text_static
Internal non-allocating version - returns static str reference. Use this for Rust-internal code to avoid allocations.
remove_trailing_directory_separator
Removes a trailing directory separator from a path, if it has one. Uses char-based operations for UTF-8 safety.
string_to_token
Get the token kind for a given text, including identifiers and keywords. Returns Identifier if the text is not a keyword.
text_to_keyword
Convert a string to its keyword SyntaxKind, if it’s a keyword. Returns None if the text is not a keyword.
to_file_name_lower_case
Convert file name to lowercase for case-insensitive file systems.
token_is_assignment_operator
token_is_identifier_or_keyword
token_is_keyword
token_is_literal
token_is_punctuation
token_is_reserved_word
token_is_strict_mode_reserved_word
token_is_template_literal
token_is_trivia