Skip to main content

sim_codec_typescript/
lib.rs

1//! Bounded, lossless TypeScript 7 and TSX syntax layered on JavaScript.
2//!
3//! ECMAScript productions remain [`sim_codec_javascript::Node`] values. This
4//! crate adds only TypeScript/TSX notation and deliberately has no checker,
5//! compiler, lowering pipeline, module resolver, or runtime model.
6
7#![forbid(unsafe_code)]
8#![deny(missing_docs)]
9
10mod lower;
11mod parser;
12mod types;
13
14pub use lower::{
15    AnnotationReference, EvaluationGap, LoweredTypeScript, decode_typescript,
16    decode_typescript_located, decode_typescript_tree, encode_typescript, lower_typescript,
17};
18pub use parser::{parse_module, parse_module_with_limits, parse_tsx, parse_tsx_with_limits};
19pub use types::{Diagnostic, DiagnosticCode, Language, Limits, SyntaxKind, SyntaxNode, SyntaxTree};
20
21/// Frozen language release.
22pub const TYPESCRIPT_VERSION: &str = "7.0.2";
23/// Immutable upstream syntax authority for the frozen release.
24pub const TYPESCRIPT_AUTHORITY: &str =
25    "https://github.com/microsoft/TypeScript/tree/v7.0.2/src/compiler";
26/// Frozen syntax/test identity.
27pub const TYPESCRIPT_TEST_IDENTITY: &str =
28    "microsoft/TypeScript v7.0.2 parser and conformance tests";
29/// Date on which the syntax identity was frozen.
30pub const TYPESCRIPT_FROZEN_ON: &str = "2026-08-09";
31
32/// Stable local id used before a host assigns `codec/typescript` an id.
33pub const TYPESCRIPT_CODEC_ID: sim_kernel::CodecId = sim_kernel::CodecId(0x54_53_00_00);
34
35#[cfg(test)]
36mod tests;