pub trait ToTsIdent {
// Required method
fn to_ts_ident(self) -> Ident;
}Expand description
Converts common Rust values into SWC Ident nodes.
This enables ergonomic interpolation in template literals where an identifier is expected.
Required Methods§
fn to_ts_ident(self) -> Ident
Implementations on Foreign Types§
Source§impl ToTsIdent for &str
Available on crate feature swc only.
impl ToTsIdent for &str
Available on crate feature
swc only.fn to_ts_ident(self) -> Ident
Source§impl ToTsIdent for &String
Available on crate feature swc only.
impl ToTsIdent for &String
Available on crate feature
swc only.fn to_ts_ident(self) -> Ident
Source§impl ToTsIdent for Box<TsType>
Available on crate feature swc only.
impl ToTsIdent for Box<TsType>
Available on crate feature
swc only.fn to_ts_ident(self) -> Ident
Source§impl ToTsIdent for String
Available on crate feature swc only.
impl ToTsIdent for String
Available on crate feature
swc only.fn to_ts_ident(self) -> Ident
Implementors§
impl ToTsIdent for &Expr
Available on crate feature
swc only.impl ToTsIdent for &TsType
Available on crate feature
swc only.impl ToTsIdent for &Ident
Available on crate feature
swc only.impl ToTsIdent for Expr
Available on crate feature
swc only.Convert an Expr to an Ident. Only works for identifier expressions.
impl ToTsIdent for TsType
Available on crate feature
swc only.Convert a TsType to an Ident. Only works for type references with simple names.
impl ToTsIdent for Ident
Available on crate feature
swc only.