@@ -10455,6 +10455,42 @@ impl<'a> AstBuilder<'a> {
1045510455 ) )
1045610456 }
1045710457
10458+ /// Build a [`TSType::TSConstructorType`] with `scope_id`.
10459+ ///
10460+ /// This node contains a [`TSConstructorType`] that will be stored in the memory arena.
10461+ ///
10462+ /// ## Parameters
10463+ /// * `span`: The [`Span`] covering this node
10464+ /// * `abstract`
10465+ /// * `type_parameters`
10466+ /// * `params`
10467+ /// * `return_type`
10468+ /// * `scope_id`
10469+ #[ inline]
10470+ pub fn ts_type_constructor_type_with_scope_id < T1 , T2 , T3 > (
10471+ self ,
10472+ span : Span ,
10473+ r#abstract : bool ,
10474+ type_parameters : T1 ,
10475+ params : T2 ,
10476+ return_type : T3 ,
10477+ scope_id : ScopeId ,
10478+ ) -> TSType < ' a >
10479+ where
10480+ T1 : IntoIn < ' a , Option < Box < ' a , TSTypeParameterDeclaration < ' a > > > > ,
10481+ T2 : IntoIn < ' a , Box < ' a , FormalParameters < ' a > > > ,
10482+ T3 : IntoIn < ' a , Box < ' a , TSTypeAnnotation < ' a > > > ,
10483+ {
10484+ TSType :: TSConstructorType ( self . alloc_ts_constructor_type_with_scope_id (
10485+ span,
10486+ r#abstract,
10487+ type_parameters,
10488+ params,
10489+ return_type,
10490+ scope_id,
10491+ ) )
10492+ }
10493+
1045810494 /// Build a [`TSType::TSFunctionType`].
1045910495 ///
1046010496 /// This node contains a [`TSFunctionType`] that will be stored in the memory arena.
@@ -14174,6 +14210,7 @@ impl<'a> AstBuilder<'a> {
1417414210 type_parameters : type_parameters. into_in ( self . allocator ) ,
1417514211 params : params. into_in ( self . allocator ) ,
1417614212 return_type : return_type. into_in ( self . allocator ) ,
14213+ scope_id : Default :: default ( ) ,
1417714214 }
1417814215 }
1417914216
@@ -14208,6 +14245,83 @@ impl<'a> AstBuilder<'a> {
1420814245 )
1420914246 }
1421014247
14248+ /// Build a [`TSConstructorType`] with `scope_id`.
14249+ ///
14250+ /// If you want the built node to be allocated in the memory arena,
14251+ /// use [`AstBuilder::alloc_ts_constructor_type_with_scope_id`] instead.
14252+ ///
14253+ /// ## Parameters
14254+ /// * `span`: The [`Span`] covering this node
14255+ /// * `abstract`
14256+ /// * `type_parameters`
14257+ /// * `params`
14258+ /// * `return_type`
14259+ /// * `scope_id`
14260+ #[ inline]
14261+ pub fn ts_constructor_type_with_scope_id < T1 , T2 , T3 > (
14262+ self ,
14263+ span : Span ,
14264+ r#abstract : bool ,
14265+ type_parameters : T1 ,
14266+ params : T2 ,
14267+ return_type : T3 ,
14268+ scope_id : ScopeId ,
14269+ ) -> TSConstructorType < ' a >
14270+ where
14271+ T1 : IntoIn < ' a , Option < Box < ' a , TSTypeParameterDeclaration < ' a > > > > ,
14272+ T2 : IntoIn < ' a , Box < ' a , FormalParameters < ' a > > > ,
14273+ T3 : IntoIn < ' a , Box < ' a , TSTypeAnnotation < ' a > > > ,
14274+ {
14275+ TSConstructorType {
14276+ span,
14277+ r#abstract,
14278+ type_parameters : type_parameters. into_in ( self . allocator ) ,
14279+ params : params. into_in ( self . allocator ) ,
14280+ return_type : return_type. into_in ( self . allocator ) ,
14281+ scope_id : Cell :: new ( Some ( scope_id) ) ,
14282+ }
14283+ }
14284+
14285+ /// Build a [`TSConstructorType`] with `scope_id`, and store it in the memory arena.
14286+ ///
14287+ /// Returns a [`Box`] containing the newly-allocated node.
14288+ /// If you want a stack-allocated node, use [`AstBuilder::ts_constructor_type_with_scope_id`] instead.
14289+ ///
14290+ /// ## Parameters
14291+ /// * `span`: The [`Span`] covering this node
14292+ /// * `abstract`
14293+ /// * `type_parameters`
14294+ /// * `params`
14295+ /// * `return_type`
14296+ /// * `scope_id`
14297+ #[ inline]
14298+ pub fn alloc_ts_constructor_type_with_scope_id < T1 , T2 , T3 > (
14299+ self ,
14300+ span : Span ,
14301+ r#abstract : bool ,
14302+ type_parameters : T1 ,
14303+ params : T2 ,
14304+ return_type : T3 ,
14305+ scope_id : ScopeId ,
14306+ ) -> Box < ' a , TSConstructorType < ' a > >
14307+ where
14308+ T1 : IntoIn < ' a , Option < Box < ' a , TSTypeParameterDeclaration < ' a > > > > ,
14309+ T2 : IntoIn < ' a , Box < ' a , FormalParameters < ' a > > > ,
14310+ T3 : IntoIn < ' a , Box < ' a , TSTypeAnnotation < ' a > > > ,
14311+ {
14312+ Box :: new_in (
14313+ self . ts_constructor_type_with_scope_id (
14314+ span,
14315+ r#abstract,
14316+ type_parameters,
14317+ params,
14318+ return_type,
14319+ scope_id,
14320+ ) ,
14321+ self . allocator ,
14322+ )
14323+ }
14324+
1421114325 /// Build a [`TSMappedType`].
1421214326 ///
1421314327 /// If you want the built node to be allocated in the memory arena,
0 commit comments