pub enum TypeAnnotation {
Show 33 variants
StringTypeAnnotation,
NumberTypeAnnotation,
BooleanTypeAnnotation,
VoidTypeAnnotation,
MixedTypeAnnotation,
AnyTypeAnnotation,
EmptyTypeAnnotation,
NullLiteralTypeAnnotation,
BigIntTypeAnnotation,
SymbolTypeAnnotation,
StringLiteralTypeAnnotation {
value: String,
},
NumberLiteralTypeAnnotation {
value: f64,
},
BooleanLiteralTypeAnnotation {
value: bool,
},
BigIntLiteralTypeAnnotation {
value: Option<Value>,
},
NullableTypeAnnotation {
type_annotation: Box<TypeAnnotation>,
},
ObjectTypeAnnotation {
properties: Vec<ObjectMember>,
indexers: Vec<ObjectTypeIndexer>,
call_properties: Vec<ObjectTypeCallProperty>,
internal_slots: Vec<ObjectTypeInternalSlot>,
exact: bool,
},
UnionTypeAnnotation {
types: Vec<TypeAnnotation>,
},
IntersectionTypeAnnotation {
types: Vec<TypeAnnotation>,
},
GenericTypeAnnotation {
id: TypeIdentifier,
type_parameters: Option<TypeParameterInstantiation>,
},
TupleTypeAnnotation {
element_types: Vec<TypeAnnotation>,
},
ArrayTypeAnnotation {
element_type: Box<TypeAnnotation>,
},
TypeofTypeAnnotation {
argument: Box<TypeAnnotation>,
},
FunctionTypeAnnotation {
params: Vec<FunctionTypeParam>,
return_type: Box<TypeAnnotation>,
rest: Option<Box<FunctionTypeParam>>,
type_parameters: Option<TypeParameterDeclaration>,
this_constraint: Option<Box<FunctionTypeParam>>,
},
InterfaceTypeAnnotation {
extends: Vec<InterfaceExtends>,
body: Box<TypeAnnotation>,
},
ExistsTypeAnnotation,
IndexedAccessType {
object_type: Box<TypeAnnotation>,
index_type: Box<TypeAnnotation>,
},
OptionalIndexedAccessType {
object_type: Box<TypeAnnotation>,
index_type: Box<TypeAnnotation>,
optional: bool,
},
KeyofTypeAnnotation {
argument: Box<TypeAnnotation>,
},
ConditionalTypeAnnotation {
check_type: Box<TypeAnnotation>,
extends_type: Box<TypeAnnotation>,
true_type: Box<TypeAnnotation>,
false_type: Box<TypeAnnotation>,
},
InferTypeAnnotation {
type_parameter: Option<Value>,
},
TypeOperator {
operator: Option<String>,
type_annotation: Box<TypeAnnotation>,
},
ComponentTypeAnnotation {
params: Vec<Value>,
rest: Option<Value>,
type_parameters: Option<TypeParameterDeclaration>,
renders_type: Option<Box<TypeAnnotation>>,
},
Other,
}Expand description
A Flow type annotation node.
Variants§
StringTypeAnnotation
NumberTypeAnnotation
BooleanTypeAnnotation
VoidTypeAnnotation
MixedTypeAnnotation
AnyTypeAnnotation
EmptyTypeAnnotation
NullLiteralTypeAnnotation
BigIntTypeAnnotation
SymbolTypeAnnotation
StringLiteralTypeAnnotation
NumberLiteralTypeAnnotation
BooleanLiteralTypeAnnotation
BigIntLiteralTypeAnnotation
NullableTypeAnnotation
Fields
§
type_annotation: Box<TypeAnnotation>ObjectTypeAnnotation
Fields
§
properties: Vec<ObjectMember>§
indexers: Vec<ObjectTypeIndexer>§
call_properties: Vec<ObjectTypeCallProperty>§
internal_slots: Vec<ObjectTypeInternalSlot>UnionTypeAnnotation
Fields
§
types: Vec<TypeAnnotation>IntersectionTypeAnnotation
Fields
§
types: Vec<TypeAnnotation>GenericTypeAnnotation
TupleTypeAnnotation
Fields
§
element_types: Vec<TypeAnnotation>ArrayTypeAnnotation
Fields
§
element_type: Box<TypeAnnotation>TypeofTypeAnnotation
Fields
§
argument: Box<TypeAnnotation>FunctionTypeAnnotation
Fields
§
params: Vec<FunctionTypeParam>§
return_type: Box<TypeAnnotation>§
rest: Option<Box<FunctionTypeParam>>§
type_parameters: Option<TypeParameterDeclaration>§
this_constraint: Option<Box<FunctionTypeParam>>InterfaceTypeAnnotation
ExistsTypeAnnotation
IndexedAccessType
OptionalIndexedAccessType
KeyofTypeAnnotation
Fields
§
argument: Box<TypeAnnotation>ConditionalTypeAnnotation
Fields
§
check_type: Box<TypeAnnotation>§
extends_type: Box<TypeAnnotation>§
true_type: Box<TypeAnnotation>§
false_type: Box<TypeAnnotation>InferTypeAnnotation
TypeOperator
ComponentTypeAnnotation
Other
Implementations§
Trait Implementations§
Source§impl Clone for TypeAnnotation
impl Clone for TypeAnnotation
Source§fn clone(&self) -> TypeAnnotation
fn clone(&self) -> TypeAnnotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeAnnotation
impl Debug for TypeAnnotation
Source§impl<'de> Deserialize<'de> for TypeAnnotation
impl<'de> Deserialize<'de> for TypeAnnotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TypeAnnotation
impl RefUnwindSafe for TypeAnnotation
impl Send for TypeAnnotation
impl Sync for TypeAnnotation
impl Unpin for TypeAnnotation
impl UnsafeUnpin for TypeAnnotation
impl UnwindSafe for TypeAnnotation
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