pub enum TsType {
Show 19 variants
Number,
String,
Boolean,
Void,
Never,
Unknown,
Any,
Null,
Undefined,
Tuple(Vec<TsType>),
Array(Box<TsType>),
Object(Vec<(String, TsType)>),
Union(Vec<TsType>),
Intersection(Vec<TsType>),
Function {
params: Vec<TsType>,
ret: Box<TsType>,
},
Custom(String),
Generic(String, Vec<TsType>),
ReadOnly(Box<TsType>),
Readonly,
}Expand description
TypeScript type representation.
Variants§
Number
number
String
string
Boolean
boolean
Void
void
Never
never
Unknown
unknown
Any
any
Null
null
Undefined
undefined
Tuple(Vec<TsType>)
[T0, T1, ...]
Array(Box<TsType>)
T[]
Object(Vec<(String, TsType)>)
{ key: T; ... }
Union(Vec<TsType>)
T0 | T1 | ...
Intersection(Vec<TsType>)
T0 & T1 & ...
Function
(p0: T0, p1: T1, ...) => R
Custom(String)
A named type: MyClass, SomeInterface
Generic(String, Vec<TsType>)
A generic type application: Promise<T>, Map<K, V>
ReadOnly(Box<TsType>)
readonly T
Readonly
Readonly<T> utility type alias shorthand (no arg stored)
Trait Implementations§
impl Eq for TsType
impl StructuralPartialEq for TsType
Auto Trait Implementations§
impl Freeze for TsType
impl RefUnwindSafe for TsType
impl Send for TsType
impl Sync for TsType
impl Unpin for TsType
impl UnsafeUnpin for TsType
impl UnwindSafe for TsType
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