pub const IR_FINGERPRINT: &str = env!("MACROFORGE_IR_FINGERPRINT");
pub mod abi;
pub mod ast;
pub mod config;
pub mod context_registry;
pub mod declarative;
pub mod derive;
pub mod errors;
pub mod import_registry;
pub mod jsdoc;
pub mod lower;
pub mod preamble;
mod quote_helpers;
pub mod scan;
pub mod source_path;
#[cfg(any(test, feature = "proptest"))]
pub mod strategies;
pub mod stream;
pub mod type_normalize;
pub use abi::*;
pub use derive::*;
pub use errors::*;
pub use import_registry::{
ImportRegistry, clear_registry, collect_file_imports, install_registry, take_registry,
with_registry, with_registry_mut,
};
pub use lower::{
collect_export_aliases, collect_exported_names, collect_re_exports, initializer_type,
lower_classes, lower_enums, lower_functions, lower_interfaces, lower_targets,
lower_type_aliases,
};
pub use preamble::preamble_end;
pub use quote_helpers::{
QuoteArena, ToAssignTargetSource, ToExprSource, ToIdentSource, ToPatSource,
ToStringLiteralSource, ToTypeSource, assignment_target_to_string, binding_pattern_to_string,
expr_to_string, parse_assignment_target, parse_binding_pattern, parse_expr, parse_module_item,
parse_program, parse_prop_or_spread, parse_statement, parse_type, stmt_to_string,
string_literal_to_string, type_to_string,
};
pub use stream::*;
pub use ::oxc;
#[macro_export]
macro_rules! ts_ident {
($name:expr) => {
$crate::ast::Ident::new(AsRef::<str>::as_ref(&$name))
};
($fmt:expr, $($args:expr),+ $(,)?) => {
$crate::ast::Ident::new(format!($fmt, $($args),+))
};
}
pub trait ToTsString {
fn to_ts_string(&self) -> String;
}
impl ToTsString for String {
fn to_ts_string(&self) -> String {
self.clone()
}
}
impl ToTsString for str {
fn to_ts_string(&self) -> String {
self.to_owned()
}
}
impl ToTsString for bool {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for i8 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for i16 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for i32 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for i64 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for i128 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for isize {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for u8 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for u16 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for u32 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for u64 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for u128 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for usize {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for f32 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for f64 {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for char {
fn to_ts_string(&self) -> String {
self.to_string()
}
}
impl ToTsString for crate::ast::Expr {
fn to_ts_string(&self) -> String {
self.source().to_string()
}
}
impl ToTsString for crate::ast::Ident {
fn to_ts_string(&self) -> String {
self.sym.clone()
}
}
impl ToTsString for crate::TsStream {
fn to_ts_string(&self) -> String {
self.source().to_string()
}
}
impl<T: ToTsString + ?Sized> ToTsString for &T {
fn to_ts_string(&self) -> String {
(*self).to_ts_string()
}
}
impl<T: ToTsString + ?Sized> ToTsString for &mut T {
fn to_ts_string(&self) -> String {
(**self).to_ts_string()
}
}
impl<T: ToTsString + ?Sized> ToTsString for Box<T> {
fn to_ts_string(&self) -> String {
(**self).to_ts_string()
}
}
impl<T: ToTsString + Clone> ToTsString for std::borrow::Cow<'_, T> {
fn to_ts_string(&self) -> String {
self.as_ref().to_ts_string()
}
}
impl<T: ToTsString> ToTsString for std::rc::Rc<T> {
fn to_ts_string(&self) -> String {
(**self).to_ts_string()
}
}
impl<T: ToTsString> ToTsString for std::sync::Arc<T> {
fn to_ts_string(&self) -> String {
(**self).to_ts_string()
}
}