@@ -173,7 +173,8 @@ pub enum TSType<'a> {
173
173
TSUnionType ( Box < ' a , TSUnionType < ' a > > ) = 33 ,
174
174
// JSDoc
175
175
JSDocNullableType ( Box < ' a , JSDocNullableType < ' a > > ) = 34 ,
176
- JSDocUnknownType ( Box < ' a , JSDocUnknownType > ) = 35 ,
176
+ JSDocNonNullableType ( Box < ' a , JSDocNonNullableType < ' a > > ) = 35 ,
177
+ JSDocUnknownType ( Box < ' a , JSDocUnknownType > ) = 36 ,
177
178
}
178
179
179
180
/// Macro for matching `TSType`'s variants.
@@ -215,6 +216,7 @@ macro_rules! match_ts_type {
215
216
| $ty:: TSTypeReference ( _)
216
217
| $ty:: TSUnionType ( _)
217
218
| $ty:: JSDocNullableType ( _)
219
+ | $ty:: JSDocNonNullableType ( _)
218
220
| $ty:: JSDocUnknownType ( _)
219
221
} ;
220
222
}
@@ -332,7 +334,7 @@ pub struct TSTupleType<'a> {
332
334
pub struct TSNamedTupleMember < ' a > {
333
335
#[ cfg_attr( feature = "serialize" , serde( flatten) ) ]
334
336
pub span : Span ,
335
- pub element_type : TSType < ' a > ,
337
+ pub element_type : TSTupleElement < ' a > ,
336
338
pub label : IdentifierName < ' a > ,
337
339
pub optional : bool ,
338
340
}
@@ -906,7 +908,8 @@ pub enum TSTypeQueryExprName<'a> {
906
908
pub struct TSImportType < ' a > {
907
909
#[ cfg_attr( feature = "serialize" , serde( flatten) ) ]
908
910
pub span : Span ,
909
- pub argument : TSType < ' a > ,
911
+ pub is_type_of : bool , // `typeof import("foo")`
912
+ pub parameter : TSType < ' a > ,
910
913
pub qualifier : Option < TSTypeName < ' a > > ,
911
914
pub attributes : Option < TSImportAttributes < ' a > > ,
912
915
pub type_parameters : Option < Box < ' a , TSTypeParameterInstantiation < ' a > > > ,
@@ -1157,6 +1160,18 @@ pub struct JSDocNullableType<'a> {
1157
1160
pub postfix : bool ,
1158
1161
}
1159
1162
1163
+ /// `type foo = ty!` or `type foo = !ty`
1164
+ #[ visited_node]
1165
+ #[ derive( Debug , Hash ) ]
1166
+ #[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
1167
+ #[ cfg_attr( feature = "serialize" , serde( tag = "type" , rename_all = "camelCase" ) ) ]
1168
+ pub struct JSDocNonNullableType < ' a > {
1169
+ #[ cfg_attr( feature = "serialize" , serde( flatten) ) ]
1170
+ pub span : Span ,
1171
+ pub type_annotation : TSType < ' a > ,
1172
+ pub postfix : bool ,
1173
+ }
1174
+
1160
1175
#[ visited_node]
1161
1176
#[ derive( Debug , Hash ) ]
1162
1177
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
0 commit comments