pub trait ToTsExpr {
// Required method
fn to_ts_expr(self) -> Expr;
}Expand description
Converts common Rust values into SWC Expr nodes.
This enables ergonomic interpolation in template literals and other AST construction contexts where a string or identifier should be treated as a TypeScript expression.
Required Methods§
fn to_ts_expr(self) -> Expr
Implementations on Foreign Types§
Source§impl ToTsExpr for &bool
Available on crate feature swc only.
impl ToTsExpr for &bool
Available on crate feature
swc only.fn to_ts_expr(self) -> Expr
Source§impl ToTsExpr for &String
Available on crate feature swc only.
impl ToTsExpr for &String
Available on crate feature
swc only.fn to_ts_expr(self) -> Expr
Source§impl ToTsExpr for Box<Expr>
Available on crate feature swc only.
impl ToTsExpr for Box<Expr>
Available on crate feature
swc only.fn to_ts_expr(self) -> Expr
Source§impl ToTsExpr for String
Available on crate feature swc only.
impl ToTsExpr for String
Available on crate feature
swc only.