pub struct TypescriptConverter {
pub is_interface: bool,
pub store: String,
pub should_export: bool,
pub indentation: u32,
pub file: File,
pub converted_types: Vec<String>,
}Expand description
Provides ability to convert syn (https://crates.io/crates/syn) parser types to typescript types with ease
Fields§
§is_interface: bool§store: String§should_export: bool§indentation: u32§file: File§converted_types: Vec<String>Implementations§
Source§impl TypescriptConverter
impl TypescriptConverter
pub fn new( is_interface: bool, initial_store_value: String, should_export: bool, indentation: u32, file: File, ) -> Self
Sourcepub fn convert_struct(&mut self, rust_struct: ItemStruct)
pub fn convert_struct(&mut self, rust_struct: ItemStruct)
Function that converts a syn struct to a typescript interface and pushes it to the store field
Sourcepub fn convert_primitive(&mut self, primitive: Type) -> TypescriptType
pub fn convert_primitive(&mut self, primitive: Type) -> TypescriptType
Converts rust primitives to typescript types
pub fn convert_const()
pub fn convert_enum()
pub fn convert_function()
Sourcepub fn convert_type_alias(&mut self, rust_type_alias: ItemType)
pub fn convert_type_alias(&mut self, rust_type_alias: ItemType)
Converts rust type aliases to typescript types or interfaces
pub fn generate(&mut self, types: Option<&str>)
Auto Trait Implementations§
impl Freeze for TypescriptConverter
impl RefUnwindSafe for TypescriptConverter
impl Send for TypescriptConverter
impl Sync for TypescriptConverter
impl Unpin for TypescriptConverter
impl UnwindSafe for TypescriptConverter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more