Struct oxc_ast::ast_builder::AstBuilder
source · #[non_exhaustive]pub struct AstBuilder<'a> {
pub allocator: &'a Allocator,
}
Expand description
AST builder for creating AST nodes
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.allocator: &'a Allocator
Implementations§
source§impl<'a> AstBuilder<'a>
impl<'a> AstBuilder<'a>
pub fn new(allocator: &'a Allocator) -> Self
pub fn alloc<T>(self, value: T) -> Box<'a, T>
pub fn vec<T>(self) -> Vec<'a, T>
pub fn vec_with_capacity<T>(self, capacity: usize) -> Vec<'a, T>
pub fn vec1<T>(self, value: T) -> Vec<'a, T>
pub fn vec_from_iter<T, I: IntoIterator<Item = T>>(self, iter: I) -> Vec<'a, T>
pub fn str(self, value: &str) -> &'a str
pub fn atom(self, value: &str) -> Atom<'a>
sourcepub unsafe fn copy<T>(self, src: &T) -> T
pub unsafe fn copy<T>(self, src: &T) -> T
§SAFETY
This method is completely unsound and should not be used. We need to remove all uses of it. Please don’t add any more! https://github.com/oxc-project/oxc/issues/3483
sourcepub fn move_expression(self, expr: &mut Expression<'a>) -> Expression<'a>
pub fn move_expression(self, expr: &mut Expression<'a>) -> Expression<'a>
Moves the expression out by replacing it with a null expression.
pub fn move_statement(self, stmt: &mut Statement<'a>) -> Statement<'a>
pub fn move_assignment_target( self, target: &mut AssignmentTarget<'a>, ) -> AssignmentTarget<'a>
pub fn move_declaration(self, decl: &mut Declaration<'a>) -> Declaration<'a>
pub fn move_vec<T>(self, vec: &mut Vec<'a, T>) -> Vec<'a, T>
sourcepub fn void_0(self) -> Expression<'a>
pub fn void_0(self) -> Expression<'a>
void 0
pub fn plain_formal_parameter( self, span: Span, pattern: BindingPattern<'a>, ) -> FormalParameter<'a>
pub fn plain_function( self, type: FunctionType, span: Span, id: Option<BindingIdentifier<'a>>, params: FormalParameters<'a>, body: Option<FunctionBody<'a>>, ) -> Box<'a, Function<'a>>
pub fn plain_export_named_declaration_declaration( self, span: Span, declaration: Declaration<'a>, ) -> Box<'a, ExportNamedDeclaration<'a>>
pub fn plain_export_named_declaration( self, span: Span, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option<StringLiteral<'a>>, ) -> Box<'a, ExportNamedDeclaration<'a>>
pub fn ts_interface_heritages( self, extends: Vec<'a, (Expression<'a>, Option<Box<'a, TSTypeParameterInstantiation<'a>>>, Span)>, ) -> Vec<'a, TSInterfaceHeritage<'a>>
pub fn jsx_opening_fragment(self, span: Span) -> JSXOpeningFragment
pub fn jsx_closing_fragment(self, span: Span) -> JSXClosingFragment
source§impl<'a> AstBuilder<'a>
impl<'a> AstBuilder<'a>
sourcepub fn boolean_literal(self, span: Span, value: bool) -> BooleanLiteral
pub fn boolean_literal(self, span: Span, value: bool) -> BooleanLiteral
Builds a BooleanLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_boolean_literal
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn alloc_boolean_literal(
self,
span: Span,
value: bool,
) -> Box<'a, BooleanLiteral>
pub fn alloc_boolean_literal( self, span: Span, value: bool, ) -> Box<'a, BooleanLiteral>
Builds a BooleanLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::boolean_literal
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn null_literal(self, span: Span) -> NullLiteral
pub fn null_literal(self, span: Span) -> NullLiteral
Builds a NullLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_null_literal
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_null_literal(self, span: Span) -> Box<'a, NullLiteral>
pub fn alloc_null_literal(self, span: Span) -> Box<'a, NullLiteral>
Builds a NullLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::null_literal
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn numeric_literal<S>(
self,
span: Span,
value: f64,
raw: S,
base: NumberBase,
) -> NumericLiteral<'a>
pub fn numeric_literal<S>( self, span: Span, value: f64, raw: S, base: NumberBase, ) -> NumericLiteral<'a>
Builds a NumericLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_numeric_literal
instead.
§Parameters
- span: The
Span
covering this node - value: The value of the number, converted into base 10
- raw: The number as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn alloc_numeric_literal<S>(
self,
span: Span,
value: f64,
raw: S,
base: NumberBase,
) -> Box<'a, NumericLiteral<'a>>
pub fn alloc_numeric_literal<S>( self, span: Span, value: f64, raw: S, base: NumberBase, ) -> Box<'a, NumericLiteral<'a>>
Builds a NumericLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::numeric_literal
instead.
§Parameters
- span: The
Span
covering this node - value: The value of the number, converted into base 10
- raw: The number as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn big_int_literal<A>(
self,
span: Span,
raw: A,
base: BigintBase,
) -> BigIntLiteral<'a>
pub fn big_int_literal<A>( self, span: Span, raw: A, base: BigintBase, ) -> BigIntLiteral<'a>
Builds a BigIntLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_big_int_literal
instead.
§Parameters
- span: The
Span
covering this node - raw: The bigint as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn alloc_big_int_literal<A>(
self,
span: Span,
raw: A,
base: BigintBase,
) -> Box<'a, BigIntLiteral<'a>>
pub fn alloc_big_int_literal<A>( self, span: Span, raw: A, base: BigintBase, ) -> Box<'a, BigIntLiteral<'a>>
Builds a BigIntLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::big_int_literal
instead.
§Parameters
- span: The
Span
covering this node - raw: The bigint as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn reg_exp_literal(
self,
span: Span,
value: EmptyObject,
regex: RegExp<'a>,
) -> RegExpLiteral<'a>
pub fn reg_exp_literal( self, span: Span, value: EmptyObject, regex: RegExp<'a>, ) -> RegExpLiteral<'a>
Builds a RegExpLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_reg_exp_literal
instead.
§Parameters
- span: The
Span
covering this node - value
- regex
sourcepub fn alloc_reg_exp_literal(
self,
span: Span,
value: EmptyObject,
regex: RegExp<'a>,
) -> Box<'a, RegExpLiteral<'a>>
pub fn alloc_reg_exp_literal( self, span: Span, value: EmptyObject, regex: RegExp<'a>, ) -> Box<'a, RegExpLiteral<'a>>
Builds a RegExpLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::reg_exp_literal
instead.
§Parameters
- span: The
Span
covering this node - value
- regex
sourcepub fn string_literal<A>(self, span: Span, value: A) -> StringLiteral<'a>
pub fn string_literal<A>(self, span: Span, value: A) -> StringLiteral<'a>
Builds a StringLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_string_literal
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn alloc_string_literal<A>(
self,
span: Span,
value: A,
) -> Box<'a, StringLiteral<'a>>
pub fn alloc_string_literal<A>( self, span: Span, value: A, ) -> Box<'a, StringLiteral<'a>>
Builds a StringLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::string_literal
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn program(
self,
span: Span,
source_type: SourceType,
hashbang: Option<Hashbang<'a>>,
directives: Vec<'a, Directive<'a>>,
body: Vec<'a, Statement<'a>>,
) -> Program<'a>
pub fn program( self, span: Span, source_type: SourceType, hashbang: Option<Hashbang<'a>>, directives: Vec<'a, Directive<'a>>, body: Vec<'a, Statement<'a>>, ) -> Program<'a>
Builds a Program
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_program
instead.
§Parameters
- span: The
Span
covering this node - source_type
- hashbang
- directives
- body
sourcepub fn alloc_program(
self,
span: Span,
source_type: SourceType,
hashbang: Option<Hashbang<'a>>,
directives: Vec<'a, Directive<'a>>,
body: Vec<'a, Statement<'a>>,
) -> Box<'a, Program<'a>>
pub fn alloc_program( self, span: Span, source_type: SourceType, hashbang: Option<Hashbang<'a>>, directives: Vec<'a, Directive<'a>>, body: Vec<'a, Statement<'a>>, ) -> Box<'a, Program<'a>>
Builds a Program
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::program
instead.
§Parameters
- span: The
Span
covering this node - source_type
- hashbang
- directives
- body
sourcepub fn expression_boolean_literal(
self,
span: Span,
value: bool,
) -> Expression<'a>
pub fn expression_boolean_literal( self, span: Span, value: bool, ) -> Expression<'a>
Build a Expression::BooleanLiteral
This node contains a BooleanLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn expression_from_boolean_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_boolean_literal<T>(self, inner: T) -> Expression<'a>
Convert a BooleanLiteral
into a Expression::BooleanLiteral
sourcepub fn expression_null_literal(self, span: Span) -> Expression<'a>
pub fn expression_null_literal(self, span: Span) -> Expression<'a>
Build a Expression::NullLiteral
This node contains a NullLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn expression_from_null_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_null_literal<T>(self, inner: T) -> Expression<'a>
Convert a NullLiteral
into a Expression::NullLiteral
sourcepub fn expression_numeric_literal<S>(
self,
span: Span,
value: f64,
raw: S,
base: NumberBase,
) -> Expression<'a>
pub fn expression_numeric_literal<S>( self, span: Span, value: f64, raw: S, base: NumberBase, ) -> Expression<'a>
Build a Expression::NumericLiteral
This node contains a NumericLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value: The value of the number, converted into base 10
- raw: The number as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn expression_from_numeric_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_numeric_literal<T>(self, inner: T) -> Expression<'a>
Convert a NumericLiteral
into a Expression::NumericLiteral
sourcepub fn expression_big_int_literal<A>(
self,
span: Span,
raw: A,
base: BigintBase,
) -> Expression<'a>
pub fn expression_big_int_literal<A>( self, span: Span, raw: A, base: BigintBase, ) -> Expression<'a>
Build a Expression::BigIntLiteral
This node contains a BigIntLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - raw: The bigint as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn expression_from_big_int_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_big_int_literal<T>(self, inner: T) -> Expression<'a>
Convert a BigIntLiteral
into a Expression::BigIntLiteral
sourcepub fn expression_reg_exp_literal(
self,
span: Span,
value: EmptyObject,
regex: RegExp<'a>,
) -> Expression<'a>
pub fn expression_reg_exp_literal( self, span: Span, value: EmptyObject, regex: RegExp<'a>, ) -> Expression<'a>
Build a Expression::RegExpLiteral
This node contains a RegExpLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
- regex
sourcepub fn expression_from_reg_exp_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_reg_exp_literal<T>(self, inner: T) -> Expression<'a>
Convert a RegExpLiteral
into a Expression::RegExpLiteral
sourcepub fn expression_string_literal<A>(
self,
span: Span,
value: A,
) -> Expression<'a>
pub fn expression_string_literal<A>( self, span: Span, value: A, ) -> Expression<'a>
Build a Expression::StringLiteral
This node contains a StringLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn expression_from_string_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_string_literal<T>(self, inner: T) -> Expression<'a>
Convert a StringLiteral
into a Expression::StringLiteral
sourcepub fn expression_template_literal(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
expressions: Vec<'a, Expression<'a>>,
) -> Expression<'a>
pub fn expression_template_literal( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, expressions: Vec<'a, Expression<'a>>, ) -> Expression<'a>
Build a Expression::TemplateLiteral
This node contains a TemplateLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - quasis
- expressions
sourcepub fn expression_from_template_literal<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_template_literal<T>(self, inner: T) -> Expression<'a>
Convert a TemplateLiteral
into a Expression::TemplateLiteral
sourcepub fn expression_identifier_reference<A>(
self,
span: Span,
name: A,
) -> Expression<'a>
pub fn expression_identifier_reference<A>( self, span: Span, name: A, ) -> Expression<'a>
Build a Expression::Identifier
This node contains a IdentifierReference
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn expression_from_identifier_reference<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_identifier_reference<T>(self, inner: T) -> Expression<'a>
Convert a IdentifierReference
into a Expression::Identifier
sourcepub fn expression_meta_property(
self,
span: Span,
meta: IdentifierName<'a>,
property: IdentifierName<'a>,
) -> Expression<'a>
pub fn expression_meta_property( self, span: Span, meta: IdentifierName<'a>, property: IdentifierName<'a>, ) -> Expression<'a>
Build a Expression::MetaProperty
This node contains a MetaProperty
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - meta
- property
sourcepub fn expression_from_meta_property<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_meta_property<T>(self, inner: T) -> Expression<'a>
Convert a MetaProperty
into a Expression::MetaProperty
sourcepub fn expression_super(self, span: Span) -> Expression<'a>
pub fn expression_super(self, span: Span) -> Expression<'a>
Build a Expression::Super
This node contains a Super
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn expression_from_super<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_super<T>(self, inner: T) -> Expression<'a>
Convert a Super
into a Expression::Super
sourcepub fn expression_array(
self,
span: Span,
elements: Vec<'a, ArrayExpressionElement<'a>>,
trailing_comma: Option<Span>,
) -> Expression<'a>
pub fn expression_array( self, span: Span, elements: Vec<'a, ArrayExpressionElement<'a>>, trailing_comma: Option<Span>, ) -> Expression<'a>
Build a Expression::ArrayExpression
This node contains a ArrayExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - elements
- trailing_comma: Array trailing comma
sourcepub fn expression_from_array<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_array<T>(self, inner: T) -> Expression<'a>
Convert a ArrayExpression
into a Expression::ArrayExpression
sourcepub fn expression_arrow_function<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> Expression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
pub fn expression_arrow_function<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> Expression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
Build a Expression::ArrowFunctionExpression
This node contains a ArrowFunctionExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression: Is the function body an arrow expression? i.e.
() => expr
instead of() => {}
- r#async
- type_parameters
- params
- return_type
- body: See
expression
for whether this arrow expression returns an expression.
sourcepub fn expression_from_arrow_function<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_arrow_function<T>(self, inner: T) -> Expression<'a>
Convert a ArrowFunctionExpression
into a Expression::ArrowFunctionExpression
sourcepub fn expression_assignment(
self,
span: Span,
operator: AssignmentOperator,
left: AssignmentTarget<'a>,
right: Expression<'a>,
) -> Expression<'a>
pub fn expression_assignment( self, span: Span, operator: AssignmentOperator, left: AssignmentTarget<'a>, right: Expression<'a>, ) -> Expression<'a>
Build a Expression::AssignmentExpression
This node contains a AssignmentExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - operator
- left
- right
sourcepub fn expression_from_assignment<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_assignment<T>(self, inner: T) -> Expression<'a>
Convert a AssignmentExpression
into a Expression::AssignmentExpression
sourcepub fn expression_await(
self,
span: Span,
argument: Expression<'a>,
) -> Expression<'a>
pub fn expression_await( self, span: Span, argument: Expression<'a>, ) -> Expression<'a>
Build a Expression::AwaitExpression
This node contains a AwaitExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn expression_from_await<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_await<T>(self, inner: T) -> Expression<'a>
Convert a AwaitExpression
into a Expression::AwaitExpression
sourcepub fn expression_binary(
self,
span: Span,
left: Expression<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> Expression<'a>
pub fn expression_binary( self, span: Span, left: Expression<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> Expression<'a>
Build a Expression::BinaryExpression
This node contains a BinaryExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn expression_from_binary<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_binary<T>(self, inner: T) -> Expression<'a>
Convert a BinaryExpression
into a Expression::BinaryExpression
sourcepub fn expression_call<T1>(
self,
span: Span,
callee: Expression<'a>,
type_parameters: T1,
arguments: Vec<'a, Argument<'a>>,
optional: bool,
) -> Expression<'a>
pub fn expression_call<T1>( self, span: Span, callee: Expression<'a>, type_parameters: T1, arguments: Vec<'a, Argument<'a>>, optional: bool, ) -> Expression<'a>
Build a Expression::CallExpression
This node contains a CallExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - callee
- type_parameters
- arguments
- optional
sourcepub fn expression_from_call<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_call<T>(self, inner: T) -> Expression<'a>
Convert a CallExpression
into a Expression::CallExpression
sourcepub fn expression_chain(
self,
span: Span,
expression: ChainElement<'a>,
) -> Expression<'a>
pub fn expression_chain( self, span: Span, expression: ChainElement<'a>, ) -> Expression<'a>
Build a Expression::ChainExpression
This node contains a ChainExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn expression_from_chain<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_chain<T>(self, inner: T) -> Expression<'a>
Convert a ChainExpression
into a Expression::ChainExpression
sourcepub fn expression_class<T1, T2, T3>(
self,
type: ClassType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
id: Option<BindingIdentifier<'a>>,
type_parameters: T1,
super_class: Option<Expression<'a>>,
super_type_parameters: T2,
implements: Option<Vec<'a, TSClassImplements<'a>>>,
body: T3,
abstract: bool,
declare: bool,
) -> Expression<'a>
pub fn expression_class<T1, T2, T3>( self, type: ClassType, span: Span, decorators: Vec<'a, Decorator<'a>>, id: Option<BindingIdentifier<'a>>, type_parameters: T1, super_class: Option<Expression<'a>>, super_type_parameters: T2, implements: Option<Vec<'a, TSClassImplements<'a>>>, body: T3, abstract: bool, declare: bool, ) -> Expression<'a>
Build a Expression::ClassExpression
This node contains a Class
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the class.
- id: Class identifier, AKA the name
- type_parameters
- super_class: Super class. When present, this will usually be an
IdentifierReference
. - super_type_parameters: Type parameters passed to super class.
- implements: Interface implementation clause for TypeScript classes.
- body
- r#abstract: Whether the class is abstract
- declare: Whether the class was
declare
ed
sourcepub fn expression_from_class<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_class<T>(self, inner: T) -> Expression<'a>
Convert a Class
into a Expression::ClassExpression
sourcepub fn expression_conditional(
self,
span: Span,
test: Expression<'a>,
consequent: Expression<'a>,
alternate: Expression<'a>,
) -> Expression<'a>
pub fn expression_conditional( self, span: Span, test: Expression<'a>, consequent: Expression<'a>, alternate: Expression<'a>, ) -> Expression<'a>
Build a Expression::ConditionalExpression
This node contains a ConditionalExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn expression_from_conditional<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_conditional<T>(self, inner: T) -> Expression<'a>
Convert a ConditionalExpression
into a Expression::ConditionalExpression
sourcepub fn expression_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Expression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
pub fn expression_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Expression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
Build a Expression::FunctionExpression
This node contains a Function
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - id
- generator
- r#async
- declare
- type_parameters
- this_param: Declaring
this
in a Function https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function - params
- return_type
- body
sourcepub fn expression_from_function<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_function<T>(self, inner: T) -> Expression<'a>
Convert a Function
into a Expression::FunctionExpression
sourcepub fn expression_import(
self,
span: Span,
source: Expression<'a>,
arguments: Vec<'a, Expression<'a>>,
) -> Expression<'a>
pub fn expression_import( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, ) -> Expression<'a>
Build a Expression::ImportExpression
This node contains a ImportExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - source
- arguments
sourcepub fn expression_from_import<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_import<T>(self, inner: T) -> Expression<'a>
Convert a ImportExpression
into a Expression::ImportExpression
sourcepub fn expression_logical(
self,
span: Span,
left: Expression<'a>,
operator: LogicalOperator,
right: Expression<'a>,
) -> Expression<'a>
pub fn expression_logical( self, span: Span, left: Expression<'a>, operator: LogicalOperator, right: Expression<'a>, ) -> Expression<'a>
Build a Expression::LogicalExpression
This node contains a LogicalExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn expression_from_logical<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_logical<T>(self, inner: T) -> Expression<'a>
Convert a LogicalExpression
into a Expression::LogicalExpression
sourcepub fn expression_new<T1>(
self,
span: Span,
callee: Expression<'a>,
arguments: Vec<'a, Argument<'a>>,
type_parameters: T1,
) -> Expression<'a>
pub fn expression_new<T1>( self, span: Span, callee: Expression<'a>, arguments: Vec<'a, Argument<'a>>, type_parameters: T1, ) -> Expression<'a>
Build a Expression::NewExpression
This node contains a NewExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - callee
- arguments
- type_parameters
sourcepub fn expression_from_new<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_new<T>(self, inner: T) -> Expression<'a>
Convert a NewExpression
into a Expression::NewExpression
sourcepub fn expression_object(
self,
span: Span,
properties: Vec<'a, ObjectPropertyKind<'a>>,
trailing_comma: Option<Span>,
) -> Expression<'a>
pub fn expression_object( self, span: Span, properties: Vec<'a, ObjectPropertyKind<'a>>, trailing_comma: Option<Span>, ) -> Expression<'a>
Build a Expression::ObjectExpression
This node contains a ObjectExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - properties: Properties declared in the object
- trailing_comma
sourcepub fn expression_from_object<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_object<T>(self, inner: T) -> Expression<'a>
Convert a ObjectExpression
into a Expression::ObjectExpression
sourcepub fn expression_parenthesized(
self,
span: Span,
expression: Expression<'a>,
) -> Expression<'a>
pub fn expression_parenthesized( self, span: Span, expression: Expression<'a>, ) -> Expression<'a>
Build a Expression::ParenthesizedExpression
This node contains a ParenthesizedExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn expression_from_parenthesized<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_parenthesized<T>(self, inner: T) -> Expression<'a>
Convert a ParenthesizedExpression
into a Expression::ParenthesizedExpression
sourcepub fn expression_sequence(
self,
span: Span,
expressions: Vec<'a, Expression<'a>>,
) -> Expression<'a>
pub fn expression_sequence( self, span: Span, expressions: Vec<'a, Expression<'a>>, ) -> Expression<'a>
Build a Expression::SequenceExpression
This node contains a SequenceExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expressions
sourcepub fn expression_from_sequence<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_sequence<T>(self, inner: T) -> Expression<'a>
Convert a SequenceExpression
into a Expression::SequenceExpression
sourcepub fn expression_tagged_template<T1>(
self,
span: Span,
tag: Expression<'a>,
quasi: TemplateLiteral<'a>,
type_parameters: T1,
) -> Expression<'a>
pub fn expression_tagged_template<T1>( self, span: Span, tag: Expression<'a>, quasi: TemplateLiteral<'a>, type_parameters: T1, ) -> Expression<'a>
Build a Expression::TaggedTemplateExpression
This node contains a TaggedTemplateExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - tag
- quasi
- type_parameters
sourcepub fn expression_from_tagged_template<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_tagged_template<T>(self, inner: T) -> Expression<'a>
Convert a TaggedTemplateExpression
into a Expression::TaggedTemplateExpression
sourcepub fn expression_this(self, span: Span) -> Expression<'a>
pub fn expression_this(self, span: Span) -> Expression<'a>
Build a Expression::ThisExpression
This node contains a ThisExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn expression_from_this<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_this<T>(self, inner: T) -> Expression<'a>
Convert a ThisExpression
into a Expression::ThisExpression
sourcepub fn expression_unary(
self,
span: Span,
operator: UnaryOperator,
argument: Expression<'a>,
) -> Expression<'a>
pub fn expression_unary( self, span: Span, operator: UnaryOperator, argument: Expression<'a>, ) -> Expression<'a>
Build a Expression::UnaryExpression
This node contains a UnaryExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - operator
- argument
sourcepub fn expression_from_unary<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_unary<T>(self, inner: T) -> Expression<'a>
Convert a UnaryExpression
into a Expression::UnaryExpression
sourcepub fn expression_update(
self,
span: Span,
operator: UpdateOperator,
prefix: bool,
argument: SimpleAssignmentTarget<'a>,
) -> Expression<'a>
pub fn expression_update( self, span: Span, operator: UpdateOperator, prefix: bool, argument: SimpleAssignmentTarget<'a>, ) -> Expression<'a>
Build a Expression::UpdateExpression
This node contains a UpdateExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - operator
- prefix
- argument
sourcepub fn expression_from_update<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_update<T>(self, inner: T) -> Expression<'a>
Convert a UpdateExpression
into a Expression::UpdateExpression
sourcepub fn expression_yield(
self,
span: Span,
delegate: bool,
argument: Option<Expression<'a>>,
) -> Expression<'a>
pub fn expression_yield( self, span: Span, delegate: bool, argument: Option<Expression<'a>>, ) -> Expression<'a>
Build a Expression::YieldExpression
This node contains a YieldExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - delegate
- argument
sourcepub fn expression_from_yield<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_yield<T>(self, inner: T) -> Expression<'a>
Convert a YieldExpression
into a Expression::YieldExpression
sourcepub fn expression_private_in(
self,
span: Span,
left: PrivateIdentifier<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> Expression<'a>
pub fn expression_private_in( self, span: Span, left: PrivateIdentifier<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> Expression<'a>
Build a Expression::PrivateInExpression
This node contains a PrivateInExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn expression_from_private_in<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_private_in<T>(self, inner: T) -> Expression<'a>
Convert a PrivateInExpression
into a Expression::PrivateInExpression
sourcepub fn expression_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> Expression<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
pub fn expression_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> Expression<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
Build a Expression::JSXElement
This node contains a JSXElement
that will be stored in the memory arena.
§Parameters
sourcepub fn expression_from_jsx_element<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_jsx_element<T>(self, inner: T) -> Expression<'a>
Convert a JSXElement
into a Expression::JSXElement
sourcepub fn expression_jsx_fragment(
self,
span: Span,
opening_fragment: JSXOpeningFragment,
closing_fragment: JSXClosingFragment,
children: Vec<'a, JSXChild<'a>>,
) -> Expression<'a>
pub fn expression_jsx_fragment( self, span: Span, opening_fragment: JSXOpeningFragment, closing_fragment: JSXClosingFragment, children: Vec<'a, JSXChild<'a>>, ) -> Expression<'a>
Build a Expression::JSXFragment
This node contains a JSXFragment
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - opening_fragment:
<>
- closing_fragment:
</>
- children: Elements inside the fragment.
sourcepub fn expression_from_jsx_fragment<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_jsx_fragment<T>(self, inner: T) -> Expression<'a>
Convert a JSXFragment
into a Expression::JSXFragment
sourcepub fn expression_ts_as(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Expression<'a>
pub fn expression_ts_as( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Expression<'a>
Build a Expression::TSAsExpression
This node contains a TSAsExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn expression_from_ts_as<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_ts_as<T>(self, inner: T) -> Expression<'a>
Convert a TSAsExpression
into a Expression::TSAsExpression
sourcepub fn expression_ts_satisfies(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Expression<'a>
pub fn expression_ts_satisfies( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Expression<'a>
Build a Expression::TSSatisfiesExpression
This node contains a TSSatisfiesExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn expression_from_ts_satisfies<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_ts_satisfies<T>(self, inner: T) -> Expression<'a>
Convert a TSSatisfiesExpression
into a Expression::TSSatisfiesExpression
sourcepub fn expression_ts_type_assertion(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Expression<'a>
pub fn expression_ts_type_assertion( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Expression<'a>
Build a Expression::TSTypeAssertion
This node contains a TSTypeAssertion
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn expression_from_ts_type_assertion<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_ts_type_assertion<T>(self, inner: T) -> Expression<'a>
Convert a TSTypeAssertion
into a Expression::TSTypeAssertion
sourcepub fn expression_ts_non_null(
self,
span: Span,
expression: Expression<'a>,
) -> Expression<'a>
pub fn expression_ts_non_null( self, span: Span, expression: Expression<'a>, ) -> Expression<'a>
Build a Expression::TSNonNullExpression
This node contains a TSNonNullExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn expression_from_ts_non_null<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_ts_non_null<T>(self, inner: T) -> Expression<'a>
Convert a TSNonNullExpression
into a Expression::TSNonNullExpression
sourcepub fn expression_ts_instantiation<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> Expression<'a>
pub fn expression_ts_instantiation<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> Expression<'a>
Build a Expression::TSInstantiationExpression
This node contains a TSInstantiationExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn expression_from_ts_instantiation<T>(self, inner: T) -> Expression<'a>
pub fn expression_from_ts_instantiation<T>(self, inner: T) -> Expression<'a>
Convert a TSInstantiationExpression
into a Expression::TSInstantiationExpression
pub fn expression_member(self, inner: MemberExpression<'a>) -> Expression<'a>
sourcepub fn identifier_name<A>(self, span: Span, name: A) -> IdentifierName<'a>
pub fn identifier_name<A>(self, span: Span, name: A) -> IdentifierName<'a>
Builds a IdentifierName
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_identifier_name
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn alloc_identifier_name<A>(
self,
span: Span,
name: A,
) -> Box<'a, IdentifierName<'a>>
pub fn alloc_identifier_name<A>( self, span: Span, name: A, ) -> Box<'a, IdentifierName<'a>>
Builds a IdentifierName
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::identifier_name
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn identifier_reference<A>(
self,
span: Span,
name: A,
) -> IdentifierReference<'a>
pub fn identifier_reference<A>( self, span: Span, name: A, ) -> IdentifierReference<'a>
Builds a IdentifierReference
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_identifier_reference
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn alloc_identifier_reference<A>(
self,
span: Span,
name: A,
) -> Box<'a, IdentifierReference<'a>>
pub fn alloc_identifier_reference<A>( self, span: Span, name: A, ) -> Box<'a, IdentifierReference<'a>>
Builds a IdentifierReference
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::identifier_reference
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn binding_identifier<A>(self, span: Span, name: A) -> BindingIdentifier<'a>
pub fn binding_identifier<A>(self, span: Span, name: A) -> BindingIdentifier<'a>
Builds a BindingIdentifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_binding_identifier
instead.
§Parameters
- span: The
Span
covering this node - name: The identifier name being bound.
sourcepub fn alloc_binding_identifier<A>(
self,
span: Span,
name: A,
) -> Box<'a, BindingIdentifier<'a>>
pub fn alloc_binding_identifier<A>( self, span: Span, name: A, ) -> Box<'a, BindingIdentifier<'a>>
Builds a BindingIdentifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::binding_identifier
instead.
§Parameters
- span: The
Span
covering this node - name: The identifier name being bound.
sourcepub fn label_identifier<A>(self, span: Span, name: A) -> LabelIdentifier<'a>
pub fn label_identifier<A>(self, span: Span, name: A) -> LabelIdentifier<'a>
Builds a LabelIdentifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_label_identifier
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn alloc_label_identifier<A>(
self,
span: Span,
name: A,
) -> Box<'a, LabelIdentifier<'a>>
pub fn alloc_label_identifier<A>( self, span: Span, name: A, ) -> Box<'a, LabelIdentifier<'a>>
Builds a LabelIdentifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::label_identifier
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn this_expression(self, span: Span) -> ThisExpression
pub fn this_expression(self, span: Span) -> ThisExpression
Builds a ThisExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_this_expression
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_this_expression(self, span: Span) -> Box<'a, ThisExpression>
pub fn alloc_this_expression(self, span: Span) -> Box<'a, ThisExpression>
Builds a ThisExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::this_expression
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn array_expression(
self,
span: Span,
elements: Vec<'a, ArrayExpressionElement<'a>>,
trailing_comma: Option<Span>,
) -> ArrayExpression<'a>
pub fn array_expression( self, span: Span, elements: Vec<'a, ArrayExpressionElement<'a>>, trailing_comma: Option<Span>, ) -> ArrayExpression<'a>
Builds a ArrayExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_array_expression
instead.
§Parameters
- span: The
Span
covering this node - elements
- trailing_comma: Array trailing comma
sourcepub fn alloc_array_expression(
self,
span: Span,
elements: Vec<'a, ArrayExpressionElement<'a>>,
trailing_comma: Option<Span>,
) -> Box<'a, ArrayExpression<'a>>
pub fn alloc_array_expression( self, span: Span, elements: Vec<'a, ArrayExpressionElement<'a>>, trailing_comma: Option<Span>, ) -> Box<'a, ArrayExpression<'a>>
Builds a ArrayExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::array_expression
instead.
§Parameters
- span: The
Span
covering this node - elements
- trailing_comma: Array trailing comma
sourcepub fn array_expression_element_spread_element(
self,
span: Span,
argument: Expression<'a>,
) -> ArrayExpressionElement<'a>
pub fn array_expression_element_spread_element( self, span: Span, argument: Expression<'a>, ) -> ArrayExpressionElement<'a>
Build a ArrayExpressionElement::SpreadElement
This node contains a SpreadElement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument: The expression being spread.
sourcepub fn array_expression_element_from_spread_element<T>(
self,
inner: T,
) -> ArrayExpressionElement<'a>
pub fn array_expression_element_from_spread_element<T>( self, inner: T, ) -> ArrayExpressionElement<'a>
Convert a SpreadElement
into a ArrayExpressionElement::SpreadElement
sourcepub fn array_expression_element_elision(
self,
span: Span,
) -> ArrayExpressionElement<'a>
pub fn array_expression_element_elision( self, span: Span, ) -> ArrayExpressionElement<'a>
sourcepub fn array_expression_element_from_elision<T>(
self,
inner: T,
) -> ArrayExpressionElement<'a>
pub fn array_expression_element_from_elision<T>( self, inner: T, ) -> ArrayExpressionElement<'a>
Convert a Elision
into a ArrayExpressionElement::Elision
pub fn array_expression_element_expression( self, inner: Expression<'a>, ) -> ArrayExpressionElement<'a>
sourcepub fn elision(self, span: Span) -> Elision
pub fn elision(self, span: Span) -> Elision
Builds a Elision
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_elision
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_elision(self, span: Span) -> Box<'a, Elision>
pub fn alloc_elision(self, span: Span) -> Box<'a, Elision>
Builds a Elision
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::elision
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn object_expression(
self,
span: Span,
properties: Vec<'a, ObjectPropertyKind<'a>>,
trailing_comma: Option<Span>,
) -> ObjectExpression<'a>
pub fn object_expression( self, span: Span, properties: Vec<'a, ObjectPropertyKind<'a>>, trailing_comma: Option<Span>, ) -> ObjectExpression<'a>
Builds a ObjectExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_object_expression
instead.
§Parameters
- span: The
Span
covering this node - properties: Properties declared in the object
- trailing_comma
sourcepub fn alloc_object_expression(
self,
span: Span,
properties: Vec<'a, ObjectPropertyKind<'a>>,
trailing_comma: Option<Span>,
) -> Box<'a, ObjectExpression<'a>>
pub fn alloc_object_expression( self, span: Span, properties: Vec<'a, ObjectPropertyKind<'a>>, trailing_comma: Option<Span>, ) -> Box<'a, ObjectExpression<'a>>
Builds a ObjectExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::object_expression
instead.
§Parameters
- span: The
Span
covering this node - properties: Properties declared in the object
- trailing_comma
sourcepub fn object_property_kind_object_property(
self,
span: Span,
kind: PropertyKind,
key: PropertyKey<'a>,
value: Expression<'a>,
init: Option<Expression<'a>>,
method: bool,
shorthand: bool,
computed: bool,
) -> ObjectPropertyKind<'a>
pub fn object_property_kind_object_property( self, span: Span, kind: PropertyKind, key: PropertyKey<'a>, value: Expression<'a>, init: Option<Expression<'a>>, method: bool, shorthand: bool, computed: bool, ) -> ObjectPropertyKind<'a>
Build a ObjectPropertyKind::ObjectProperty
This node contains a ObjectProperty
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - kind
- key
- value
- init
- method
- shorthand
- computed
sourcepub fn object_property_kind_from_object_property<T>(
self,
inner: T,
) -> ObjectPropertyKind<'a>
pub fn object_property_kind_from_object_property<T>( self, inner: T, ) -> ObjectPropertyKind<'a>
Convert a ObjectProperty
into a ObjectPropertyKind::ObjectProperty
sourcepub fn object_property_kind_spread_element(
self,
span: Span,
argument: Expression<'a>,
) -> ObjectPropertyKind<'a>
pub fn object_property_kind_spread_element( self, span: Span, argument: Expression<'a>, ) -> ObjectPropertyKind<'a>
Build a ObjectPropertyKind::SpreadProperty
This node contains a SpreadElement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument: The expression being spread.
sourcepub fn object_property_kind_from_spread_element<T>(
self,
inner: T,
) -> ObjectPropertyKind<'a>
pub fn object_property_kind_from_spread_element<T>( self, inner: T, ) -> ObjectPropertyKind<'a>
Convert a SpreadElement
into a ObjectPropertyKind::SpreadProperty
sourcepub fn object_property(
self,
span: Span,
kind: PropertyKind,
key: PropertyKey<'a>,
value: Expression<'a>,
init: Option<Expression<'a>>,
method: bool,
shorthand: bool,
computed: bool,
) -> ObjectProperty<'a>
pub fn object_property( self, span: Span, kind: PropertyKind, key: PropertyKey<'a>, value: Expression<'a>, init: Option<Expression<'a>>, method: bool, shorthand: bool, computed: bool, ) -> ObjectProperty<'a>
Builds a ObjectProperty
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_object_property
instead.
§Parameters
- span: The
Span
covering this node - kind
- key
- value
- init
- method
- shorthand
- computed
sourcepub fn alloc_object_property(
self,
span: Span,
kind: PropertyKind,
key: PropertyKey<'a>,
value: Expression<'a>,
init: Option<Expression<'a>>,
method: bool,
shorthand: bool,
computed: bool,
) -> Box<'a, ObjectProperty<'a>>
pub fn alloc_object_property( self, span: Span, kind: PropertyKind, key: PropertyKey<'a>, value: Expression<'a>, init: Option<Expression<'a>>, method: bool, shorthand: bool, computed: bool, ) -> Box<'a, ObjectProperty<'a>>
Builds a ObjectProperty
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::object_property
instead.
§Parameters
- span: The
Span
covering this node - kind
- key
- value
- init
- method
- shorthand
- computed
sourcepub fn property_key_identifier_name<A>(
self,
span: Span,
name: A,
) -> PropertyKey<'a>
pub fn property_key_identifier_name<A>( self, span: Span, name: A, ) -> PropertyKey<'a>
Build a PropertyKey::StaticIdentifier
This node contains a IdentifierName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn property_key_from_identifier_name<T>(self, inner: T) -> PropertyKey<'a>
pub fn property_key_from_identifier_name<T>(self, inner: T) -> PropertyKey<'a>
Convert a IdentifierName
into a PropertyKey::StaticIdentifier
sourcepub fn property_key_private_identifier<A>(
self,
span: Span,
name: A,
) -> PropertyKey<'a>
pub fn property_key_private_identifier<A>( self, span: Span, name: A, ) -> PropertyKey<'a>
Build a PropertyKey::PrivateIdentifier
This node contains a PrivateIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn property_key_from_private_identifier<T>(
self,
inner: T,
) -> PropertyKey<'a>
pub fn property_key_from_private_identifier<T>( self, inner: T, ) -> PropertyKey<'a>
Convert a PrivateIdentifier
into a PropertyKey::PrivateIdentifier
pub fn property_key_expression(self, inner: Expression<'a>) -> PropertyKey<'a>
sourcepub fn template_literal(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
expressions: Vec<'a, Expression<'a>>,
) -> TemplateLiteral<'a>
pub fn template_literal( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, expressions: Vec<'a, Expression<'a>>, ) -> TemplateLiteral<'a>
Builds a TemplateLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_template_literal
instead.
§Parameters
- span: The
Span
covering this node - quasis
- expressions
sourcepub fn alloc_template_literal(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
expressions: Vec<'a, Expression<'a>>,
) -> Box<'a, TemplateLiteral<'a>>
pub fn alloc_template_literal( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, expressions: Vec<'a, Expression<'a>>, ) -> Box<'a, TemplateLiteral<'a>>
Builds a TemplateLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::template_literal
instead.
§Parameters
- span: The
Span
covering this node - quasis
- expressions
sourcepub fn tagged_template_expression<T1>(
self,
span: Span,
tag: Expression<'a>,
quasi: TemplateLiteral<'a>,
type_parameters: T1,
) -> TaggedTemplateExpression<'a>
pub fn tagged_template_expression<T1>( self, span: Span, tag: Expression<'a>, quasi: TemplateLiteral<'a>, type_parameters: T1, ) -> TaggedTemplateExpression<'a>
Builds a TaggedTemplateExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_tagged_template_expression
instead.
§Parameters
- span: The
Span
covering this node - tag
- quasi
- type_parameters
sourcepub fn alloc_tagged_template_expression<T1>(
self,
span: Span,
tag: Expression<'a>,
quasi: TemplateLiteral<'a>,
type_parameters: T1,
) -> Box<'a, TaggedTemplateExpression<'a>>
pub fn alloc_tagged_template_expression<T1>( self, span: Span, tag: Expression<'a>, quasi: TemplateLiteral<'a>, type_parameters: T1, ) -> Box<'a, TaggedTemplateExpression<'a>>
Builds a TaggedTemplateExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::tagged_template_expression
instead.
§Parameters
- span: The
Span
covering this node - tag
- quasi
- type_parameters
sourcepub fn template_element(
self,
span: Span,
tail: bool,
value: TemplateElementValue<'a>,
) -> TemplateElement<'a>
pub fn template_element( self, span: Span, tail: bool, value: TemplateElementValue<'a>, ) -> TemplateElement<'a>
Builds a TemplateElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_template_element
instead.
§Parameters
- span: The
Span
covering this node - tail
- value
sourcepub fn alloc_template_element(
self,
span: Span,
tail: bool,
value: TemplateElementValue<'a>,
) -> Box<'a, TemplateElement<'a>>
pub fn alloc_template_element( self, span: Span, tail: bool, value: TemplateElementValue<'a>, ) -> Box<'a, TemplateElement<'a>>
Builds a TemplateElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::template_element
instead.
§Parameters
- span: The
Span
covering this node - tail
- value
sourcepub fn member_expression_computed(
self,
span: Span,
object: Expression<'a>,
expression: Expression<'a>,
optional: bool,
) -> MemberExpression<'a>
pub fn member_expression_computed( self, span: Span, object: Expression<'a>, expression: Expression<'a>, optional: bool, ) -> MemberExpression<'a>
Build a MemberExpression::ComputedMemberExpression
This node contains a ComputedMemberExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object
- expression
- optional
sourcepub fn member_expression_from_computed<T>(
self,
inner: T,
) -> MemberExpression<'a>
pub fn member_expression_from_computed<T>( self, inner: T, ) -> MemberExpression<'a>
Convert a ComputedMemberExpression
into a MemberExpression::ComputedMemberExpression
sourcepub fn member_expression_static(
self,
span: Span,
object: Expression<'a>,
property: IdentifierName<'a>,
optional: bool,
) -> MemberExpression<'a>
pub fn member_expression_static( self, span: Span, object: Expression<'a>, property: IdentifierName<'a>, optional: bool, ) -> MemberExpression<'a>
Build a MemberExpression::StaticMemberExpression
This node contains a StaticMemberExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object
- property
- optional
sourcepub fn member_expression_from_static<T>(self, inner: T) -> MemberExpression<'a>
pub fn member_expression_from_static<T>(self, inner: T) -> MemberExpression<'a>
Convert a StaticMemberExpression
into a MemberExpression::StaticMemberExpression
sourcepub fn member_expression_private_field_expression(
self,
span: Span,
object: Expression<'a>,
field: PrivateIdentifier<'a>,
optional: bool,
) -> MemberExpression<'a>
pub fn member_expression_private_field_expression( self, span: Span, object: Expression<'a>, field: PrivateIdentifier<'a>, optional: bool, ) -> MemberExpression<'a>
Build a MemberExpression::PrivateFieldExpression
This node contains a PrivateFieldExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object
- field
- optional
sourcepub fn member_expression_from_private_field_expression<T>(
self,
inner: T,
) -> MemberExpression<'a>
pub fn member_expression_from_private_field_expression<T>( self, inner: T, ) -> MemberExpression<'a>
Convert a PrivateFieldExpression
into a MemberExpression::PrivateFieldExpression
sourcepub fn computed_member_expression(
self,
span: Span,
object: Expression<'a>,
expression: Expression<'a>,
optional: bool,
) -> ComputedMemberExpression<'a>
pub fn computed_member_expression( self, span: Span, object: Expression<'a>, expression: Expression<'a>, optional: bool, ) -> ComputedMemberExpression<'a>
Builds a ComputedMemberExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_computed_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- expression
- optional
sourcepub fn alloc_computed_member_expression(
self,
span: Span,
object: Expression<'a>,
expression: Expression<'a>,
optional: bool,
) -> Box<'a, ComputedMemberExpression<'a>>
pub fn alloc_computed_member_expression( self, span: Span, object: Expression<'a>, expression: Expression<'a>, optional: bool, ) -> Box<'a, ComputedMemberExpression<'a>>
Builds a ComputedMemberExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::computed_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- expression
- optional
sourcepub fn static_member_expression(
self,
span: Span,
object: Expression<'a>,
property: IdentifierName<'a>,
optional: bool,
) -> StaticMemberExpression<'a>
pub fn static_member_expression( self, span: Span, object: Expression<'a>, property: IdentifierName<'a>, optional: bool, ) -> StaticMemberExpression<'a>
Builds a StaticMemberExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_static_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- property
- optional
sourcepub fn alloc_static_member_expression(
self,
span: Span,
object: Expression<'a>,
property: IdentifierName<'a>,
optional: bool,
) -> Box<'a, StaticMemberExpression<'a>>
pub fn alloc_static_member_expression( self, span: Span, object: Expression<'a>, property: IdentifierName<'a>, optional: bool, ) -> Box<'a, StaticMemberExpression<'a>>
Builds a StaticMemberExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::static_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- property
- optional
sourcepub fn private_field_expression(
self,
span: Span,
object: Expression<'a>,
field: PrivateIdentifier<'a>,
optional: bool,
) -> PrivateFieldExpression<'a>
pub fn private_field_expression( self, span: Span, object: Expression<'a>, field: PrivateIdentifier<'a>, optional: bool, ) -> PrivateFieldExpression<'a>
Builds a PrivateFieldExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_private_field_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- field
- optional
sourcepub fn alloc_private_field_expression(
self,
span: Span,
object: Expression<'a>,
field: PrivateIdentifier<'a>,
optional: bool,
) -> Box<'a, PrivateFieldExpression<'a>>
pub fn alloc_private_field_expression( self, span: Span, object: Expression<'a>, field: PrivateIdentifier<'a>, optional: bool, ) -> Box<'a, PrivateFieldExpression<'a>>
Builds a PrivateFieldExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::private_field_expression
instead.
§Parameters
- span: The
Span
covering this node - object
- field
- optional
sourcepub fn call_expression<T1>(
self,
span: Span,
callee: Expression<'a>,
type_parameters: T1,
arguments: Vec<'a, Argument<'a>>,
optional: bool,
) -> CallExpression<'a>
pub fn call_expression<T1>( self, span: Span, callee: Expression<'a>, type_parameters: T1, arguments: Vec<'a, Argument<'a>>, optional: bool, ) -> CallExpression<'a>
Builds a CallExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_call_expression
instead.
§Parameters
- span: The
Span
covering this node - callee
- type_parameters
- arguments
- optional
sourcepub fn alloc_call_expression<T1>(
self,
span: Span,
callee: Expression<'a>,
type_parameters: T1,
arguments: Vec<'a, Argument<'a>>,
optional: bool,
) -> Box<'a, CallExpression<'a>>
pub fn alloc_call_expression<T1>( self, span: Span, callee: Expression<'a>, type_parameters: T1, arguments: Vec<'a, Argument<'a>>, optional: bool, ) -> Box<'a, CallExpression<'a>>
Builds a CallExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::call_expression
instead.
§Parameters
- span: The
Span
covering this node - callee
- type_parameters
- arguments
- optional
sourcepub fn new_expression<T1>(
self,
span: Span,
callee: Expression<'a>,
arguments: Vec<'a, Argument<'a>>,
type_parameters: T1,
) -> NewExpression<'a>
pub fn new_expression<T1>( self, span: Span, callee: Expression<'a>, arguments: Vec<'a, Argument<'a>>, type_parameters: T1, ) -> NewExpression<'a>
Builds a NewExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_new_expression
instead.
§Parameters
- span: The
Span
covering this node - callee
- arguments
- type_parameters
sourcepub fn alloc_new_expression<T1>(
self,
span: Span,
callee: Expression<'a>,
arguments: Vec<'a, Argument<'a>>,
type_parameters: T1,
) -> Box<'a, NewExpression<'a>>
pub fn alloc_new_expression<T1>( self, span: Span, callee: Expression<'a>, arguments: Vec<'a, Argument<'a>>, type_parameters: T1, ) -> Box<'a, NewExpression<'a>>
Builds a NewExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::new_expression
instead.
§Parameters
- span: The
Span
covering this node - callee
- arguments
- type_parameters
sourcepub fn meta_property(
self,
span: Span,
meta: IdentifierName<'a>,
property: IdentifierName<'a>,
) -> MetaProperty<'a>
pub fn meta_property( self, span: Span, meta: IdentifierName<'a>, property: IdentifierName<'a>, ) -> MetaProperty<'a>
Builds a MetaProperty
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_meta_property
instead.
§Parameters
- span: The
Span
covering this node - meta
- property
sourcepub fn alloc_meta_property(
self,
span: Span,
meta: IdentifierName<'a>,
property: IdentifierName<'a>,
) -> Box<'a, MetaProperty<'a>>
pub fn alloc_meta_property( self, span: Span, meta: IdentifierName<'a>, property: IdentifierName<'a>, ) -> Box<'a, MetaProperty<'a>>
Builds a MetaProperty
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::meta_property
instead.
§Parameters
- span: The
Span
covering this node - meta
- property
sourcepub fn spread_element(
self,
span: Span,
argument: Expression<'a>,
) -> SpreadElement<'a>
pub fn spread_element( self, span: Span, argument: Expression<'a>, ) -> SpreadElement<'a>
Builds a SpreadElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_spread_element
instead.
§Parameters
- span: The
Span
covering this node - argument: The expression being spread.
sourcepub fn alloc_spread_element(
self,
span: Span,
argument: Expression<'a>,
) -> Box<'a, SpreadElement<'a>>
pub fn alloc_spread_element( self, span: Span, argument: Expression<'a>, ) -> Box<'a, SpreadElement<'a>>
Builds a SpreadElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::spread_element
instead.
§Parameters
- span: The
Span
covering this node - argument: The expression being spread.
sourcepub fn argument_spread_element(
self,
span: Span,
argument: Expression<'a>,
) -> Argument<'a>
pub fn argument_spread_element( self, span: Span, argument: Expression<'a>, ) -> Argument<'a>
Build a Argument::SpreadElement
This node contains a SpreadElement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument: The expression being spread.
sourcepub fn argument_from_spread_element<T>(self, inner: T) -> Argument<'a>
pub fn argument_from_spread_element<T>(self, inner: T) -> Argument<'a>
Convert a SpreadElement
into a Argument::SpreadElement
pub fn argument_expression(self, inner: Expression<'a>) -> Argument<'a>
sourcepub fn update_expression(
self,
span: Span,
operator: UpdateOperator,
prefix: bool,
argument: SimpleAssignmentTarget<'a>,
) -> UpdateExpression<'a>
pub fn update_expression( self, span: Span, operator: UpdateOperator, prefix: bool, argument: SimpleAssignmentTarget<'a>, ) -> UpdateExpression<'a>
Builds a UpdateExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_update_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- prefix
- argument
sourcepub fn alloc_update_expression(
self,
span: Span,
operator: UpdateOperator,
prefix: bool,
argument: SimpleAssignmentTarget<'a>,
) -> Box<'a, UpdateExpression<'a>>
pub fn alloc_update_expression( self, span: Span, operator: UpdateOperator, prefix: bool, argument: SimpleAssignmentTarget<'a>, ) -> Box<'a, UpdateExpression<'a>>
Builds a UpdateExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::update_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- prefix
- argument
sourcepub fn unary_expression(
self,
span: Span,
operator: UnaryOperator,
argument: Expression<'a>,
) -> UnaryExpression<'a>
pub fn unary_expression( self, span: Span, operator: UnaryOperator, argument: Expression<'a>, ) -> UnaryExpression<'a>
Builds a UnaryExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_unary_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- argument
sourcepub fn alloc_unary_expression(
self,
span: Span,
operator: UnaryOperator,
argument: Expression<'a>,
) -> Box<'a, UnaryExpression<'a>>
pub fn alloc_unary_expression( self, span: Span, operator: UnaryOperator, argument: Expression<'a>, ) -> Box<'a, UnaryExpression<'a>>
Builds a UnaryExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::unary_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- argument
sourcepub fn binary_expression(
self,
span: Span,
left: Expression<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> BinaryExpression<'a>
pub fn binary_expression( self, span: Span, left: Expression<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> BinaryExpression<'a>
Builds a BinaryExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_binary_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn alloc_binary_expression(
self,
span: Span,
left: Expression<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> Box<'a, BinaryExpression<'a>>
pub fn alloc_binary_expression( self, span: Span, left: Expression<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> Box<'a, BinaryExpression<'a>>
Builds a BinaryExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::binary_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn private_in_expression(
self,
span: Span,
left: PrivateIdentifier<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> PrivateInExpression<'a>
pub fn private_in_expression( self, span: Span, left: PrivateIdentifier<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> PrivateInExpression<'a>
Builds a PrivateInExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_private_in_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn alloc_private_in_expression(
self,
span: Span,
left: PrivateIdentifier<'a>,
operator: BinaryOperator,
right: Expression<'a>,
) -> Box<'a, PrivateInExpression<'a>>
pub fn alloc_private_in_expression( self, span: Span, left: PrivateIdentifier<'a>, operator: BinaryOperator, right: Expression<'a>, ) -> Box<'a, PrivateInExpression<'a>>
Builds a PrivateInExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::private_in_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn logical_expression(
self,
span: Span,
left: Expression<'a>,
operator: LogicalOperator,
right: Expression<'a>,
) -> LogicalExpression<'a>
pub fn logical_expression( self, span: Span, left: Expression<'a>, operator: LogicalOperator, right: Expression<'a>, ) -> LogicalExpression<'a>
Builds a LogicalExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_logical_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn alloc_logical_expression(
self,
span: Span,
left: Expression<'a>,
operator: LogicalOperator,
right: Expression<'a>,
) -> Box<'a, LogicalExpression<'a>>
pub fn alloc_logical_expression( self, span: Span, left: Expression<'a>, operator: LogicalOperator, right: Expression<'a>, ) -> Box<'a, LogicalExpression<'a>>
Builds a LogicalExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::logical_expression
instead.
§Parameters
- span: The
Span
covering this node - left
- operator
- right
sourcepub fn conditional_expression(
self,
span: Span,
test: Expression<'a>,
consequent: Expression<'a>,
alternate: Expression<'a>,
) -> ConditionalExpression<'a>
pub fn conditional_expression( self, span: Span, test: Expression<'a>, consequent: Expression<'a>, alternate: Expression<'a>, ) -> ConditionalExpression<'a>
Builds a ConditionalExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_conditional_expression
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn alloc_conditional_expression(
self,
span: Span,
test: Expression<'a>,
consequent: Expression<'a>,
alternate: Expression<'a>,
) -> Box<'a, ConditionalExpression<'a>>
pub fn alloc_conditional_expression( self, span: Span, test: Expression<'a>, consequent: Expression<'a>, alternate: Expression<'a>, ) -> Box<'a, ConditionalExpression<'a>>
Builds a ConditionalExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::conditional_expression
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn assignment_expression(
self,
span: Span,
operator: AssignmentOperator,
left: AssignmentTarget<'a>,
right: Expression<'a>,
) -> AssignmentExpression<'a>
pub fn assignment_expression( self, span: Span, operator: AssignmentOperator, left: AssignmentTarget<'a>, right: Expression<'a>, ) -> AssignmentExpression<'a>
Builds a AssignmentExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- left
- right
sourcepub fn alloc_assignment_expression(
self,
span: Span,
operator: AssignmentOperator,
left: AssignmentTarget<'a>,
right: Expression<'a>,
) -> Box<'a, AssignmentExpression<'a>>
pub fn alloc_assignment_expression( self, span: Span, operator: AssignmentOperator, left: AssignmentTarget<'a>, right: Expression<'a>, ) -> Box<'a, AssignmentExpression<'a>>
Builds a AssignmentExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_expression
instead.
§Parameters
- span: The
Span
covering this node - operator
- left
- right
pub fn assignment_target_simple( self, inner: SimpleAssignmentTarget<'a>, ) -> AssignmentTarget<'a>
pub fn assignment_target_assignment_target_pattern( self, inner: AssignmentTargetPattern<'a>, ) -> AssignmentTarget<'a>
sourcepub fn simple_assignment_target_identifier_reference<A>(
self,
span: Span,
name: A,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_identifier_reference<A>( self, span: Span, name: A, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::AssignmentTargetIdentifier
This node contains a IdentifierReference
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn simple_assignment_target_from_identifier_reference<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_identifier_reference<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
Convert a IdentifierReference
into a SimpleAssignmentTarget::AssignmentTargetIdentifier
sourcepub fn simple_assignment_target_ts_as_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_ts_as_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::TSAsExpression
This node contains a TSAsExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn simple_assignment_target_from_ts_as_expression<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_ts_as_expression<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
Convert a TSAsExpression
into a SimpleAssignmentTarget::TSAsExpression
sourcepub fn simple_assignment_target_ts_satisfies_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_ts_satisfies_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::TSSatisfiesExpression
This node contains a TSSatisfiesExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn simple_assignment_target_from_ts_satisfies_expression<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_ts_satisfies_expression<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
Convert a TSSatisfiesExpression
into a SimpleAssignmentTarget::TSSatisfiesExpression
sourcepub fn simple_assignment_target_ts_non_null_expression(
self,
span: Span,
expression: Expression<'a>,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_ts_non_null_expression( self, span: Span, expression: Expression<'a>, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::TSNonNullExpression
This node contains a TSNonNullExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn simple_assignment_target_from_ts_non_null_expression<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_ts_non_null_expression<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
Convert a TSNonNullExpression
into a SimpleAssignmentTarget::TSNonNullExpression
sourcepub fn simple_assignment_target_ts_type_assertion(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_ts_type_assertion( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::TSTypeAssertion
This node contains a TSTypeAssertion
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn simple_assignment_target_from_ts_type_assertion<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_ts_type_assertion<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
Convert a TSTypeAssertion
into a SimpleAssignmentTarget::TSTypeAssertion
sourcepub fn simple_assignment_target_ts_instantiation_expression<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_ts_instantiation_expression<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> SimpleAssignmentTarget<'a>
Build a SimpleAssignmentTarget::TSInstantiationExpression
This node contains a TSInstantiationExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn simple_assignment_target_from_ts_instantiation_expression<T>(
self,
inner: T,
) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_from_ts_instantiation_expression<T>( self, inner: T, ) -> SimpleAssignmentTarget<'a>
pub fn simple_assignment_target_member_expression( self, inner: MemberExpression<'a>, ) -> SimpleAssignmentTarget<'a>
sourcepub fn assignment_target_pattern_array_assignment_target(
self,
span: Span,
elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>,
rest: Option<AssignmentTargetRest<'a>>,
trailing_comma: Option<Span>,
) -> AssignmentTargetPattern<'a>
pub fn assignment_target_pattern_array_assignment_target( self, span: Span, elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>, rest: Option<AssignmentTargetRest<'a>>, trailing_comma: Option<Span>, ) -> AssignmentTargetPattern<'a>
Build a AssignmentTargetPattern::ArrayAssignmentTarget
This node contains a ArrayAssignmentTarget
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - elements
- rest
- trailing_comma
sourcepub fn assignment_target_pattern_from_array_assignment_target<T>(
self,
inner: T,
) -> AssignmentTargetPattern<'a>
pub fn assignment_target_pattern_from_array_assignment_target<T>( self, inner: T, ) -> AssignmentTargetPattern<'a>
Convert a ArrayAssignmentTarget
into a AssignmentTargetPattern::ArrayAssignmentTarget
sourcepub fn assignment_target_pattern_object_assignment_target(
self,
span: Span,
properties: Vec<'a, AssignmentTargetProperty<'a>>,
rest: Option<AssignmentTargetRest<'a>>,
) -> AssignmentTargetPattern<'a>
pub fn assignment_target_pattern_object_assignment_target( self, span: Span, properties: Vec<'a, AssignmentTargetProperty<'a>>, rest: Option<AssignmentTargetRest<'a>>, ) -> AssignmentTargetPattern<'a>
Build a AssignmentTargetPattern::ObjectAssignmentTarget
This node contains a ObjectAssignmentTarget
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn assignment_target_pattern_from_object_assignment_target<T>(
self,
inner: T,
) -> AssignmentTargetPattern<'a>
pub fn assignment_target_pattern_from_object_assignment_target<T>( self, inner: T, ) -> AssignmentTargetPattern<'a>
Convert a ObjectAssignmentTarget
into a AssignmentTargetPattern::ObjectAssignmentTarget
sourcepub fn array_assignment_target(
self,
span: Span,
elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>,
rest: Option<AssignmentTargetRest<'a>>,
trailing_comma: Option<Span>,
) -> ArrayAssignmentTarget<'a>
pub fn array_assignment_target( self, span: Span, elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>, rest: Option<AssignmentTargetRest<'a>>, trailing_comma: Option<Span>, ) -> ArrayAssignmentTarget<'a>
Builds a ArrayAssignmentTarget
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_array_assignment_target
instead.
§Parameters
- span: The
Span
covering this node - elements
- rest
- trailing_comma
sourcepub fn alloc_array_assignment_target(
self,
span: Span,
elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>,
rest: Option<AssignmentTargetRest<'a>>,
trailing_comma: Option<Span>,
) -> Box<'a, ArrayAssignmentTarget<'a>>
pub fn alloc_array_assignment_target( self, span: Span, elements: Vec<'a, Option<AssignmentTargetMaybeDefault<'a>>>, rest: Option<AssignmentTargetRest<'a>>, trailing_comma: Option<Span>, ) -> Box<'a, ArrayAssignmentTarget<'a>>
Builds a ArrayAssignmentTarget
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::array_assignment_target
instead.
§Parameters
- span: The
Span
covering this node - elements
- rest
- trailing_comma
sourcepub fn object_assignment_target(
self,
span: Span,
properties: Vec<'a, AssignmentTargetProperty<'a>>,
rest: Option<AssignmentTargetRest<'a>>,
) -> ObjectAssignmentTarget<'a>
pub fn object_assignment_target( self, span: Span, properties: Vec<'a, AssignmentTargetProperty<'a>>, rest: Option<AssignmentTargetRest<'a>>, ) -> ObjectAssignmentTarget<'a>
Builds a ObjectAssignmentTarget
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_object_assignment_target
instead.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn alloc_object_assignment_target(
self,
span: Span,
properties: Vec<'a, AssignmentTargetProperty<'a>>,
rest: Option<AssignmentTargetRest<'a>>,
) -> Box<'a, ObjectAssignmentTarget<'a>>
pub fn alloc_object_assignment_target( self, span: Span, properties: Vec<'a, AssignmentTargetProperty<'a>>, rest: Option<AssignmentTargetRest<'a>>, ) -> Box<'a, ObjectAssignmentTarget<'a>>
Builds a ObjectAssignmentTarget
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::object_assignment_target
instead.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn assignment_target_rest(
self,
span: Span,
target: AssignmentTarget<'a>,
) -> AssignmentTargetRest<'a>
pub fn assignment_target_rest( self, span: Span, target: AssignmentTarget<'a>, ) -> AssignmentTargetRest<'a>
Builds a AssignmentTargetRest
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_target_rest
instead.
§Parameters
- span: The
Span
covering this node - target
sourcepub fn alloc_assignment_target_rest(
self,
span: Span,
target: AssignmentTarget<'a>,
) -> Box<'a, AssignmentTargetRest<'a>>
pub fn alloc_assignment_target_rest( self, span: Span, target: AssignmentTarget<'a>, ) -> Box<'a, AssignmentTargetRest<'a>>
Builds a AssignmentTargetRest
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_target_rest
instead.
§Parameters
- span: The
Span
covering this node - target
sourcepub fn assignment_target_maybe_default_assignment_target_with_default(
self,
span: Span,
binding: AssignmentTarget<'a>,
init: Expression<'a>,
) -> AssignmentTargetMaybeDefault<'a>
pub fn assignment_target_maybe_default_assignment_target_with_default( self, span: Span, binding: AssignmentTarget<'a>, init: Expression<'a>, ) -> AssignmentTargetMaybeDefault<'a>
Build a AssignmentTargetMaybeDefault::AssignmentTargetWithDefault
This node contains a AssignmentTargetWithDefault
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn assignment_target_maybe_default_from_assignment_target_with_default<T>(
self,
inner: T,
) -> AssignmentTargetMaybeDefault<'a>
pub fn assignment_target_maybe_default_from_assignment_target_with_default<T>( self, inner: T, ) -> AssignmentTargetMaybeDefault<'a>
pub fn assignment_target_maybe_default_assignment_target( self, inner: AssignmentTarget<'a>, ) -> AssignmentTargetMaybeDefault<'a>
sourcepub fn assignment_target_with_default(
self,
span: Span,
binding: AssignmentTarget<'a>,
init: Expression<'a>,
) -> AssignmentTargetWithDefault<'a>
pub fn assignment_target_with_default( self, span: Span, binding: AssignmentTarget<'a>, init: Expression<'a>, ) -> AssignmentTargetWithDefault<'a>
Builds a AssignmentTargetWithDefault
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_target_with_default
instead.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn alloc_assignment_target_with_default(
self,
span: Span,
binding: AssignmentTarget<'a>,
init: Expression<'a>,
) -> Box<'a, AssignmentTargetWithDefault<'a>>
pub fn alloc_assignment_target_with_default( self, span: Span, binding: AssignmentTarget<'a>, init: Expression<'a>, ) -> Box<'a, AssignmentTargetWithDefault<'a>>
Builds a AssignmentTargetWithDefault
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_target_with_default
instead.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn assignment_target_property_assignment_target_property_identifier(
self,
span: Span,
binding: IdentifierReference<'a>,
init: Option<Expression<'a>>,
) -> AssignmentTargetProperty<'a>
pub fn assignment_target_property_assignment_target_property_identifier( self, span: Span, binding: IdentifierReference<'a>, init: Option<Expression<'a>>, ) -> AssignmentTargetProperty<'a>
Build a AssignmentTargetProperty::AssignmentTargetPropertyIdentifier
This node contains a AssignmentTargetPropertyIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn assignment_target_property_from_assignment_target_property_identifier<T>(
self,
inner: T,
) -> AssignmentTargetProperty<'a>
pub fn assignment_target_property_from_assignment_target_property_identifier<T>( self, inner: T, ) -> AssignmentTargetProperty<'a>
sourcepub fn assignment_target_property_assignment_target_property_property(
self,
span: Span,
name: PropertyKey<'a>,
binding: AssignmentTargetMaybeDefault<'a>,
) -> AssignmentTargetProperty<'a>
pub fn assignment_target_property_assignment_target_property_property( self, span: Span, name: PropertyKey<'a>, binding: AssignmentTargetMaybeDefault<'a>, ) -> AssignmentTargetProperty<'a>
Build a AssignmentTargetProperty::AssignmentTargetPropertyProperty
This node contains a AssignmentTargetPropertyProperty
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name
- binding
sourcepub fn assignment_target_property_from_assignment_target_property_property<T>(
self,
inner: T,
) -> AssignmentTargetProperty<'a>
pub fn assignment_target_property_from_assignment_target_property_property<T>( self, inner: T, ) -> AssignmentTargetProperty<'a>
sourcepub fn assignment_target_property_identifier(
self,
span: Span,
binding: IdentifierReference<'a>,
init: Option<Expression<'a>>,
) -> AssignmentTargetPropertyIdentifier<'a>
pub fn assignment_target_property_identifier( self, span: Span, binding: IdentifierReference<'a>, init: Option<Expression<'a>>, ) -> AssignmentTargetPropertyIdentifier<'a>
Builds a AssignmentTargetPropertyIdentifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_target_property_identifier
instead.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn alloc_assignment_target_property_identifier(
self,
span: Span,
binding: IdentifierReference<'a>,
init: Option<Expression<'a>>,
) -> Box<'a, AssignmentTargetPropertyIdentifier<'a>>
pub fn alloc_assignment_target_property_identifier( self, span: Span, binding: IdentifierReference<'a>, init: Option<Expression<'a>>, ) -> Box<'a, AssignmentTargetPropertyIdentifier<'a>>
Builds a AssignmentTargetPropertyIdentifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_target_property_identifier
instead.
§Parameters
- span: The
Span
covering this node - binding
- init
sourcepub fn assignment_target_property_property(
self,
span: Span,
name: PropertyKey<'a>,
binding: AssignmentTargetMaybeDefault<'a>,
) -> AssignmentTargetPropertyProperty<'a>
pub fn assignment_target_property_property( self, span: Span, name: PropertyKey<'a>, binding: AssignmentTargetMaybeDefault<'a>, ) -> AssignmentTargetPropertyProperty<'a>
Builds a AssignmentTargetPropertyProperty
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_target_property_property
instead.
§Parameters
- span: The
Span
covering this node - name
- binding
sourcepub fn alloc_assignment_target_property_property(
self,
span: Span,
name: PropertyKey<'a>,
binding: AssignmentTargetMaybeDefault<'a>,
) -> Box<'a, AssignmentTargetPropertyProperty<'a>>
pub fn alloc_assignment_target_property_property( self, span: Span, name: PropertyKey<'a>, binding: AssignmentTargetMaybeDefault<'a>, ) -> Box<'a, AssignmentTargetPropertyProperty<'a>>
Builds a AssignmentTargetPropertyProperty
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_target_property_property
instead.
§Parameters
- span: The
Span
covering this node - name
- binding
sourcepub fn sequence_expression(
self,
span: Span,
expressions: Vec<'a, Expression<'a>>,
) -> SequenceExpression<'a>
pub fn sequence_expression( self, span: Span, expressions: Vec<'a, Expression<'a>>, ) -> SequenceExpression<'a>
Builds a SequenceExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_sequence_expression
instead.
§Parameters
- span: The
Span
covering this node - expressions
sourcepub fn alloc_sequence_expression(
self,
span: Span,
expressions: Vec<'a, Expression<'a>>,
) -> Box<'a, SequenceExpression<'a>>
pub fn alloc_sequence_expression( self, span: Span, expressions: Vec<'a, Expression<'a>>, ) -> Box<'a, SequenceExpression<'a>>
Builds a SequenceExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::sequence_expression
instead.
§Parameters
- span: The
Span
covering this node - expressions
sourcepub fn super_(self, span: Span) -> Super
pub fn super_(self, span: Span) -> Super
Builds a Super
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_super_
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_super_(self, span: Span) -> Box<'a, Super>
pub fn alloc_super_(self, span: Span) -> Box<'a, Super>
Builds a Super
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::super_
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn await_expression(
self,
span: Span,
argument: Expression<'a>,
) -> AwaitExpression<'a>
pub fn await_expression( self, span: Span, argument: Expression<'a>, ) -> AwaitExpression<'a>
Builds a AwaitExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_await_expression
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn alloc_await_expression(
self,
span: Span,
argument: Expression<'a>,
) -> Box<'a, AwaitExpression<'a>>
pub fn alloc_await_expression( self, span: Span, argument: Expression<'a>, ) -> Box<'a, AwaitExpression<'a>>
Builds a AwaitExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::await_expression
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn chain_expression(
self,
span: Span,
expression: ChainElement<'a>,
) -> ChainExpression<'a>
pub fn chain_expression( self, span: Span, expression: ChainElement<'a>, ) -> ChainExpression<'a>
Builds a ChainExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_chain_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_chain_expression(
self,
span: Span,
expression: ChainElement<'a>,
) -> Box<'a, ChainExpression<'a>>
pub fn alloc_chain_expression( self, span: Span, expression: ChainElement<'a>, ) -> Box<'a, ChainExpression<'a>>
Builds a ChainExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::chain_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn chain_element_call_expression<T1>(
self,
span: Span,
callee: Expression<'a>,
type_parameters: T1,
arguments: Vec<'a, Argument<'a>>,
optional: bool,
) -> ChainElement<'a>
pub fn chain_element_call_expression<T1>( self, span: Span, callee: Expression<'a>, type_parameters: T1, arguments: Vec<'a, Argument<'a>>, optional: bool, ) -> ChainElement<'a>
Build a ChainElement::CallExpression
This node contains a CallExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - callee
- type_parameters
- arguments
- optional
sourcepub fn chain_element_from_call_expression<T>(self, inner: T) -> ChainElement<'a>
pub fn chain_element_from_call_expression<T>(self, inner: T) -> ChainElement<'a>
Convert a CallExpression
into a ChainElement::CallExpression
pub fn chain_element_member_expression( self, inner: MemberExpression<'a>, ) -> ChainElement<'a>
sourcepub fn parenthesized_expression(
self,
span: Span,
expression: Expression<'a>,
) -> ParenthesizedExpression<'a>
pub fn parenthesized_expression( self, span: Span, expression: Expression<'a>, ) -> ParenthesizedExpression<'a>
Builds a ParenthesizedExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_parenthesized_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_parenthesized_expression(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, ParenthesizedExpression<'a>>
pub fn alloc_parenthesized_expression( self, span: Span, expression: Expression<'a>, ) -> Box<'a, ParenthesizedExpression<'a>>
Builds a ParenthesizedExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::parenthesized_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn statement_block(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> Statement<'a>
pub fn statement_block( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> Statement<'a>
Build a Statement::BlockStatement
This node contains a BlockStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn statement_from_block<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_block<T>(self, inner: T) -> Statement<'a>
Convert a BlockStatement
into a Statement::BlockStatement
sourcepub fn statement_break(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> Statement<'a>
pub fn statement_break( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> Statement<'a>
Build a Statement::BreakStatement
This node contains a BreakStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn statement_from_break<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_break<T>(self, inner: T) -> Statement<'a>
Convert a BreakStatement
into a Statement::BreakStatement
sourcepub fn statement_continue(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> Statement<'a>
pub fn statement_continue( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> Statement<'a>
Build a Statement::ContinueStatement
This node contains a ContinueStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn statement_from_continue<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_continue<T>(self, inner: T) -> Statement<'a>
Convert a ContinueStatement
into a Statement::ContinueStatement
sourcepub fn statement_debugger(self, span: Span) -> Statement<'a>
pub fn statement_debugger(self, span: Span) -> Statement<'a>
Build a Statement::DebuggerStatement
This node contains a DebuggerStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn statement_from_debugger<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_debugger<T>(self, inner: T) -> Statement<'a>
Convert a DebuggerStatement
into a Statement::DebuggerStatement
sourcepub fn statement_do_while(
self,
span: Span,
body: Statement<'a>,
test: Expression<'a>,
) -> Statement<'a>
pub fn statement_do_while( self, span: Span, body: Statement<'a>, test: Expression<'a>, ) -> Statement<'a>
Build a Statement::DoWhileStatement
This node contains a DoWhileStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - body
- test
sourcepub fn statement_from_do_while<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_do_while<T>(self, inner: T) -> Statement<'a>
Convert a DoWhileStatement
into a Statement::DoWhileStatement
sourcepub fn statement_empty(self, span: Span) -> Statement<'a>
pub fn statement_empty(self, span: Span) -> Statement<'a>
Build a Statement::EmptyStatement
This node contains a EmptyStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn statement_from_empty<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_empty<T>(self, inner: T) -> Statement<'a>
Convert a EmptyStatement
into a Statement::EmptyStatement
sourcepub fn statement_expression(
self,
span: Span,
expression: Expression<'a>,
) -> Statement<'a>
pub fn statement_expression( self, span: Span, expression: Expression<'a>, ) -> Statement<'a>
Build a Statement::ExpressionStatement
This node contains a ExpressionStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn statement_from_expression<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_expression<T>(self, inner: T) -> Statement<'a>
Convert a ExpressionStatement
into a Statement::ExpressionStatement
sourcepub fn statement_for_in(
self,
span: Span,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_for_in( self, span: Span, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::ForInStatement
This node contains a ForInStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- right
- body
sourcepub fn statement_from_for_in<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_for_in<T>(self, inner: T) -> Statement<'a>
Convert a ForInStatement
into a Statement::ForInStatement
sourcepub fn statement_for_of(
self,
span: Span,
await: bool,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_for_of( self, span: Span, await: bool, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::ForOfStatement
This node contains a ForOfStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - r#await
- left
- right
- body
sourcepub fn statement_from_for_of<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_for_of<T>(self, inner: T) -> Statement<'a>
Convert a ForOfStatement
into a Statement::ForOfStatement
sourcepub fn statement_for(
self,
span: Span,
init: Option<ForStatementInit<'a>>,
test: Option<Expression<'a>>,
update: Option<Expression<'a>>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_for( self, span: Span, init: Option<ForStatementInit<'a>>, test: Option<Expression<'a>>, update: Option<Expression<'a>>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::ForStatement
This node contains a ForStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - init
- test
- update
- body
sourcepub fn statement_from_for<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_for<T>(self, inner: T) -> Statement<'a>
Convert a ForStatement
into a Statement::ForStatement
sourcepub fn statement_if(
self,
span: Span,
test: Expression<'a>,
consequent: Statement<'a>,
alternate: Option<Statement<'a>>,
) -> Statement<'a>
pub fn statement_if( self, span: Span, test: Expression<'a>, consequent: Statement<'a>, alternate: Option<Statement<'a>>, ) -> Statement<'a>
Build a Statement::IfStatement
This node contains a IfStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn statement_from_if<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_if<T>(self, inner: T) -> Statement<'a>
Convert a IfStatement
into a Statement::IfStatement
sourcepub fn statement_labeled(
self,
span: Span,
label: LabelIdentifier<'a>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_labeled( self, span: Span, label: LabelIdentifier<'a>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::LabeledStatement
This node contains a LabeledStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - label
- body
sourcepub fn statement_from_labeled<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_labeled<T>(self, inner: T) -> Statement<'a>
Convert a LabeledStatement
into a Statement::LabeledStatement
sourcepub fn statement_return(
self,
span: Span,
argument: Option<Expression<'a>>,
) -> Statement<'a>
pub fn statement_return( self, span: Span, argument: Option<Expression<'a>>, ) -> Statement<'a>
Build a Statement::ReturnStatement
This node contains a ReturnStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn statement_from_return<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_return<T>(self, inner: T) -> Statement<'a>
Convert a ReturnStatement
into a Statement::ReturnStatement
sourcepub fn statement_switch(
self,
span: Span,
discriminant: Expression<'a>,
cases: Vec<'a, SwitchCase<'a>>,
) -> Statement<'a>
pub fn statement_switch( self, span: Span, discriminant: Expression<'a>, cases: Vec<'a, SwitchCase<'a>>, ) -> Statement<'a>
Build a Statement::SwitchStatement
This node contains a SwitchStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - discriminant
- cases
sourcepub fn statement_from_switch<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_switch<T>(self, inner: T) -> Statement<'a>
Convert a SwitchStatement
into a Statement::SwitchStatement
sourcepub fn statement_throw(
self,
span: Span,
argument: Expression<'a>,
) -> Statement<'a>
pub fn statement_throw( self, span: Span, argument: Expression<'a>, ) -> Statement<'a>
Build a Statement::ThrowStatement
This node contains a ThrowStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn statement_from_throw<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_throw<T>(self, inner: T) -> Statement<'a>
Convert a ThrowStatement
into a Statement::ThrowStatement
sourcepub fn statement_try<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> Statement<'a>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
pub fn statement_try<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> Statement<'a>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
Build a Statement::TryStatement
This node contains a TryStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - block
- handler
- finalizer
sourcepub fn statement_from_try<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_try<T>(self, inner: T) -> Statement<'a>
Convert a TryStatement
into a Statement::TryStatement
sourcepub fn statement_while(
self,
span: Span,
test: Expression<'a>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_while( self, span: Span, test: Expression<'a>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::WhileStatement
This node contains a WhileStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - test
- body
sourcepub fn statement_from_while<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_while<T>(self, inner: T) -> Statement<'a>
Convert a WhileStatement
into a Statement::WhileStatement
sourcepub fn statement_with(
self,
span: Span,
object: Expression<'a>,
body: Statement<'a>,
) -> Statement<'a>
pub fn statement_with( self, span: Span, object: Expression<'a>, body: Statement<'a>, ) -> Statement<'a>
Build a Statement::WithStatement
This node contains a WithStatement
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object
- body
sourcepub fn statement_from_with<T>(self, inner: T) -> Statement<'a>
pub fn statement_from_with<T>(self, inner: T) -> Statement<'a>
Convert a WithStatement
into a Statement::WithStatement
pub fn statement_declaration(self, inner: Declaration<'a>) -> Statement<'a>
pub fn statement_module_declaration( self, inner: ModuleDeclaration<'a>, ) -> Statement<'a>
sourcepub fn directive<A>(
self,
span: Span,
expression: StringLiteral<'a>,
directive: A,
) -> Directive<'a>
pub fn directive<A>( self, span: Span, expression: StringLiteral<'a>, directive: A, ) -> Directive<'a>
Builds a Directive
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_directive
instead.
§Parameters
- span: The
Span
covering this node - expression: Directive with any escapes unescaped
- directive: Raw content of directive as it appears in source, any escapes left as is
sourcepub fn alloc_directive<A>(
self,
span: Span,
expression: StringLiteral<'a>,
directive: A,
) -> Box<'a, Directive<'a>>
pub fn alloc_directive<A>( self, span: Span, expression: StringLiteral<'a>, directive: A, ) -> Box<'a, Directive<'a>>
Builds a Directive
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::directive
instead.
§Parameters
- span: The
Span
covering this node - expression: Directive with any escapes unescaped
- directive: Raw content of directive as it appears in source, any escapes left as is
sourcepub fn hashbang<A>(self, span: Span, value: A) -> Hashbang<'a>
pub fn hashbang<A>(self, span: Span, value: A) -> Hashbang<'a>
Builds a Hashbang
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_hashbang
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn alloc_hashbang<A>(self, span: Span, value: A) -> Box<'a, Hashbang<'a>>
pub fn alloc_hashbang<A>(self, span: Span, value: A) -> Box<'a, Hashbang<'a>>
Builds a Hashbang
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::hashbang
instead.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn block_statement(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> BlockStatement<'a>
pub fn block_statement( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> BlockStatement<'a>
Builds a BlockStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_block_statement
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn alloc_block_statement(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> Box<'a, BlockStatement<'a>>
pub fn alloc_block_statement( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> Box<'a, BlockStatement<'a>>
Builds a BlockStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::block_statement
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn declaration_variable(
self,
span: Span,
kind: VariableDeclarationKind,
declarations: Vec<'a, VariableDeclarator<'a>>,
declare: bool,
) -> Declaration<'a>
pub fn declaration_variable( self, span: Span, kind: VariableDeclarationKind, declarations: Vec<'a, VariableDeclarator<'a>>, declare: bool, ) -> Declaration<'a>
Build a Declaration::VariableDeclaration
This node contains a VariableDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - kind
- declarations
- declare
sourcepub fn declaration_from_variable<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_variable<T>(self, inner: T) -> Declaration<'a>
Convert a VariableDeclaration
into a Declaration::VariableDeclaration
sourcepub fn declaration_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Declaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
pub fn declaration_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Declaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
Build a Declaration::FunctionDeclaration
This node contains a Function
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - id
- generator
- r#async
- declare
- type_parameters
- this_param: Declaring
this
in a Function https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function - params
- return_type
- body
sourcepub fn declaration_from_function<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_function<T>(self, inner: T) -> Declaration<'a>
Convert a Function
into a Declaration::FunctionDeclaration
sourcepub fn declaration_class<T1, T2, T3>(
self,
type: ClassType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
id: Option<BindingIdentifier<'a>>,
type_parameters: T1,
super_class: Option<Expression<'a>>,
super_type_parameters: T2,
implements: Option<Vec<'a, TSClassImplements<'a>>>,
body: T3,
abstract: bool,
declare: bool,
) -> Declaration<'a>
pub fn declaration_class<T1, T2, T3>( self, type: ClassType, span: Span, decorators: Vec<'a, Decorator<'a>>, id: Option<BindingIdentifier<'a>>, type_parameters: T1, super_class: Option<Expression<'a>>, super_type_parameters: T2, implements: Option<Vec<'a, TSClassImplements<'a>>>, body: T3, abstract: bool, declare: bool, ) -> Declaration<'a>
Build a Declaration::ClassDeclaration
This node contains a Class
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the class.
- id: Class identifier, AKA the name
- type_parameters
- super_class: Super class. When present, this will usually be an
IdentifierReference
. - super_type_parameters: Type parameters passed to super class.
- implements: Interface implementation clause for TypeScript classes.
- body
- r#abstract: Whether the class is abstract
- declare: Whether the class was
declare
ed
sourcepub fn declaration_from_class<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_class<T>(self, inner: T) -> Declaration<'a>
Convert a Class
into a Declaration::ClassDeclaration
sourcepub fn declaration_using(
self,
span: Span,
is_await: bool,
declarations: Vec<'a, VariableDeclarator<'a>>,
) -> Declaration<'a>
pub fn declaration_using( self, span: Span, is_await: bool, declarations: Vec<'a, VariableDeclarator<'a>>, ) -> Declaration<'a>
Build a Declaration::UsingDeclaration
This node contains a UsingDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - is_await
- declarations
sourcepub fn declaration_from_using<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_using<T>(self, inner: T) -> Declaration<'a>
Convert a UsingDeclaration
into a Declaration::UsingDeclaration
sourcepub fn declaration_ts_type_alias<T1>(
self,
span: Span,
id: BindingIdentifier<'a>,
type_parameters: T1,
type_annotation: TSType<'a>,
declare: bool,
) -> Declaration<'a>
pub fn declaration_ts_type_alias<T1>( self, span: Span, id: BindingIdentifier<'a>, type_parameters: T1, type_annotation: TSType<'a>, declare: bool, ) -> Declaration<'a>
Build a Declaration::TSTypeAliasDeclaration
This node contains a TSTypeAliasDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
- type_parameters
- type_annotation
- declare
sourcepub fn declaration_from_ts_type_alias<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_ts_type_alias<T>(self, inner: T) -> Declaration<'a>
Convert a TSTypeAliasDeclaration
into a Declaration::TSTypeAliasDeclaration
sourcepub fn declaration_ts_interface<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> Declaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
pub fn declaration_ts_interface<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> Declaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
Build a Declaration::TSInterfaceDeclaration
This node contains a TSInterfaceDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id: The identifier (name) of the interface.
- extends
- type_parameters
- body
- declare
sourcepub fn declaration_from_ts_interface<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_ts_interface<T>(self, inner: T) -> Declaration<'a>
Convert a TSInterfaceDeclaration
into a Declaration::TSInterfaceDeclaration
sourcepub fn declaration_ts_enum(
self,
span: Span,
id: BindingIdentifier<'a>,
members: Vec<'a, TSEnumMember<'a>>,
const: bool,
declare: bool,
) -> Declaration<'a>
pub fn declaration_ts_enum( self, span: Span, id: BindingIdentifier<'a>, members: Vec<'a, TSEnumMember<'a>>, const: bool, declare: bool, ) -> Declaration<'a>
Build a Declaration::TSEnumDeclaration
This node contains a TSEnumDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
- members
- r#const
- declare
sourcepub fn declaration_from_ts_enum<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_ts_enum<T>(self, inner: T) -> Declaration<'a>
Convert a TSEnumDeclaration
into a Declaration::TSEnumDeclaration
sourcepub fn declaration_ts_module(
self,
span: Span,
id: TSModuleDeclarationName<'a>,
body: Option<TSModuleDeclarationBody<'a>>,
kind: TSModuleDeclarationKind,
declare: bool,
) -> Declaration<'a>
pub fn declaration_ts_module( self, span: Span, id: TSModuleDeclarationName<'a>, body: Option<TSModuleDeclarationBody<'a>>, kind: TSModuleDeclarationKind, declare: bool, ) -> Declaration<'a>
Build a Declaration::TSModuleDeclaration
This node contains a TSModuleDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
- body
- kind: The keyword used to define this module declaration
- declare
sourcepub fn declaration_from_ts_module<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_ts_module<T>(self, inner: T) -> Declaration<'a>
Convert a TSModuleDeclaration
into a Declaration::TSModuleDeclaration
sourcepub fn declaration_ts_import_equals(
self,
span: Span,
id: BindingIdentifier<'a>,
module_reference: TSModuleReference<'a>,
import_kind: ImportOrExportKind,
) -> Declaration<'a>
pub fn declaration_ts_import_equals( self, span: Span, id: BindingIdentifier<'a>, module_reference: TSModuleReference<'a>, import_kind: ImportOrExportKind, ) -> Declaration<'a>
Build a Declaration::TSImportEqualsDeclaration
This node contains a TSImportEqualsDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
- module_reference
- import_kind
sourcepub fn declaration_from_ts_import_equals<T>(self, inner: T) -> Declaration<'a>
pub fn declaration_from_ts_import_equals<T>(self, inner: T) -> Declaration<'a>
Convert a TSImportEqualsDeclaration
into a Declaration::TSImportEqualsDeclaration
sourcepub fn variable_declaration(
self,
span: Span,
kind: VariableDeclarationKind,
declarations: Vec<'a, VariableDeclarator<'a>>,
declare: bool,
) -> VariableDeclaration<'a>
pub fn variable_declaration( self, span: Span, kind: VariableDeclarationKind, declarations: Vec<'a, VariableDeclarator<'a>>, declare: bool, ) -> VariableDeclaration<'a>
Builds a VariableDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_variable_declaration
instead.
§Parameters
- span: The
Span
covering this node - kind
- declarations
- declare
sourcepub fn alloc_variable_declaration(
self,
span: Span,
kind: VariableDeclarationKind,
declarations: Vec<'a, VariableDeclarator<'a>>,
declare: bool,
) -> Box<'a, VariableDeclaration<'a>>
pub fn alloc_variable_declaration( self, span: Span, kind: VariableDeclarationKind, declarations: Vec<'a, VariableDeclarator<'a>>, declare: bool, ) -> Box<'a, VariableDeclaration<'a>>
Builds a VariableDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::variable_declaration
instead.
§Parameters
- span: The
Span
covering this node - kind
- declarations
- declare
sourcepub fn variable_declarator(
self,
span: Span,
kind: VariableDeclarationKind,
id: BindingPattern<'a>,
init: Option<Expression<'a>>,
definite: bool,
) -> VariableDeclarator<'a>
pub fn variable_declarator( self, span: Span, kind: VariableDeclarationKind, id: BindingPattern<'a>, init: Option<Expression<'a>>, definite: bool, ) -> VariableDeclarator<'a>
Builds a VariableDeclarator
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_variable_declarator
instead.
§Parameters
- span: The
Span
covering this node - kind
- id
- init
- definite
sourcepub fn alloc_variable_declarator(
self,
span: Span,
kind: VariableDeclarationKind,
id: BindingPattern<'a>,
init: Option<Expression<'a>>,
definite: bool,
) -> Box<'a, VariableDeclarator<'a>>
pub fn alloc_variable_declarator( self, span: Span, kind: VariableDeclarationKind, id: BindingPattern<'a>, init: Option<Expression<'a>>, definite: bool, ) -> Box<'a, VariableDeclarator<'a>>
Builds a VariableDeclarator
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::variable_declarator
instead.
§Parameters
- span: The
Span
covering this node - kind
- id
- init
- definite
sourcepub fn using_declaration(
self,
span: Span,
is_await: bool,
declarations: Vec<'a, VariableDeclarator<'a>>,
) -> UsingDeclaration<'a>
pub fn using_declaration( self, span: Span, is_await: bool, declarations: Vec<'a, VariableDeclarator<'a>>, ) -> UsingDeclaration<'a>
Builds a UsingDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_using_declaration
instead.
§Parameters
- span: The
Span
covering this node - is_await
- declarations
sourcepub fn alloc_using_declaration(
self,
span: Span,
is_await: bool,
declarations: Vec<'a, VariableDeclarator<'a>>,
) -> Box<'a, UsingDeclaration<'a>>
pub fn alloc_using_declaration( self, span: Span, is_await: bool, declarations: Vec<'a, VariableDeclarator<'a>>, ) -> Box<'a, UsingDeclaration<'a>>
Builds a UsingDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::using_declaration
instead.
§Parameters
- span: The
Span
covering this node - is_await
- declarations
sourcepub fn empty_statement(self, span: Span) -> EmptyStatement
pub fn empty_statement(self, span: Span) -> EmptyStatement
Builds a EmptyStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_empty_statement
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_empty_statement(self, span: Span) -> Box<'a, EmptyStatement>
pub fn alloc_empty_statement(self, span: Span) -> Box<'a, EmptyStatement>
Builds a EmptyStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::empty_statement
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn expression_statement(
self,
span: Span,
expression: Expression<'a>,
) -> ExpressionStatement<'a>
pub fn expression_statement( self, span: Span, expression: Expression<'a>, ) -> ExpressionStatement<'a>
Builds a ExpressionStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_expression_statement
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_expression_statement(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, ExpressionStatement<'a>>
pub fn alloc_expression_statement( self, span: Span, expression: Expression<'a>, ) -> Box<'a, ExpressionStatement<'a>>
Builds a ExpressionStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::expression_statement
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn if_statement(
self,
span: Span,
test: Expression<'a>,
consequent: Statement<'a>,
alternate: Option<Statement<'a>>,
) -> IfStatement<'a>
pub fn if_statement( self, span: Span, test: Expression<'a>, consequent: Statement<'a>, alternate: Option<Statement<'a>>, ) -> IfStatement<'a>
Builds a IfStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_if_statement
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn alloc_if_statement(
self,
span: Span,
test: Expression<'a>,
consequent: Statement<'a>,
alternate: Option<Statement<'a>>,
) -> Box<'a, IfStatement<'a>>
pub fn alloc_if_statement( self, span: Span, test: Expression<'a>, consequent: Statement<'a>, alternate: Option<Statement<'a>>, ) -> Box<'a, IfStatement<'a>>
Builds a IfStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::if_statement
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
- alternate
sourcepub fn do_while_statement(
self,
span: Span,
body: Statement<'a>,
test: Expression<'a>,
) -> DoWhileStatement<'a>
pub fn do_while_statement( self, span: Span, body: Statement<'a>, test: Expression<'a>, ) -> DoWhileStatement<'a>
Builds a DoWhileStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_do_while_statement
instead.
§Parameters
- span: The
Span
covering this node - body
- test
sourcepub fn alloc_do_while_statement(
self,
span: Span,
body: Statement<'a>,
test: Expression<'a>,
) -> Box<'a, DoWhileStatement<'a>>
pub fn alloc_do_while_statement( self, span: Span, body: Statement<'a>, test: Expression<'a>, ) -> Box<'a, DoWhileStatement<'a>>
Builds a DoWhileStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::do_while_statement
instead.
§Parameters
- span: The
Span
covering this node - body
- test
sourcepub fn while_statement(
self,
span: Span,
test: Expression<'a>,
body: Statement<'a>,
) -> WhileStatement<'a>
pub fn while_statement( self, span: Span, test: Expression<'a>, body: Statement<'a>, ) -> WhileStatement<'a>
Builds a WhileStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_while_statement
instead.
§Parameters
- span: The
Span
covering this node - test
- body
sourcepub fn alloc_while_statement(
self,
span: Span,
test: Expression<'a>,
body: Statement<'a>,
) -> Box<'a, WhileStatement<'a>>
pub fn alloc_while_statement( self, span: Span, test: Expression<'a>, body: Statement<'a>, ) -> Box<'a, WhileStatement<'a>>
Builds a WhileStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::while_statement
instead.
§Parameters
- span: The
Span
covering this node - test
- body
sourcepub fn for_statement(
self,
span: Span,
init: Option<ForStatementInit<'a>>,
test: Option<Expression<'a>>,
update: Option<Expression<'a>>,
body: Statement<'a>,
) -> ForStatement<'a>
pub fn for_statement( self, span: Span, init: Option<ForStatementInit<'a>>, test: Option<Expression<'a>>, update: Option<Expression<'a>>, body: Statement<'a>, ) -> ForStatement<'a>
Builds a ForStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_for_statement
instead.
§Parameters
- span: The
Span
covering this node - init
- test
- update
- body
sourcepub fn alloc_for_statement(
self,
span: Span,
init: Option<ForStatementInit<'a>>,
test: Option<Expression<'a>>,
update: Option<Expression<'a>>,
body: Statement<'a>,
) -> Box<'a, ForStatement<'a>>
pub fn alloc_for_statement( self, span: Span, init: Option<ForStatementInit<'a>>, test: Option<Expression<'a>>, update: Option<Expression<'a>>, body: Statement<'a>, ) -> Box<'a, ForStatement<'a>>
Builds a ForStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::for_statement
instead.
§Parameters
- span: The
Span
covering this node - init
- test
- update
- body
sourcepub fn for_statement_init_variable_declaration(
self,
span: Span,
kind: VariableDeclarationKind,
declarations: Vec<'a, VariableDeclarator<'a>>,
declare: bool,
) -> ForStatementInit<'a>
pub fn for_statement_init_variable_declaration( self, span: Span, kind: VariableDeclarationKind, declarations: Vec<'a, VariableDeclarator<'a>>, declare: bool, ) -> ForStatementInit<'a>
Build a ForStatementInit::VariableDeclaration
This node contains a VariableDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - kind
- declarations
- declare
sourcepub fn for_statement_init_from_variable_declaration<T>(
self,
inner: T,
) -> ForStatementInit<'a>
pub fn for_statement_init_from_variable_declaration<T>( self, inner: T, ) -> ForStatementInit<'a>
Convert a VariableDeclaration
into a ForStatementInit::VariableDeclaration
sourcepub fn for_statement_init_using_declaration(
self,
span: Span,
is_await: bool,
declarations: Vec<'a, VariableDeclarator<'a>>,
) -> ForStatementInit<'a>
pub fn for_statement_init_using_declaration( self, span: Span, is_await: bool, declarations: Vec<'a, VariableDeclarator<'a>>, ) -> ForStatementInit<'a>
Build a ForStatementInit::UsingDeclaration
This node contains a UsingDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - is_await
- declarations
sourcepub fn for_statement_init_from_using_declaration<T>(
self,
inner: T,
) -> ForStatementInit<'a>
pub fn for_statement_init_from_using_declaration<T>( self, inner: T, ) -> ForStatementInit<'a>
Convert a UsingDeclaration
into a ForStatementInit::UsingDeclaration
pub fn for_statement_init_expression( self, inner: Expression<'a>, ) -> ForStatementInit<'a>
sourcepub fn for_in_statement(
self,
span: Span,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> ForInStatement<'a>
pub fn for_in_statement( self, span: Span, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> ForInStatement<'a>
Builds a ForInStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_for_in_statement
instead.
§Parameters
- span: The
Span
covering this node - left
- right
- body
sourcepub fn alloc_for_in_statement(
self,
span: Span,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> Box<'a, ForInStatement<'a>>
pub fn alloc_for_in_statement( self, span: Span, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> Box<'a, ForInStatement<'a>>
Builds a ForInStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::for_in_statement
instead.
§Parameters
- span: The
Span
covering this node - left
- right
- body
sourcepub fn for_statement_left_variable_declaration(
self,
span: Span,
kind: VariableDeclarationKind,
declarations: Vec<'a, VariableDeclarator<'a>>,
declare: bool,
) -> ForStatementLeft<'a>
pub fn for_statement_left_variable_declaration( self, span: Span, kind: VariableDeclarationKind, declarations: Vec<'a, VariableDeclarator<'a>>, declare: bool, ) -> ForStatementLeft<'a>
Build a ForStatementLeft::VariableDeclaration
This node contains a VariableDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - kind
- declarations
- declare
sourcepub fn for_statement_left_from_variable_declaration<T>(
self,
inner: T,
) -> ForStatementLeft<'a>
pub fn for_statement_left_from_variable_declaration<T>( self, inner: T, ) -> ForStatementLeft<'a>
Convert a VariableDeclaration
into a ForStatementLeft::VariableDeclaration
sourcepub fn for_statement_left_using_declaration(
self,
span: Span,
is_await: bool,
declarations: Vec<'a, VariableDeclarator<'a>>,
) -> ForStatementLeft<'a>
pub fn for_statement_left_using_declaration( self, span: Span, is_await: bool, declarations: Vec<'a, VariableDeclarator<'a>>, ) -> ForStatementLeft<'a>
Build a ForStatementLeft::UsingDeclaration
This node contains a UsingDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - is_await
- declarations
sourcepub fn for_statement_left_from_using_declaration<T>(
self,
inner: T,
) -> ForStatementLeft<'a>
pub fn for_statement_left_from_using_declaration<T>( self, inner: T, ) -> ForStatementLeft<'a>
Convert a UsingDeclaration
into a ForStatementLeft::UsingDeclaration
pub fn for_statement_left_assignment_target( self, inner: AssignmentTarget<'a>, ) -> ForStatementLeft<'a>
sourcepub fn for_of_statement(
self,
span: Span,
await: bool,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> ForOfStatement<'a>
pub fn for_of_statement( self, span: Span, await: bool, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> ForOfStatement<'a>
Builds a ForOfStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_for_of_statement
instead.
§Parameters
- span: The
Span
covering this node - r#await
- left
- right
- body
sourcepub fn alloc_for_of_statement(
self,
span: Span,
await: bool,
left: ForStatementLeft<'a>,
right: Expression<'a>,
body: Statement<'a>,
) -> Box<'a, ForOfStatement<'a>>
pub fn alloc_for_of_statement( self, span: Span, await: bool, left: ForStatementLeft<'a>, right: Expression<'a>, body: Statement<'a>, ) -> Box<'a, ForOfStatement<'a>>
Builds a ForOfStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::for_of_statement
instead.
§Parameters
- span: The
Span
covering this node - r#await
- left
- right
- body
sourcepub fn continue_statement(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> ContinueStatement<'a>
pub fn continue_statement( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> ContinueStatement<'a>
Builds a ContinueStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_continue_statement
instead.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn alloc_continue_statement(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> Box<'a, ContinueStatement<'a>>
pub fn alloc_continue_statement( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> Box<'a, ContinueStatement<'a>>
Builds a ContinueStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::continue_statement
instead.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn break_statement(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> BreakStatement<'a>
pub fn break_statement( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> BreakStatement<'a>
Builds a BreakStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_break_statement
instead.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn alloc_break_statement(
self,
span: Span,
label: Option<LabelIdentifier<'a>>,
) -> Box<'a, BreakStatement<'a>>
pub fn alloc_break_statement( self, span: Span, label: Option<LabelIdentifier<'a>>, ) -> Box<'a, BreakStatement<'a>>
Builds a BreakStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::break_statement
instead.
§Parameters
- span: The
Span
covering this node - label
sourcepub fn return_statement(
self,
span: Span,
argument: Option<Expression<'a>>,
) -> ReturnStatement<'a>
pub fn return_statement( self, span: Span, argument: Option<Expression<'a>>, ) -> ReturnStatement<'a>
Builds a ReturnStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_return_statement
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn alloc_return_statement(
self,
span: Span,
argument: Option<Expression<'a>>,
) -> Box<'a, ReturnStatement<'a>>
pub fn alloc_return_statement( self, span: Span, argument: Option<Expression<'a>>, ) -> Box<'a, ReturnStatement<'a>>
Builds a ReturnStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::return_statement
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn with_statement(
self,
span: Span,
object: Expression<'a>,
body: Statement<'a>,
) -> WithStatement<'a>
pub fn with_statement( self, span: Span, object: Expression<'a>, body: Statement<'a>, ) -> WithStatement<'a>
Builds a WithStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_with_statement
instead.
§Parameters
- span: The
Span
covering this node - object
- body
sourcepub fn alloc_with_statement(
self,
span: Span,
object: Expression<'a>,
body: Statement<'a>,
) -> Box<'a, WithStatement<'a>>
pub fn alloc_with_statement( self, span: Span, object: Expression<'a>, body: Statement<'a>, ) -> Box<'a, WithStatement<'a>>
Builds a WithStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::with_statement
instead.
§Parameters
- span: The
Span
covering this node - object
- body
sourcepub fn switch_statement(
self,
span: Span,
discriminant: Expression<'a>,
cases: Vec<'a, SwitchCase<'a>>,
) -> SwitchStatement<'a>
pub fn switch_statement( self, span: Span, discriminant: Expression<'a>, cases: Vec<'a, SwitchCase<'a>>, ) -> SwitchStatement<'a>
Builds a SwitchStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_switch_statement
instead.
§Parameters
- span: The
Span
covering this node - discriminant
- cases
sourcepub fn alloc_switch_statement(
self,
span: Span,
discriminant: Expression<'a>,
cases: Vec<'a, SwitchCase<'a>>,
) -> Box<'a, SwitchStatement<'a>>
pub fn alloc_switch_statement( self, span: Span, discriminant: Expression<'a>, cases: Vec<'a, SwitchCase<'a>>, ) -> Box<'a, SwitchStatement<'a>>
Builds a SwitchStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::switch_statement
instead.
§Parameters
- span: The
Span
covering this node - discriminant
- cases
sourcepub fn switch_case(
self,
span: Span,
test: Option<Expression<'a>>,
consequent: Vec<'a, Statement<'a>>,
) -> SwitchCase<'a>
pub fn switch_case( self, span: Span, test: Option<Expression<'a>>, consequent: Vec<'a, Statement<'a>>, ) -> SwitchCase<'a>
Builds a SwitchCase
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_switch_case
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
sourcepub fn alloc_switch_case(
self,
span: Span,
test: Option<Expression<'a>>,
consequent: Vec<'a, Statement<'a>>,
) -> Box<'a, SwitchCase<'a>>
pub fn alloc_switch_case( self, span: Span, test: Option<Expression<'a>>, consequent: Vec<'a, Statement<'a>>, ) -> Box<'a, SwitchCase<'a>>
Builds a SwitchCase
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::switch_case
instead.
§Parameters
- span: The
Span
covering this node - test
- consequent
sourcepub fn labeled_statement(
self,
span: Span,
label: LabelIdentifier<'a>,
body: Statement<'a>,
) -> LabeledStatement<'a>
pub fn labeled_statement( self, span: Span, label: LabelIdentifier<'a>, body: Statement<'a>, ) -> LabeledStatement<'a>
Builds a LabeledStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_labeled_statement
instead.
§Parameters
- span: The
Span
covering this node - label
- body
sourcepub fn alloc_labeled_statement(
self,
span: Span,
label: LabelIdentifier<'a>,
body: Statement<'a>,
) -> Box<'a, LabeledStatement<'a>>
pub fn alloc_labeled_statement( self, span: Span, label: LabelIdentifier<'a>, body: Statement<'a>, ) -> Box<'a, LabeledStatement<'a>>
Builds a LabeledStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::labeled_statement
instead.
§Parameters
- span: The
Span
covering this node - label
- body
sourcepub fn throw_statement(
self,
span: Span,
argument: Expression<'a>,
) -> ThrowStatement<'a>
pub fn throw_statement( self, span: Span, argument: Expression<'a>, ) -> ThrowStatement<'a>
Builds a ThrowStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_throw_statement
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn alloc_throw_statement(
self,
span: Span,
argument: Expression<'a>,
) -> Box<'a, ThrowStatement<'a>>
pub fn alloc_throw_statement( self, span: Span, argument: Expression<'a>, ) -> Box<'a, ThrowStatement<'a>>
Builds a ThrowStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::throw_statement
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn try_statement<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> TryStatement<'a>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
pub fn try_statement<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> TryStatement<'a>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
Builds a TryStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_try_statement
instead.
§Parameters
- span: The
Span
covering this node - block
- handler
- finalizer
sourcepub fn alloc_try_statement<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> Box<'a, TryStatement<'a>>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
pub fn alloc_try_statement<T1, T2, T3>(
self,
span: Span,
block: T1,
handler: T2,
finalizer: T3,
) -> Box<'a, TryStatement<'a>>where
T1: IntoIn<'a, Box<'a, BlockStatement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, CatchClause<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, BlockStatement<'a>>>>,
Builds a TryStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::try_statement
instead.
§Parameters
- span: The
Span
covering this node - block
- handler
- finalizer
sourcepub fn catch_clause<T1>(
self,
span: Span,
param: Option<CatchParameter<'a>>,
body: T1,
) -> CatchClause<'a>
pub fn catch_clause<T1>( self, span: Span, param: Option<CatchParameter<'a>>, body: T1, ) -> CatchClause<'a>
Builds a CatchClause
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_catch_clause
instead.
§Parameters
- span: The
Span
covering this node - param
- body
sourcepub fn alloc_catch_clause<T1>(
self,
span: Span,
param: Option<CatchParameter<'a>>,
body: T1,
) -> Box<'a, CatchClause<'a>>
pub fn alloc_catch_clause<T1>( self, span: Span, param: Option<CatchParameter<'a>>, body: T1, ) -> Box<'a, CatchClause<'a>>
Builds a CatchClause
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::catch_clause
instead.
§Parameters
- span: The
Span
covering this node - param
- body
sourcepub fn catch_parameter(
self,
span: Span,
pattern: BindingPattern<'a>,
) -> CatchParameter<'a>
pub fn catch_parameter( self, span: Span, pattern: BindingPattern<'a>, ) -> CatchParameter<'a>
Builds a CatchParameter
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_catch_parameter
instead.
§Parameters
- span: The
Span
covering this node - pattern
sourcepub fn alloc_catch_parameter(
self,
span: Span,
pattern: BindingPattern<'a>,
) -> Box<'a, CatchParameter<'a>>
pub fn alloc_catch_parameter( self, span: Span, pattern: BindingPattern<'a>, ) -> Box<'a, CatchParameter<'a>>
Builds a CatchParameter
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::catch_parameter
instead.
§Parameters
- span: The
Span
covering this node - pattern
sourcepub fn debugger_statement(self, span: Span) -> DebuggerStatement
pub fn debugger_statement(self, span: Span) -> DebuggerStatement
Builds a DebuggerStatement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_debugger_statement
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_debugger_statement(self, span: Span) -> Box<'a, DebuggerStatement>
pub fn alloc_debugger_statement(self, span: Span) -> Box<'a, DebuggerStatement>
Builds a DebuggerStatement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::debugger_statement
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn binding_pattern<T1>(
self,
kind: BindingPatternKind<'a>,
type_annotation: T1,
optional: bool,
) -> BindingPattern<'a>
pub fn binding_pattern<T1>( self, kind: BindingPatternKind<'a>, type_annotation: T1, optional: bool, ) -> BindingPattern<'a>
Builds a BindingPattern
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_binding_pattern
instead.
§Parameters
- kind
- type_annotation
- optional
sourcepub fn alloc_binding_pattern<T1>(
self,
kind: BindingPatternKind<'a>,
type_annotation: T1,
optional: bool,
) -> Box<'a, BindingPattern<'a>>
pub fn alloc_binding_pattern<T1>( self, kind: BindingPatternKind<'a>, type_annotation: T1, optional: bool, ) -> Box<'a, BindingPattern<'a>>
Builds a BindingPattern
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::binding_pattern
instead.
§Parameters
- kind
- type_annotation
- optional
sourcepub fn binding_pattern_kind_binding_identifier<A>(
self,
span: Span,
name: A,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_binding_identifier<A>( self, span: Span, name: A, ) -> BindingPatternKind<'a>
Build a BindingPatternKind::BindingIdentifier
This node contains a BindingIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The identifier name being bound.
sourcepub fn binding_pattern_kind_from_binding_identifier<T>(
self,
inner: T,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_from_binding_identifier<T>( self, inner: T, ) -> BindingPatternKind<'a>
Convert a BindingIdentifier
into a BindingPatternKind::BindingIdentifier
sourcepub fn binding_pattern_kind_object_pattern<T1>(
self,
span: Span,
properties: Vec<'a, BindingProperty<'a>>,
rest: T1,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_object_pattern<T1>( self, span: Span, properties: Vec<'a, BindingProperty<'a>>, rest: T1, ) -> BindingPatternKind<'a>
Build a BindingPatternKind::ObjectPattern
This node contains a ObjectPattern
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn binding_pattern_kind_from_object_pattern<T>(
self,
inner: T,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_from_object_pattern<T>( self, inner: T, ) -> BindingPatternKind<'a>
Convert a ObjectPattern
into a BindingPatternKind::ObjectPattern
sourcepub fn binding_pattern_kind_array_pattern<T1>(
self,
span: Span,
elements: Vec<'a, Option<BindingPattern<'a>>>,
rest: T1,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_array_pattern<T1>( self, span: Span, elements: Vec<'a, Option<BindingPattern<'a>>>, rest: T1, ) -> BindingPatternKind<'a>
Build a BindingPatternKind::ArrayPattern
This node contains a ArrayPattern
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - elements
- rest
sourcepub fn binding_pattern_kind_from_array_pattern<T>(
self,
inner: T,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_from_array_pattern<T>( self, inner: T, ) -> BindingPatternKind<'a>
Convert a ArrayPattern
into a BindingPatternKind::ArrayPattern
sourcepub fn binding_pattern_kind_assignment_pattern(
self,
span: Span,
left: BindingPattern<'a>,
right: Expression<'a>,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_assignment_pattern( self, span: Span, left: BindingPattern<'a>, right: Expression<'a>, ) -> BindingPatternKind<'a>
Build a BindingPatternKind::AssignmentPattern
This node contains a AssignmentPattern
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn binding_pattern_kind_from_assignment_pattern<T>(
self,
inner: T,
) -> BindingPatternKind<'a>
pub fn binding_pattern_kind_from_assignment_pattern<T>( self, inner: T, ) -> BindingPatternKind<'a>
Convert a AssignmentPattern
into a BindingPatternKind::AssignmentPattern
sourcepub fn assignment_pattern(
self,
span: Span,
left: BindingPattern<'a>,
right: Expression<'a>,
) -> AssignmentPattern<'a>
pub fn assignment_pattern( self, span: Span, left: BindingPattern<'a>, right: Expression<'a>, ) -> AssignmentPattern<'a>
Builds a AssignmentPattern
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_assignment_pattern
instead.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn alloc_assignment_pattern(
self,
span: Span,
left: BindingPattern<'a>,
right: Expression<'a>,
) -> Box<'a, AssignmentPattern<'a>>
pub fn alloc_assignment_pattern( self, span: Span, left: BindingPattern<'a>, right: Expression<'a>, ) -> Box<'a, AssignmentPattern<'a>>
Builds a AssignmentPattern
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::assignment_pattern
instead.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn object_pattern<T1>(
self,
span: Span,
properties: Vec<'a, BindingProperty<'a>>,
rest: T1,
) -> ObjectPattern<'a>
pub fn object_pattern<T1>( self, span: Span, properties: Vec<'a, BindingProperty<'a>>, rest: T1, ) -> ObjectPattern<'a>
Builds a ObjectPattern
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_object_pattern
instead.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn alloc_object_pattern<T1>(
self,
span: Span,
properties: Vec<'a, BindingProperty<'a>>,
rest: T1,
) -> Box<'a, ObjectPattern<'a>>
pub fn alloc_object_pattern<T1>( self, span: Span, properties: Vec<'a, BindingProperty<'a>>, rest: T1, ) -> Box<'a, ObjectPattern<'a>>
Builds a ObjectPattern
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::object_pattern
instead.
§Parameters
- span: The
Span
covering this node - properties
- rest
sourcepub fn binding_property(
self,
span: Span,
key: PropertyKey<'a>,
value: BindingPattern<'a>,
shorthand: bool,
computed: bool,
) -> BindingProperty<'a>
pub fn binding_property( self, span: Span, key: PropertyKey<'a>, value: BindingPattern<'a>, shorthand: bool, computed: bool, ) -> BindingProperty<'a>
Builds a BindingProperty
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_binding_property
instead.
§Parameters
- span: The
Span
covering this node - key
- value
- shorthand
- computed
sourcepub fn alloc_binding_property(
self,
span: Span,
key: PropertyKey<'a>,
value: BindingPattern<'a>,
shorthand: bool,
computed: bool,
) -> Box<'a, BindingProperty<'a>>
pub fn alloc_binding_property( self, span: Span, key: PropertyKey<'a>, value: BindingPattern<'a>, shorthand: bool, computed: bool, ) -> Box<'a, BindingProperty<'a>>
Builds a BindingProperty
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::binding_property
instead.
§Parameters
- span: The
Span
covering this node - key
- value
- shorthand
- computed
sourcepub fn array_pattern<T1>(
self,
span: Span,
elements: Vec<'a, Option<BindingPattern<'a>>>,
rest: T1,
) -> ArrayPattern<'a>
pub fn array_pattern<T1>( self, span: Span, elements: Vec<'a, Option<BindingPattern<'a>>>, rest: T1, ) -> ArrayPattern<'a>
Builds a ArrayPattern
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_array_pattern
instead.
§Parameters
- span: The
Span
covering this node - elements
- rest
sourcepub fn alloc_array_pattern<T1>(
self,
span: Span,
elements: Vec<'a, Option<BindingPattern<'a>>>,
rest: T1,
) -> Box<'a, ArrayPattern<'a>>
pub fn alloc_array_pattern<T1>( self, span: Span, elements: Vec<'a, Option<BindingPattern<'a>>>, rest: T1, ) -> Box<'a, ArrayPattern<'a>>
Builds a ArrayPattern
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::array_pattern
instead.
§Parameters
- span: The
Span
covering this node - elements
- rest
sourcepub fn binding_rest_element(
self,
span: Span,
argument: BindingPattern<'a>,
) -> BindingRestElement<'a>
pub fn binding_rest_element( self, span: Span, argument: BindingPattern<'a>, ) -> BindingRestElement<'a>
Builds a BindingRestElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_binding_rest_element
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn alloc_binding_rest_element(
self,
span: Span,
argument: BindingPattern<'a>,
) -> Box<'a, BindingRestElement<'a>>
pub fn alloc_binding_rest_element( self, span: Span, argument: BindingPattern<'a>, ) -> Box<'a, BindingRestElement<'a>>
Builds a BindingRestElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::binding_rest_element
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Function<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
pub fn function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Function<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
Builds a Function
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_function
instead.
§Parameters
- r#type
- span: The
Span
covering this node - id
- generator
- r#async
- declare
- type_parameters
- this_param: Declaring
this
in a Function https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function - params
- return_type
- body
sourcepub fn alloc_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Box<'a, Function<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
pub fn alloc_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> Box<'a, Function<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
Builds a Function
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::function
instead.
§Parameters
- r#type
- span: The
Span
covering this node - id
- generator
- r#async
- declare
- type_parameters
- this_param: Declaring
this
in a Function https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function - params
- return_type
- body
sourcepub fn formal_parameters<T1>(
self,
span: Span,
kind: FormalParameterKind,
items: Vec<'a, FormalParameter<'a>>,
rest: T1,
) -> FormalParameters<'a>
pub fn formal_parameters<T1>( self, span: Span, kind: FormalParameterKind, items: Vec<'a, FormalParameter<'a>>, rest: T1, ) -> FormalParameters<'a>
Builds a FormalParameters
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_formal_parameters
instead.
§Parameters
- span: The
Span
covering this node - kind
- items
- rest
sourcepub fn alloc_formal_parameters<T1>(
self,
span: Span,
kind: FormalParameterKind,
items: Vec<'a, FormalParameter<'a>>,
rest: T1,
) -> Box<'a, FormalParameters<'a>>
pub fn alloc_formal_parameters<T1>( self, span: Span, kind: FormalParameterKind, items: Vec<'a, FormalParameter<'a>>, rest: T1, ) -> Box<'a, FormalParameters<'a>>
Builds a FormalParameters
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::formal_parameters
instead.
§Parameters
- span: The
Span
covering this node - kind
- items
- rest
sourcepub fn formal_parameter(
self,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
pattern: BindingPattern<'a>,
accessibility: Option<TSAccessibility>,
readonly: bool,
override: bool,
) -> FormalParameter<'a>
pub fn formal_parameter( self, span: Span, decorators: Vec<'a, Decorator<'a>>, pattern: BindingPattern<'a>, accessibility: Option<TSAccessibility>, readonly: bool, override: bool, ) -> FormalParameter<'a>
Builds a FormalParameter
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_formal_parameter
instead.
§Parameters
- span: The
Span
covering this node - decorators
- pattern
- accessibility
- readonly
- r#override
sourcepub fn alloc_formal_parameter(
self,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
pattern: BindingPattern<'a>,
accessibility: Option<TSAccessibility>,
readonly: bool,
override: bool,
) -> Box<'a, FormalParameter<'a>>
pub fn alloc_formal_parameter( self, span: Span, decorators: Vec<'a, Decorator<'a>>, pattern: BindingPattern<'a>, accessibility: Option<TSAccessibility>, readonly: bool, override: bool, ) -> Box<'a, FormalParameter<'a>>
Builds a FormalParameter
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::formal_parameter
instead.
§Parameters
- span: The
Span
covering this node - decorators
- pattern
- accessibility
- readonly
- r#override
sourcepub fn function_body(
self,
span: Span,
directives: Vec<'a, Directive<'a>>,
statements: Vec<'a, Statement<'a>>,
) -> FunctionBody<'a>
pub fn function_body( self, span: Span, directives: Vec<'a, Directive<'a>>, statements: Vec<'a, Statement<'a>>, ) -> FunctionBody<'a>
Builds a FunctionBody
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_function_body
instead.
§Parameters
- span: The
Span
covering this node - directives
- statements
sourcepub fn alloc_function_body(
self,
span: Span,
directives: Vec<'a, Directive<'a>>,
statements: Vec<'a, Statement<'a>>,
) -> Box<'a, FunctionBody<'a>>
pub fn alloc_function_body( self, span: Span, directives: Vec<'a, Directive<'a>>, statements: Vec<'a, Statement<'a>>, ) -> Box<'a, FunctionBody<'a>>
Builds a FunctionBody
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::function_body
instead.
§Parameters
- span: The
Span
covering this node - directives
- statements
sourcepub fn arrow_function_expression<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> ArrowFunctionExpression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
pub fn arrow_function_expression<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> ArrowFunctionExpression<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
Builds a ArrowFunctionExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_arrow_function_expression
instead.
§Parameters
- span: The
Span
covering this node - expression: Is the function body an arrow expression? i.e.
() => expr
instead of() => {}
- r#async
- type_parameters
- params
- return_type
- body: See
expression
for whether this arrow expression returns an expression.
sourcepub fn alloc_arrow_function_expression<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> Box<'a, ArrowFunctionExpression<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
pub fn alloc_arrow_function_expression<T1, T2, T3, T4>(
self,
span: Span,
expression: bool,
async: bool,
type_parameters: T1,
params: T2,
return_type: T3,
body: T4,
) -> Box<'a, ArrowFunctionExpression<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Box<'a, FunctionBody<'a>>>,
Builds a ArrowFunctionExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::arrow_function_expression
instead.
§Parameters
- span: The
Span
covering this node - expression: Is the function body an arrow expression? i.e.
() => expr
instead of() => {}
- r#async
- type_parameters
- params
- return_type
- body: See
expression
for whether this arrow expression returns an expression.
sourcepub fn yield_expression(
self,
span: Span,
delegate: bool,
argument: Option<Expression<'a>>,
) -> YieldExpression<'a>
pub fn yield_expression( self, span: Span, delegate: bool, argument: Option<Expression<'a>>, ) -> YieldExpression<'a>
Builds a YieldExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_yield_expression
instead.
§Parameters
- span: The
Span
covering this node - delegate
- argument
sourcepub fn alloc_yield_expression(
self,
span: Span,
delegate: bool,
argument: Option<Expression<'a>>,
) -> Box<'a, YieldExpression<'a>>
pub fn alloc_yield_expression( self, span: Span, delegate: bool, argument: Option<Expression<'a>>, ) -> Box<'a, YieldExpression<'a>>
Builds a YieldExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::yield_expression
instead.
§Parameters
- span: The
Span
covering this node - delegate
- argument
sourcepub fn class<T1, T2, T3>(
self,
type: ClassType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
id: Option<BindingIdentifier<'a>>,
type_parameters: T1,
super_class: Option<Expression<'a>>,
super_type_parameters: T2,
implements: Option<Vec<'a, TSClassImplements<'a>>>,
body: T3,
abstract: bool,
declare: bool,
) -> Class<'a>
pub fn class<T1, T2, T3>( self, type: ClassType, span: Span, decorators: Vec<'a, Decorator<'a>>, id: Option<BindingIdentifier<'a>>, type_parameters: T1, super_class: Option<Expression<'a>>, super_type_parameters: T2, implements: Option<Vec<'a, TSClassImplements<'a>>>, body: T3, abstract: bool, declare: bool, ) -> Class<'a>
Builds a Class
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_class
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the class.
- id: Class identifier, AKA the name
- type_parameters
- super_class: Super class. When present, this will usually be an
IdentifierReference
. - super_type_parameters: Type parameters passed to super class.
- implements: Interface implementation clause for TypeScript classes.
- body
- r#abstract: Whether the class is abstract
- declare: Whether the class was
declare
ed
sourcepub fn alloc_class<T1, T2, T3>(
self,
type: ClassType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
id: Option<BindingIdentifier<'a>>,
type_parameters: T1,
super_class: Option<Expression<'a>>,
super_type_parameters: T2,
implements: Option<Vec<'a, TSClassImplements<'a>>>,
body: T3,
abstract: bool,
declare: bool,
) -> Box<'a, Class<'a>>
pub fn alloc_class<T1, T2, T3>( self, type: ClassType, span: Span, decorators: Vec<'a, Decorator<'a>>, id: Option<BindingIdentifier<'a>>, type_parameters: T1, super_class: Option<Expression<'a>>, super_type_parameters: T2, implements: Option<Vec<'a, TSClassImplements<'a>>>, body: T3, abstract: bool, declare: bool, ) -> Box<'a, Class<'a>>
Builds a Class
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::class
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the class.
- id: Class identifier, AKA the name
- type_parameters
- super_class: Super class. When present, this will usually be an
IdentifierReference
. - super_type_parameters: Type parameters passed to super class.
- implements: Interface implementation clause for TypeScript classes.
- body
- r#abstract: Whether the class is abstract
- declare: Whether the class was
declare
ed
sourcepub fn class_body(
self,
span: Span,
body: Vec<'a, ClassElement<'a>>,
) -> ClassBody<'a>
pub fn class_body( self, span: Span, body: Vec<'a, ClassElement<'a>>, ) -> ClassBody<'a>
Builds a ClassBody
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_class_body
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn alloc_class_body(
self,
span: Span,
body: Vec<'a, ClassElement<'a>>,
) -> Box<'a, ClassBody<'a>>
pub fn alloc_class_body( self, span: Span, body: Vec<'a, ClassElement<'a>>, ) -> Box<'a, ClassBody<'a>>
Builds a ClassBody
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::class_body
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn class_element_static_block(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> ClassElement<'a>
pub fn class_element_static_block( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> ClassElement<'a>
Build a ClassElement::StaticBlock
This node contains a StaticBlock
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn class_element_from_static_block<T>(self, inner: T) -> ClassElement<'a>
pub fn class_element_from_static_block<T>(self, inner: T) -> ClassElement<'a>
Convert a StaticBlock
into a ClassElement::StaticBlock
sourcepub fn class_element_method_definition<T1>(
self,
type: MethodDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: T1,
kind: MethodDefinitionKind,
computed: bool,
static: bool,
override: bool,
optional: bool,
accessibility: Option<TSAccessibility>,
) -> ClassElement<'a>
pub fn class_element_method_definition<T1>( self, type: MethodDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: T1, kind: MethodDefinitionKind, computed: bool, static: bool, override: bool, optional: bool, accessibility: Option<TSAccessibility>, ) -> ClassElement<'a>
Build a ClassElement::MethodDefinition
This node contains a MethodDefinition
that will be stored in the memory arena.
§Parameters
- r#type: Method definition type
- span: The
Span
covering this node - decorators
- key
- value
- kind
- computed
- r#static
- r#override
- optional
- accessibility
sourcepub fn class_element_from_method_definition<T>(
self,
inner: T,
) -> ClassElement<'a>
pub fn class_element_from_method_definition<T>( self, inner: T, ) -> ClassElement<'a>
Convert a MethodDefinition
into a ClassElement::MethodDefinition
sourcepub fn class_element_property_definition<T1>(
self,
type: PropertyDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
declare: bool,
override: bool,
optional: bool,
definite: bool,
readonly: bool,
type_annotation: T1,
accessibility: Option<TSAccessibility>,
) -> ClassElement<'a>
pub fn class_element_property_definition<T1>( self, type: PropertyDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, declare: bool, override: bool, optional: bool, definite: bool, readonly: bool, type_annotation: T1, accessibility: Option<TSAccessibility>, ) -> ClassElement<'a>
Build a ClassElement::PropertyDefinition
This node contains a PropertyDefinition
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration.
- computed: Property was declared with a computed key
- r#static: Property was declared with a
static
modifier - declare: Property is declared with a
declare
modifier. - r#override
- optional:
true
when created with an optional modifier (?
) - definite
- readonly:
true
when declared with areadonly
modifier - type_annotation: Type annotation on the property.
- accessibility: Accessibility modifier.
sourcepub fn class_element_from_property_definition<T>(
self,
inner: T,
) -> ClassElement<'a>
pub fn class_element_from_property_definition<T>( self, inner: T, ) -> ClassElement<'a>
Convert a PropertyDefinition
into a ClassElement::PropertyDefinition
sourcepub fn class_element_accessor_property(
self,
type: AccessorPropertyType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
) -> ClassElement<'a>
pub fn class_element_accessor_property( self, type: AccessorPropertyType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, ) -> ClassElement<'a>
Build a ClassElement::AccessorProperty
This node contains a AccessorProperty
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the accessor property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration, if present.
- computed
- r#static
sourcepub fn class_element_from_accessor_property<T>(
self,
inner: T,
) -> ClassElement<'a>
pub fn class_element_from_accessor_property<T>( self, inner: T, ) -> ClassElement<'a>
Convert a AccessorProperty
into a ClassElement::AccessorProperty
sourcepub fn class_element_ts_index_signature<T1>(
self,
span: Span,
parameters: Vec<'a, TSIndexSignatureName<'a>>,
type_annotation: T1,
readonly: bool,
) -> ClassElement<'a>
pub fn class_element_ts_index_signature<T1>( self, span: Span, parameters: Vec<'a, TSIndexSignatureName<'a>>, type_annotation: T1, readonly: bool, ) -> ClassElement<'a>
Build a ClassElement::TSIndexSignature
This node contains a TSIndexSignature
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - parameters
- type_annotation
- readonly
sourcepub fn class_element_from_ts_index_signature<T>(
self,
inner: T,
) -> ClassElement<'a>
pub fn class_element_from_ts_index_signature<T>( self, inner: T, ) -> ClassElement<'a>
Convert a TSIndexSignature
into a ClassElement::TSIndexSignature
sourcepub fn method_definition<T1>(
self,
type: MethodDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: T1,
kind: MethodDefinitionKind,
computed: bool,
static: bool,
override: bool,
optional: bool,
accessibility: Option<TSAccessibility>,
) -> MethodDefinition<'a>
pub fn method_definition<T1>( self, type: MethodDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: T1, kind: MethodDefinitionKind, computed: bool, static: bool, override: bool, optional: bool, accessibility: Option<TSAccessibility>, ) -> MethodDefinition<'a>
Builds a MethodDefinition
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_method_definition
instead.
§Parameters
- r#type: Method definition type
- span: The
Span
covering this node - decorators
- key
- value
- kind
- computed
- r#static
- r#override
- optional
- accessibility
sourcepub fn alloc_method_definition<T1>(
self,
type: MethodDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: T1,
kind: MethodDefinitionKind,
computed: bool,
static: bool,
override: bool,
optional: bool,
accessibility: Option<TSAccessibility>,
) -> Box<'a, MethodDefinition<'a>>
pub fn alloc_method_definition<T1>( self, type: MethodDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: T1, kind: MethodDefinitionKind, computed: bool, static: bool, override: bool, optional: bool, accessibility: Option<TSAccessibility>, ) -> Box<'a, MethodDefinition<'a>>
Builds a MethodDefinition
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::method_definition
instead.
§Parameters
- r#type: Method definition type
- span: The
Span
covering this node - decorators
- key
- value
- kind
- computed
- r#static
- r#override
- optional
- accessibility
sourcepub fn property_definition<T1>(
self,
type: PropertyDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
declare: bool,
override: bool,
optional: bool,
definite: bool,
readonly: bool,
type_annotation: T1,
accessibility: Option<TSAccessibility>,
) -> PropertyDefinition<'a>
pub fn property_definition<T1>( self, type: PropertyDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, declare: bool, override: bool, optional: bool, definite: bool, readonly: bool, type_annotation: T1, accessibility: Option<TSAccessibility>, ) -> PropertyDefinition<'a>
Builds a PropertyDefinition
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_property_definition
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration.
- computed: Property was declared with a computed key
- r#static: Property was declared with a
static
modifier - declare: Property is declared with a
declare
modifier. - r#override
- optional:
true
when created with an optional modifier (?
) - definite
- readonly:
true
when declared with areadonly
modifier - type_annotation: Type annotation on the property.
- accessibility: Accessibility modifier.
sourcepub fn alloc_property_definition<T1>(
self,
type: PropertyDefinitionType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
declare: bool,
override: bool,
optional: bool,
definite: bool,
readonly: bool,
type_annotation: T1,
accessibility: Option<TSAccessibility>,
) -> Box<'a, PropertyDefinition<'a>>
pub fn alloc_property_definition<T1>( self, type: PropertyDefinitionType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, declare: bool, override: bool, optional: bool, definite: bool, readonly: bool, type_annotation: T1, accessibility: Option<TSAccessibility>, ) -> Box<'a, PropertyDefinition<'a>>
Builds a PropertyDefinition
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::property_definition
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration.
- computed: Property was declared with a computed key
- r#static: Property was declared with a
static
modifier - declare: Property is declared with a
declare
modifier. - r#override
- optional:
true
when created with an optional modifier (?
) - definite
- readonly:
true
when declared with areadonly
modifier - type_annotation: Type annotation on the property.
- accessibility: Accessibility modifier.
sourcepub fn private_identifier<A>(self, span: Span, name: A) -> PrivateIdentifier<'a>
pub fn private_identifier<A>(self, span: Span, name: A) -> PrivateIdentifier<'a>
Builds a PrivateIdentifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_private_identifier
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn alloc_private_identifier<A>(
self,
span: Span,
name: A,
) -> Box<'a, PrivateIdentifier<'a>>
pub fn alloc_private_identifier<A>( self, span: Span, name: A, ) -> Box<'a, PrivateIdentifier<'a>>
Builds a PrivateIdentifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::private_identifier
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn static_block(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> StaticBlock<'a>
pub fn static_block( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> StaticBlock<'a>
Builds a StaticBlock
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_static_block
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn alloc_static_block(
self,
span: Span,
body: Vec<'a, Statement<'a>>,
) -> Box<'a, StaticBlock<'a>>
pub fn alloc_static_block( self, span: Span, body: Vec<'a, Statement<'a>>, ) -> Box<'a, StaticBlock<'a>>
Builds a StaticBlock
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::static_block
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn module_declaration_import_declaration(
self,
span: Span,
specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
import_kind: ImportOrExportKind,
) -> ModuleDeclaration<'a>
pub fn module_declaration_import_declaration( self, span: Span, specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, import_kind: ImportOrExportKind, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::ImportDeclaration
This node contains a ImportDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - specifiers:
None
forimport 'foo'
,Some([])
forimport {} from 'foo'
- source
- with_clause: Some(vec![]) for empty assertion
- import_kind:
import type { foo } from 'bar'
sourcepub fn module_declaration_from_import_declaration<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_import_declaration<T>( self, inner: T, ) -> ModuleDeclaration<'a>
Convert a ImportDeclaration
into a ModuleDeclaration::ImportDeclaration
sourcepub fn module_declaration_export_all_declaration(
self,
span: Span,
exported: Option<ModuleExportName<'a>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
export_kind: ImportOrExportKind,
) -> ModuleDeclaration<'a>
pub fn module_declaration_export_all_declaration( self, span: Span, exported: Option<ModuleExportName<'a>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, export_kind: ImportOrExportKind, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::ExportAllDeclaration
This node contains a ExportAllDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - exported: If this declaration is re-named
- source
- with_clause: Will be
Some(vec![])
for empty assertion - export_kind
sourcepub fn module_declaration_from_export_all_declaration<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_export_all_declaration<T>( self, inner: T, ) -> ModuleDeclaration<'a>
Convert a ExportAllDeclaration
into a ModuleDeclaration::ExportAllDeclaration
sourcepub fn module_declaration_export_default_declaration(
self,
span: Span,
declaration: ExportDefaultDeclarationKind<'a>,
exported: ModuleExportName<'a>,
) -> ModuleDeclaration<'a>
pub fn module_declaration_export_default_declaration( self, span: Span, declaration: ExportDefaultDeclarationKind<'a>, exported: ModuleExportName<'a>, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::ExportDefaultDeclaration
This node contains a ExportDefaultDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - declaration
- exported
sourcepub fn module_declaration_from_export_default_declaration<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_export_default_declaration<T>( self, inner: T, ) -> ModuleDeclaration<'a>
Convert a ExportDefaultDeclaration
into a ModuleDeclaration::ExportDefaultDeclaration
sourcepub fn module_declaration_export_named_declaration(
self,
span: Span,
declaration: Option<Declaration<'a>>,
specifiers: Vec<'a, ExportSpecifier<'a>>,
source: Option<StringLiteral<'a>>,
export_kind: ImportOrExportKind,
with_clause: Option<WithClause<'a>>,
) -> ModuleDeclaration<'a>
pub fn module_declaration_export_named_declaration( self, span: Span, declaration: Option<Declaration<'a>>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option<StringLiteral<'a>>, export_kind: ImportOrExportKind, with_clause: Option<WithClause<'a>>, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::ExportNamedDeclaration
This node contains a ExportNamedDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - declaration
- specifiers
- source
- export_kind:
export type { foo }
- with_clause: Some(vec![]) for empty assertion
sourcepub fn module_declaration_from_export_named_declaration<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_export_named_declaration<T>( self, inner: T, ) -> ModuleDeclaration<'a>
Convert a ExportNamedDeclaration
into a ModuleDeclaration::ExportNamedDeclaration
sourcepub fn module_declaration_ts_export_assignment(
self,
span: Span,
expression: Expression<'a>,
) -> ModuleDeclaration<'a>
pub fn module_declaration_ts_export_assignment( self, span: Span, expression: Expression<'a>, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::TSExportAssignment
This node contains a TSExportAssignment
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn module_declaration_from_ts_export_assignment<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_ts_export_assignment<T>( self, inner: T, ) -> ModuleDeclaration<'a>
Convert a TSExportAssignment
into a ModuleDeclaration::TSExportAssignment
sourcepub fn module_declaration_ts_namespace_export_declaration(
self,
span: Span,
id: IdentifierName<'a>,
) -> ModuleDeclaration<'a>
pub fn module_declaration_ts_namespace_export_declaration( self, span: Span, id: IdentifierName<'a>, ) -> ModuleDeclaration<'a>
Build a ModuleDeclaration::TSNamespaceExportDeclaration
This node contains a TSNamespaceExportDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
sourcepub fn module_declaration_from_ts_namespace_export_declaration<T>(
self,
inner: T,
) -> ModuleDeclaration<'a>
pub fn module_declaration_from_ts_namespace_export_declaration<T>( self, inner: T, ) -> ModuleDeclaration<'a>
sourcepub fn accessor_property(
self,
type: AccessorPropertyType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
) -> AccessorProperty<'a>
pub fn accessor_property( self, type: AccessorPropertyType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, ) -> AccessorProperty<'a>
Builds a AccessorProperty
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_accessor_property
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the accessor property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration, if present.
- computed
- r#static
sourcepub fn alloc_accessor_property(
self,
type: AccessorPropertyType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
key: PropertyKey<'a>,
value: Option<Expression<'a>>,
computed: bool,
static: bool,
) -> Box<'a, AccessorProperty<'a>>
pub fn alloc_accessor_property( self, type: AccessorPropertyType, span: Span, decorators: Vec<'a, Decorator<'a>>, key: PropertyKey<'a>, value: Option<Expression<'a>>, computed: bool, static: bool, ) -> Box<'a, AccessorProperty<'a>>
Builds a AccessorProperty
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::accessor_property
instead.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the accessor property.
- key: The expression used to declare the property.
- value: Initialized value in the declaration, if present.
- computed
- r#static
sourcepub fn import_expression(
self,
span: Span,
source: Expression<'a>,
arguments: Vec<'a, Expression<'a>>,
) -> ImportExpression<'a>
pub fn import_expression( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, ) -> ImportExpression<'a>
Builds a ImportExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_expression
instead.
§Parameters
- span: The
Span
covering this node - source
- arguments
sourcepub fn alloc_import_expression(
self,
span: Span,
source: Expression<'a>,
arguments: Vec<'a, Expression<'a>>,
) -> Box<'a, ImportExpression<'a>>
pub fn alloc_import_expression( self, span: Span, source: Expression<'a>, arguments: Vec<'a, Expression<'a>>, ) -> Box<'a, ImportExpression<'a>>
Builds a ImportExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_expression
instead.
§Parameters
- span: The
Span
covering this node - source
- arguments
sourcepub fn import_declaration(
self,
span: Span,
specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
import_kind: ImportOrExportKind,
) -> ImportDeclaration<'a>
pub fn import_declaration( self, span: Span, specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, import_kind: ImportOrExportKind, ) -> ImportDeclaration<'a>
Builds a ImportDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_declaration
instead.
§Parameters
- span: The
Span
covering this node - specifiers:
None
forimport 'foo'
,Some([])
forimport {} from 'foo'
- source
- with_clause: Some(vec![]) for empty assertion
- import_kind:
import type { foo } from 'bar'
sourcepub fn alloc_import_declaration(
self,
span: Span,
specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
import_kind: ImportOrExportKind,
) -> Box<'a, ImportDeclaration<'a>>
pub fn alloc_import_declaration( self, span: Span, specifiers: Option<Vec<'a, ImportDeclarationSpecifier<'a>>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, import_kind: ImportOrExportKind, ) -> Box<'a, ImportDeclaration<'a>>
Builds a ImportDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_declaration
instead.
§Parameters
- span: The
Span
covering this node - specifiers:
None
forimport 'foo'
,Some([])
forimport {} from 'foo'
- source
- with_clause: Some(vec![]) for empty assertion
- import_kind:
import type { foo } from 'bar'
sourcepub fn import_declaration_specifier_import_specifier(
self,
span: Span,
imported: ModuleExportName<'a>,
local: BindingIdentifier<'a>,
import_kind: ImportOrExportKind,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_import_specifier( self, span: Span, imported: ModuleExportName<'a>, local: BindingIdentifier<'a>, import_kind: ImportOrExportKind, ) -> ImportDeclarationSpecifier<'a>
Build a ImportDeclarationSpecifier::ImportSpecifier
This node contains a ImportSpecifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - imported
- local: The name of the imported symbol.
- import_kind
sourcepub fn import_declaration_specifier_from_import_specifier<T>(
self,
inner: T,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_from_import_specifier<T>( self, inner: T, ) -> ImportDeclarationSpecifier<'a>
Convert a ImportSpecifier
into a ImportDeclarationSpecifier::ImportSpecifier
sourcepub fn import_declaration_specifier_import_default_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_import_default_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> ImportDeclarationSpecifier<'a>
Build a ImportDeclarationSpecifier::ImportDefaultSpecifier
This node contains a ImportDefaultSpecifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - local: The name of the imported symbol.
sourcepub fn import_declaration_specifier_from_import_default_specifier<T>(
self,
inner: T,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_from_import_default_specifier<T>( self, inner: T, ) -> ImportDeclarationSpecifier<'a>
Convert a ImportDefaultSpecifier
into a ImportDeclarationSpecifier::ImportDefaultSpecifier
sourcepub fn import_declaration_specifier_import_namespace_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_import_namespace_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> ImportDeclarationSpecifier<'a>
Build a ImportDeclarationSpecifier::ImportNamespaceSpecifier
This node contains a ImportNamespaceSpecifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - local
sourcepub fn import_declaration_specifier_from_import_namespace_specifier<T>(
self,
inner: T,
) -> ImportDeclarationSpecifier<'a>
pub fn import_declaration_specifier_from_import_namespace_specifier<T>( self, inner: T, ) -> ImportDeclarationSpecifier<'a>
sourcepub fn import_specifier(
self,
span: Span,
imported: ModuleExportName<'a>,
local: BindingIdentifier<'a>,
import_kind: ImportOrExportKind,
) -> ImportSpecifier<'a>
pub fn import_specifier( self, span: Span, imported: ModuleExportName<'a>, local: BindingIdentifier<'a>, import_kind: ImportOrExportKind, ) -> ImportSpecifier<'a>
Builds a ImportSpecifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_specifier
instead.
§Parameters
- span: The
Span
covering this node - imported
- local: The name of the imported symbol.
- import_kind
sourcepub fn alloc_import_specifier(
self,
span: Span,
imported: ModuleExportName<'a>,
local: BindingIdentifier<'a>,
import_kind: ImportOrExportKind,
) -> Box<'a, ImportSpecifier<'a>>
pub fn alloc_import_specifier( self, span: Span, imported: ModuleExportName<'a>, local: BindingIdentifier<'a>, import_kind: ImportOrExportKind, ) -> Box<'a, ImportSpecifier<'a>>
Builds a ImportSpecifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_specifier
instead.
§Parameters
- span: The
Span
covering this node - imported
- local: The name of the imported symbol.
- import_kind
sourcepub fn import_default_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> ImportDefaultSpecifier<'a>
pub fn import_default_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> ImportDefaultSpecifier<'a>
Builds a ImportDefaultSpecifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_default_specifier
instead.
§Parameters
- span: The
Span
covering this node - local: The name of the imported symbol.
sourcepub fn alloc_import_default_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> Box<'a, ImportDefaultSpecifier<'a>>
pub fn alloc_import_default_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> Box<'a, ImportDefaultSpecifier<'a>>
Builds a ImportDefaultSpecifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_default_specifier
instead.
§Parameters
- span: The
Span
covering this node - local: The name of the imported symbol.
sourcepub fn import_namespace_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> ImportNamespaceSpecifier<'a>
pub fn import_namespace_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> ImportNamespaceSpecifier<'a>
Builds a ImportNamespaceSpecifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_namespace_specifier
instead.
§Parameters
- span: The
Span
covering this node - local
sourcepub fn alloc_import_namespace_specifier(
self,
span: Span,
local: BindingIdentifier<'a>,
) -> Box<'a, ImportNamespaceSpecifier<'a>>
pub fn alloc_import_namespace_specifier( self, span: Span, local: BindingIdentifier<'a>, ) -> Box<'a, ImportNamespaceSpecifier<'a>>
Builds a ImportNamespaceSpecifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_namespace_specifier
instead.
§Parameters
- span: The
Span
covering this node - local
sourcepub fn with_clause(
self,
span: Span,
attributes_keyword: IdentifierName<'a>,
with_entries: Vec<'a, ImportAttribute<'a>>,
) -> WithClause<'a>
pub fn with_clause( self, span: Span, attributes_keyword: IdentifierName<'a>, with_entries: Vec<'a, ImportAttribute<'a>>, ) -> WithClause<'a>
Builds a WithClause
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_with_clause
instead.
§Parameters
- span: The
Span
covering this node - attributes_keyword
- with_entries
sourcepub fn alloc_with_clause(
self,
span: Span,
attributes_keyword: IdentifierName<'a>,
with_entries: Vec<'a, ImportAttribute<'a>>,
) -> Box<'a, WithClause<'a>>
pub fn alloc_with_clause( self, span: Span, attributes_keyword: IdentifierName<'a>, with_entries: Vec<'a, ImportAttribute<'a>>, ) -> Box<'a, WithClause<'a>>
Builds a WithClause
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::with_clause
instead.
§Parameters
- span: The
Span
covering this node - attributes_keyword
- with_entries
sourcepub fn import_attribute(
self,
span: Span,
key: ImportAttributeKey<'a>,
value: StringLiteral<'a>,
) -> ImportAttribute<'a>
pub fn import_attribute( self, span: Span, key: ImportAttributeKey<'a>, value: StringLiteral<'a>, ) -> ImportAttribute<'a>
Builds a ImportAttribute
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_import_attribute
instead.
§Parameters
- span: The
Span
covering this node - key
- value
sourcepub fn alloc_import_attribute(
self,
span: Span,
key: ImportAttributeKey<'a>,
value: StringLiteral<'a>,
) -> Box<'a, ImportAttribute<'a>>
pub fn alloc_import_attribute( self, span: Span, key: ImportAttributeKey<'a>, value: StringLiteral<'a>, ) -> Box<'a, ImportAttribute<'a>>
Builds a ImportAttribute
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::import_attribute
instead.
§Parameters
- span: The
Span
covering this node - key
- value
sourcepub fn import_attribute_key_identifier_name<A>(
self,
span: Span,
name: A,
) -> ImportAttributeKey<'a>
pub fn import_attribute_key_identifier_name<A>( self, span: Span, name: A, ) -> ImportAttributeKey<'a>
sourcepub fn import_attribute_key_from_identifier_name<T>(
self,
inner: T,
) -> ImportAttributeKey<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
pub fn import_attribute_key_from_identifier_name<T>(
self,
inner: T,
) -> ImportAttributeKey<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
Convert a IdentifierName
into a ImportAttributeKey::Identifier
sourcepub fn import_attribute_key_string_literal<A>(
self,
span: Span,
value: A,
) -> ImportAttributeKey<'a>
pub fn import_attribute_key_string_literal<A>( self, span: Span, value: A, ) -> ImportAttributeKey<'a>
sourcepub fn import_attribute_key_from_string_literal<T>(
self,
inner: T,
) -> ImportAttributeKey<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
pub fn import_attribute_key_from_string_literal<T>(
self,
inner: T,
) -> ImportAttributeKey<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
Convert a StringLiteral
into a ImportAttributeKey::StringLiteral
sourcepub fn export_named_declaration(
self,
span: Span,
declaration: Option<Declaration<'a>>,
specifiers: Vec<'a, ExportSpecifier<'a>>,
source: Option<StringLiteral<'a>>,
export_kind: ImportOrExportKind,
with_clause: Option<WithClause<'a>>,
) -> ExportNamedDeclaration<'a>
pub fn export_named_declaration( self, span: Span, declaration: Option<Declaration<'a>>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option<StringLiteral<'a>>, export_kind: ImportOrExportKind, with_clause: Option<WithClause<'a>>, ) -> ExportNamedDeclaration<'a>
Builds a ExportNamedDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_export_named_declaration
instead.
§Parameters
- span: The
Span
covering this node - declaration
- specifiers
- source
- export_kind:
export type { foo }
- with_clause: Some(vec![]) for empty assertion
sourcepub fn alloc_export_named_declaration(
self,
span: Span,
declaration: Option<Declaration<'a>>,
specifiers: Vec<'a, ExportSpecifier<'a>>,
source: Option<StringLiteral<'a>>,
export_kind: ImportOrExportKind,
with_clause: Option<WithClause<'a>>,
) -> Box<'a, ExportNamedDeclaration<'a>>
pub fn alloc_export_named_declaration( self, span: Span, declaration: Option<Declaration<'a>>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option<StringLiteral<'a>>, export_kind: ImportOrExportKind, with_clause: Option<WithClause<'a>>, ) -> Box<'a, ExportNamedDeclaration<'a>>
Builds a ExportNamedDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::export_named_declaration
instead.
§Parameters
- span: The
Span
covering this node - declaration
- specifiers
- source
- export_kind:
export type { foo }
- with_clause: Some(vec![]) for empty assertion
sourcepub fn export_default_declaration(
self,
span: Span,
declaration: ExportDefaultDeclarationKind<'a>,
exported: ModuleExportName<'a>,
) -> ExportDefaultDeclaration<'a>
pub fn export_default_declaration( self, span: Span, declaration: ExportDefaultDeclarationKind<'a>, exported: ModuleExportName<'a>, ) -> ExportDefaultDeclaration<'a>
Builds a ExportDefaultDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_export_default_declaration
instead.
§Parameters
- span: The
Span
covering this node - declaration
- exported
sourcepub fn alloc_export_default_declaration(
self,
span: Span,
declaration: ExportDefaultDeclarationKind<'a>,
exported: ModuleExportName<'a>,
) -> Box<'a, ExportDefaultDeclaration<'a>>
pub fn alloc_export_default_declaration( self, span: Span, declaration: ExportDefaultDeclarationKind<'a>, exported: ModuleExportName<'a>, ) -> Box<'a, ExportDefaultDeclaration<'a>>
Builds a ExportDefaultDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::export_default_declaration
instead.
§Parameters
- span: The
Span
covering this node - declaration
- exported
sourcepub fn export_all_declaration(
self,
span: Span,
exported: Option<ModuleExportName<'a>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
export_kind: ImportOrExportKind,
) -> ExportAllDeclaration<'a>
pub fn export_all_declaration( self, span: Span, exported: Option<ModuleExportName<'a>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, export_kind: ImportOrExportKind, ) -> ExportAllDeclaration<'a>
Builds a ExportAllDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_export_all_declaration
instead.
§Parameters
- span: The
Span
covering this node - exported: If this declaration is re-named
- source
- with_clause: Will be
Some(vec![])
for empty assertion - export_kind
sourcepub fn alloc_export_all_declaration(
self,
span: Span,
exported: Option<ModuleExportName<'a>>,
source: StringLiteral<'a>,
with_clause: Option<WithClause<'a>>,
export_kind: ImportOrExportKind,
) -> Box<'a, ExportAllDeclaration<'a>>
pub fn alloc_export_all_declaration( self, span: Span, exported: Option<ModuleExportName<'a>>, source: StringLiteral<'a>, with_clause: Option<WithClause<'a>>, export_kind: ImportOrExportKind, ) -> Box<'a, ExportAllDeclaration<'a>>
Builds a ExportAllDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::export_all_declaration
instead.
§Parameters
- span: The
Span
covering this node - exported: If this declaration is re-named
- source
- with_clause: Will be
Some(vec![])
for empty assertion - export_kind
sourcepub fn export_specifier(
self,
span: Span,
local: ModuleExportName<'a>,
exported: ModuleExportName<'a>,
export_kind: ImportOrExportKind,
) -> ExportSpecifier<'a>
pub fn export_specifier( self, span: Span, local: ModuleExportName<'a>, exported: ModuleExportName<'a>, export_kind: ImportOrExportKind, ) -> ExportSpecifier<'a>
Builds a ExportSpecifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_export_specifier
instead.
§Parameters
- span: The
Span
covering this node - local
- exported
- export_kind
sourcepub fn alloc_export_specifier(
self,
span: Span,
local: ModuleExportName<'a>,
exported: ModuleExportName<'a>,
export_kind: ImportOrExportKind,
) -> Box<'a, ExportSpecifier<'a>>
pub fn alloc_export_specifier( self, span: Span, local: ModuleExportName<'a>, exported: ModuleExportName<'a>, export_kind: ImportOrExportKind, ) -> Box<'a, ExportSpecifier<'a>>
Builds a ExportSpecifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::export_specifier
instead.
§Parameters
- span: The
Span
covering this node - local
- exported
- export_kind
sourcepub fn export_default_declaration_kind_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> ExportDefaultDeclarationKind<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
pub fn export_default_declaration_kind_function<T1, T2, T3, T4>(
self,
type: FunctionType,
span: Span,
id: Option<BindingIdentifier<'a>>,
generator: bool,
async: bool,
declare: bool,
type_parameters: T1,
this_param: Option<TSThisParameter<'a>>,
params: T2,
return_type: T3,
body: T4,
) -> ExportDefaultDeclarationKind<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T4: IntoIn<'a, Option<Box<'a, FunctionBody<'a>>>>,
Build a ExportDefaultDeclarationKind::FunctionDeclaration
This node contains a Function
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - id
- generator
- r#async
- declare
- type_parameters
- this_param: Declaring
this
in a Function https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function - params
- return_type
- body
sourcepub fn export_default_declaration_kind_from_function<T>(
self,
inner: T,
) -> ExportDefaultDeclarationKind<'a>
pub fn export_default_declaration_kind_from_function<T>( self, inner: T, ) -> ExportDefaultDeclarationKind<'a>
Convert a Function
into a ExportDefaultDeclarationKind::FunctionDeclaration
sourcepub fn export_default_declaration_kind_class<T1, T2, T3>(
self,
type: ClassType,
span: Span,
decorators: Vec<'a, Decorator<'a>>,
id: Option<BindingIdentifier<'a>>,
type_parameters: T1,
super_class: Option<Expression<'a>>,
super_type_parameters: T2,
implements: Option<Vec<'a, TSClassImplements<'a>>>,
body: T3,
abstract: bool,
declare: bool,
) -> ExportDefaultDeclarationKind<'a>
pub fn export_default_declaration_kind_class<T1, T2, T3>( self, type: ClassType, span: Span, decorators: Vec<'a, Decorator<'a>>, id: Option<BindingIdentifier<'a>>, type_parameters: T1, super_class: Option<Expression<'a>>, super_type_parameters: T2, implements: Option<Vec<'a, TSClassImplements<'a>>>, body: T3, abstract: bool, declare: bool, ) -> ExportDefaultDeclarationKind<'a>
Build a ExportDefaultDeclarationKind::ClassDeclaration
This node contains a Class
that will be stored in the memory arena.
§Parameters
- r#type
- span: The
Span
covering this node - decorators: Decorators applied to the class.
- id: Class identifier, AKA the name
- type_parameters
- super_class: Super class. When present, this will usually be an
IdentifierReference
. - super_type_parameters: Type parameters passed to super class.
- implements: Interface implementation clause for TypeScript classes.
- body
- r#abstract: Whether the class is abstract
- declare: Whether the class was
declare
ed
sourcepub fn export_default_declaration_kind_from_class<T>(
self,
inner: T,
) -> ExportDefaultDeclarationKind<'a>
pub fn export_default_declaration_kind_from_class<T>( self, inner: T, ) -> ExportDefaultDeclarationKind<'a>
Convert a Class
into a ExportDefaultDeclarationKind::ClassDeclaration
sourcepub fn export_default_declaration_kind_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> ExportDefaultDeclarationKind<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
pub fn export_default_declaration_kind_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> ExportDefaultDeclarationKind<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
Build a ExportDefaultDeclarationKind::TSInterfaceDeclaration
This node contains a TSInterfaceDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id: The identifier (name) of the interface.
- extends
- type_parameters
- body
- declare
sourcepub fn export_default_declaration_kind_from_ts_interface_declaration<T>(
self,
inner: T,
) -> ExportDefaultDeclarationKind<'a>
pub fn export_default_declaration_kind_from_ts_interface_declaration<T>( self, inner: T, ) -> ExportDefaultDeclarationKind<'a>
pub fn export_default_declaration_kind_expression( self, inner: Expression<'a>, ) -> ExportDefaultDeclarationKind<'a>
sourcepub fn module_export_name_identifier_name<A>(
self,
span: Span,
name: A,
) -> ModuleExportName<'a>
pub fn module_export_name_identifier_name<A>( self, span: Span, name: A, ) -> ModuleExportName<'a>
sourcepub fn module_export_name_from_identifier_name<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
pub fn module_export_name_from_identifier_name<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
Convert a IdentifierName
into a ModuleExportName::IdentifierName
sourcepub fn module_export_name_identifier_reference<A>(
self,
span: Span,
name: A,
) -> ModuleExportName<'a>
pub fn module_export_name_identifier_reference<A>( self, span: Span, name: A, ) -> ModuleExportName<'a>
Build a ModuleExportName::IdentifierReference
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn module_export_name_from_identifier_reference<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, IdentifierReference<'a>>,
pub fn module_export_name_from_identifier_reference<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, IdentifierReference<'a>>,
Convert a IdentifierReference
into a ModuleExportName::IdentifierReference
sourcepub fn module_export_name_string_literal<A>(
self,
span: Span,
value: A,
) -> ModuleExportName<'a>
pub fn module_export_name_string_literal<A>( self, span: Span, value: A, ) -> ModuleExportName<'a>
sourcepub fn module_export_name_from_string_literal<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
pub fn module_export_name_from_string_literal<T>(
self,
inner: T,
) -> ModuleExportName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
Convert a StringLiteral
into a ModuleExportName::StringLiteral
sourcepub fn ts_this_parameter<T1>(
self,
span: Span,
this: IdentifierName<'a>,
type_annotation: T1,
) -> TSThisParameter<'a>
pub fn ts_this_parameter<T1>( self, span: Span, this: IdentifierName<'a>, type_annotation: T1, ) -> TSThisParameter<'a>
Builds a TSThisParameter
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_this_parameter
instead.
§Parameters
- span: The
Span
covering this node - this
- type_annotation
sourcepub fn alloc_ts_this_parameter<T1>(
self,
span: Span,
this: IdentifierName<'a>,
type_annotation: T1,
) -> Box<'a, TSThisParameter<'a>>
pub fn alloc_ts_this_parameter<T1>( self, span: Span, this: IdentifierName<'a>, type_annotation: T1, ) -> Box<'a, TSThisParameter<'a>>
Builds a TSThisParameter
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_this_parameter
instead.
§Parameters
- span: The
Span
covering this node - this
- type_annotation
sourcepub fn ts_enum_declaration(
self,
span: Span,
id: BindingIdentifier<'a>,
members: Vec<'a, TSEnumMember<'a>>,
const: bool,
declare: bool,
) -> TSEnumDeclaration<'a>
pub fn ts_enum_declaration( self, span: Span, id: BindingIdentifier<'a>, members: Vec<'a, TSEnumMember<'a>>, const: bool, declare: bool, ) -> TSEnumDeclaration<'a>
Builds a TSEnumDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_enum_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- members
- r#const
- declare
sourcepub fn alloc_ts_enum_declaration(
self,
span: Span,
id: BindingIdentifier<'a>,
members: Vec<'a, TSEnumMember<'a>>,
const: bool,
declare: bool,
) -> Box<'a, TSEnumDeclaration<'a>>
pub fn alloc_ts_enum_declaration( self, span: Span, id: BindingIdentifier<'a>, members: Vec<'a, TSEnumMember<'a>>, const: bool, declare: bool, ) -> Box<'a, TSEnumDeclaration<'a>>
Builds a TSEnumDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_enum_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- members
- r#const
- declare
sourcepub fn ts_enum_member(
self,
span: Span,
id: TSEnumMemberName<'a>,
initializer: Option<Expression<'a>>,
) -> TSEnumMember<'a>
pub fn ts_enum_member( self, span: Span, id: TSEnumMemberName<'a>, initializer: Option<Expression<'a>>, ) -> TSEnumMember<'a>
Builds a TSEnumMember
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_enum_member
instead.
§Parameters
- span: The
Span
covering this node - id
- initializer
sourcepub fn alloc_ts_enum_member(
self,
span: Span,
id: TSEnumMemberName<'a>,
initializer: Option<Expression<'a>>,
) -> Box<'a, TSEnumMember<'a>>
pub fn alloc_ts_enum_member( self, span: Span, id: TSEnumMemberName<'a>, initializer: Option<Expression<'a>>, ) -> Box<'a, TSEnumMember<'a>>
Builds a TSEnumMember
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_enum_member
instead.
§Parameters
- span: The
Span
covering this node - id
- initializer
sourcepub fn ts_enum_member_name_identifier_name<A>(
self,
span: Span,
name: A,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_identifier_name<A>( self, span: Span, name: A, ) -> TSEnumMemberName<'a>
Build a TSEnumMemberName::StaticIdentifier
This node contains a IdentifierName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn ts_enum_member_name_from_identifier_name<T>(
self,
inner: T,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_from_identifier_name<T>( self, inner: T, ) -> TSEnumMemberName<'a>
Convert a IdentifierName
into a TSEnumMemberName::StaticIdentifier
sourcepub fn ts_enum_member_name_string_literal<A>(
self,
span: Span,
value: A,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_string_literal<A>( self, span: Span, value: A, ) -> TSEnumMemberName<'a>
Build a TSEnumMemberName::StaticStringLiteral
This node contains a StringLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn ts_enum_member_name_from_string_literal<T>(
self,
inner: T,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_from_string_literal<T>( self, inner: T, ) -> TSEnumMemberName<'a>
Convert a StringLiteral
into a TSEnumMemberName::StaticStringLiteral
sourcepub fn ts_enum_member_name_template_literal(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
expressions: Vec<'a, Expression<'a>>,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_template_literal( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, expressions: Vec<'a, Expression<'a>>, ) -> TSEnumMemberName<'a>
Build a TSEnumMemberName::StaticTemplateLiteral
This node contains a TemplateLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - quasis
- expressions
sourcepub fn ts_enum_member_name_from_template_literal<T>(
self,
inner: T,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_from_template_literal<T>( self, inner: T, ) -> TSEnumMemberName<'a>
Convert a TemplateLiteral
into a TSEnumMemberName::StaticTemplateLiteral
sourcepub fn ts_enum_member_name_numeric_literal<S>(
self,
span: Span,
value: f64,
raw: S,
base: NumberBase,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_numeric_literal<S>( self, span: Span, value: f64, raw: S, base: NumberBase, ) -> TSEnumMemberName<'a>
Build a TSEnumMemberName::StaticNumericLiteral
This node contains a NumericLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value: The value of the number, converted into base 10
- raw: The number as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn ts_enum_member_name_from_numeric_literal<T>(
self,
inner: T,
) -> TSEnumMemberName<'a>
pub fn ts_enum_member_name_from_numeric_literal<T>( self, inner: T, ) -> TSEnumMemberName<'a>
Convert a NumericLiteral
into a TSEnumMemberName::StaticNumericLiteral
pub fn ts_enum_member_name_expression( self, inner: Expression<'a>, ) -> TSEnumMemberName<'a>
sourcepub fn ts_type_annotation(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSTypeAnnotation<'a>
pub fn ts_type_annotation( self, span: Span, type_annotation: TSType<'a>, ) -> TSTypeAnnotation<'a>
Builds a TSTypeAnnotation
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_annotation
instead.
§Parameters
- span: starts at the
:
token and ends at the end of the type annotation - type_annotation
sourcepub fn alloc_ts_type_annotation(
self,
span: Span,
type_annotation: TSType<'a>,
) -> Box<'a, TSTypeAnnotation<'a>>
pub fn alloc_ts_type_annotation( self, span: Span, type_annotation: TSType<'a>, ) -> Box<'a, TSTypeAnnotation<'a>>
Builds a TSTypeAnnotation
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_annotation
instead.
§Parameters
- span: starts at the
:
token and ends at the end of the type annotation - type_annotation
sourcepub fn ts_literal_type(
self,
span: Span,
literal: TSLiteral<'a>,
) -> TSLiteralType<'a>
pub fn ts_literal_type( self, span: Span, literal: TSLiteral<'a>, ) -> TSLiteralType<'a>
Builds a TSLiteralType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_literal_type
instead.
§Parameters
- span: The
Span
covering this node - literal
sourcepub fn alloc_ts_literal_type(
self,
span: Span,
literal: TSLiteral<'a>,
) -> Box<'a, TSLiteralType<'a>>
pub fn alloc_ts_literal_type( self, span: Span, literal: TSLiteral<'a>, ) -> Box<'a, TSLiteralType<'a>>
Builds a TSLiteralType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_literal_type
instead.
§Parameters
- span: The
Span
covering this node - literal
sourcepub fn ts_literal_boolean_literal(
self,
span: Span,
value: bool,
) -> TSLiteral<'a>
pub fn ts_literal_boolean_literal( self, span: Span, value: bool, ) -> TSLiteral<'a>
Build a TSLiteral::BooleanLiteral
This node contains a BooleanLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn ts_literal_from_boolean_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_boolean_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a BooleanLiteral
into a TSLiteral::BooleanLiteral
sourcepub fn ts_literal_null_literal(self, span: Span) -> TSLiteral<'a>
pub fn ts_literal_null_literal(self, span: Span) -> TSLiteral<'a>
Build a TSLiteral::NullLiteral
This node contains a NullLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_literal_from_null_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_null_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a NullLiteral
into a TSLiteral::NullLiteral
sourcepub fn ts_literal_numeric_literal<S>(
self,
span: Span,
value: f64,
raw: S,
base: NumberBase,
) -> TSLiteral<'a>
pub fn ts_literal_numeric_literal<S>( self, span: Span, value: f64, raw: S, base: NumberBase, ) -> TSLiteral<'a>
Build a TSLiteral::NumericLiteral
This node contains a NumericLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value: The value of the number, converted into base 10
- raw: The number as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn ts_literal_from_numeric_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_numeric_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a NumericLiteral
into a TSLiteral::NumericLiteral
sourcepub fn ts_literal_big_int_literal<A>(
self,
span: Span,
raw: A,
base: BigintBase,
) -> TSLiteral<'a>
pub fn ts_literal_big_int_literal<A>( self, span: Span, raw: A, base: BigintBase, ) -> TSLiteral<'a>
Build a TSLiteral::BigIntLiteral
This node contains a BigIntLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - raw: The bigint as it appears in the source code
- base: The base representation used by the literal in the source code
sourcepub fn ts_literal_from_big_int_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_big_int_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a BigIntLiteral
into a TSLiteral::BigIntLiteral
sourcepub fn ts_literal_reg_exp_literal(
self,
span: Span,
value: EmptyObject,
regex: RegExp<'a>,
) -> TSLiteral<'a>
pub fn ts_literal_reg_exp_literal( self, span: Span, value: EmptyObject, regex: RegExp<'a>, ) -> TSLiteral<'a>
Build a TSLiteral::RegExpLiteral
This node contains a RegExpLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
- regex
sourcepub fn ts_literal_from_reg_exp_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_reg_exp_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a RegExpLiteral
into a TSLiteral::RegExpLiteral
sourcepub fn ts_literal_string_literal<A>(self, span: Span, value: A) -> TSLiteral<'a>
pub fn ts_literal_string_literal<A>(self, span: Span, value: A) -> TSLiteral<'a>
Build a TSLiteral::StringLiteral
This node contains a StringLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn ts_literal_from_string_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_string_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a StringLiteral
into a TSLiteral::StringLiteral
sourcepub fn ts_literal_template_literal(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
expressions: Vec<'a, Expression<'a>>,
) -> TSLiteral<'a>
pub fn ts_literal_template_literal( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, expressions: Vec<'a, Expression<'a>>, ) -> TSLiteral<'a>
Build a TSLiteral::TemplateLiteral
This node contains a TemplateLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - quasis
- expressions
sourcepub fn ts_literal_from_template_literal<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_template_literal<T>(self, inner: T) -> TSLiteral<'a>
Convert a TemplateLiteral
into a TSLiteral::TemplateLiteral
sourcepub fn ts_literal_unary_expression(
self,
span: Span,
operator: UnaryOperator,
argument: Expression<'a>,
) -> TSLiteral<'a>
pub fn ts_literal_unary_expression( self, span: Span, operator: UnaryOperator, argument: Expression<'a>, ) -> TSLiteral<'a>
Build a TSLiteral::UnaryExpression
This node contains a UnaryExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - operator
- argument
sourcepub fn ts_literal_from_unary_expression<T>(self, inner: T) -> TSLiteral<'a>
pub fn ts_literal_from_unary_expression<T>(self, inner: T) -> TSLiteral<'a>
Convert a UnaryExpression
into a TSLiteral::UnaryExpression
sourcepub fn ts_type_any_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_any_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSAnyKeyword
This node contains a TSAnyKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_any_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_any_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSAnyKeyword
into a TSType::TSAnyKeyword
sourcepub fn ts_type_big_int_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_big_int_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSBigIntKeyword
This node contains a TSBigIntKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_big_int_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_big_int_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSBigIntKeyword
into a TSType::TSBigIntKeyword
sourcepub fn ts_type_boolean_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_boolean_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSBooleanKeyword
This node contains a TSBooleanKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_boolean_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_boolean_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSBooleanKeyword
into a TSType::TSBooleanKeyword
sourcepub fn ts_type_intrinsic_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_intrinsic_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSIntrinsicKeyword
This node contains a TSIntrinsicKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_intrinsic_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_intrinsic_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSIntrinsicKeyword
into a TSType::TSIntrinsicKeyword
sourcepub fn ts_type_never_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_never_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSNeverKeyword
This node contains a TSNeverKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_never_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_never_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSNeverKeyword
into a TSType::TSNeverKeyword
sourcepub fn ts_type_null_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_null_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSNullKeyword
This node contains a TSNullKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_null_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_null_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSNullKeyword
into a TSType::TSNullKeyword
sourcepub fn ts_type_number_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_number_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSNumberKeyword
This node contains a TSNumberKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_number_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_number_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSNumberKeyword
into a TSType::TSNumberKeyword
sourcepub fn ts_type_object_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_object_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSObjectKeyword
This node contains a TSObjectKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_object_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_object_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSObjectKeyword
into a TSType::TSObjectKeyword
sourcepub fn ts_type_string_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_string_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSStringKeyword
This node contains a TSStringKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_string_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_string_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSStringKeyword
into a TSType::TSStringKeyword
sourcepub fn ts_type_symbol_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_symbol_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSSymbolKeyword
This node contains a TSSymbolKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_symbol_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_symbol_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSSymbolKeyword
into a TSType::TSSymbolKeyword
sourcepub fn ts_type_undefined_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_undefined_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSUndefinedKeyword
This node contains a TSUndefinedKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_undefined_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_undefined_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSUndefinedKeyword
into a TSType::TSUndefinedKeyword
sourcepub fn ts_type_unknown_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_unknown_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSUnknownKeyword
This node contains a TSUnknownKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_unknown_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_unknown_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSUnknownKeyword
into a TSType::TSUnknownKeyword
sourcepub fn ts_type_void_keyword(self, span: Span) -> TSType<'a>
pub fn ts_type_void_keyword(self, span: Span) -> TSType<'a>
Build a TSType::TSVoidKeyword
This node contains a TSVoidKeyword
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_void_keyword<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_void_keyword<T>(self, inner: T) -> TSType<'a>
Convert a TSVoidKeyword
into a TSType::TSVoidKeyword
sourcepub fn ts_type_array_type(
self,
span: Span,
element_type: TSType<'a>,
) -> TSType<'a>
pub fn ts_type_array_type( self, span: Span, element_type: TSType<'a>, ) -> TSType<'a>
Build a TSType::TSArrayType
This node contains a TSArrayType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - element_type
sourcepub fn ts_type_from_ts_array_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_array_type<T>(self, inner: T) -> TSType<'a>
Convert a TSArrayType
into a TSType::TSArrayType
sourcepub fn ts_type_conditional_type(
self,
span: Span,
check_type: TSType<'a>,
extends_type: TSType<'a>,
true_type: TSType<'a>,
false_type: TSType<'a>,
) -> TSType<'a>
pub fn ts_type_conditional_type( self, span: Span, check_type: TSType<'a>, extends_type: TSType<'a>, true_type: TSType<'a>, false_type: TSType<'a>, ) -> TSType<'a>
Build a TSType::TSConditionalType
This node contains a TSConditionalType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - check_type
- extends_type
- true_type
- false_type
sourcepub fn ts_type_from_ts_conditional_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_conditional_type<T>(self, inner: T) -> TSType<'a>
Convert a TSConditionalType
into a TSType::TSConditionalType
sourcepub fn ts_type_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_type_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Build a TSType::TSConstructorType
This node contains a TSConstructorType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - r#abstract
- params
- return_type
- type_parameters
sourcepub fn ts_type_from_ts_constructor_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_constructor_type<T>(self, inner: T) -> TSType<'a>
Convert a TSConstructorType
into a TSType::TSConstructorType
sourcepub fn ts_type_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_type_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Build a TSType::TSFunctionType
This node contains a TSFunctionType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn ts_type_from_ts_function_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_function_type<T>(self, inner: T) -> TSType<'a>
Convert a TSFunctionType
into a TSType::TSFunctionType
sourcepub fn ts_type_import_type<T1>(
self,
span: Span,
is_type_of: bool,
parameter: TSType<'a>,
qualifier: Option<TSTypeName<'a>>,
attributes: Option<TSImportAttributes<'a>>,
type_parameters: T1,
) -> TSType<'a>
pub fn ts_type_import_type<T1>( self, span: Span, is_type_of: bool, parameter: TSType<'a>, qualifier: Option<TSTypeName<'a>>, attributes: Option<TSImportAttributes<'a>>, type_parameters: T1, ) -> TSType<'a>
Build a TSType::TSImportType
This node contains a TSImportType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - is_type_of
- parameter
- qualifier
- attributes
- type_parameters
sourcepub fn ts_type_from_ts_import_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_import_type<T>(self, inner: T) -> TSType<'a>
Convert a TSImportType
into a TSType::TSImportType
sourcepub fn ts_type_indexed_access_type(
self,
span: Span,
object_type: TSType<'a>,
index_type: TSType<'a>,
) -> TSType<'a>
pub fn ts_type_indexed_access_type( self, span: Span, object_type: TSType<'a>, index_type: TSType<'a>, ) -> TSType<'a>
Build a TSType::TSIndexedAccessType
This node contains a TSIndexedAccessType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object_type
- index_type
sourcepub fn ts_type_from_ts_indexed_access_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_indexed_access_type<T>(self, inner: T) -> TSType<'a>
Convert a TSIndexedAccessType
into a TSType::TSIndexedAccessType
sourcepub fn ts_type_infer_type<T1>(
self,
span: Span,
type_parameter: T1,
) -> TSType<'a>
pub fn ts_type_infer_type<T1>( self, span: Span, type_parameter: T1, ) -> TSType<'a>
Build a TSType::TSInferType
This node contains a TSInferType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_parameter
sourcepub fn ts_type_from_ts_infer_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_infer_type<T>(self, inner: T) -> TSType<'a>
Convert a TSInferType
into a TSType::TSInferType
sourcepub fn ts_type_intersection_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> TSType<'a>
pub fn ts_type_intersection_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> TSType<'a>
Build a TSType::TSIntersectionType
This node contains a TSIntersectionType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn ts_type_from_ts_intersection_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_intersection_type<T>(self, inner: T) -> TSType<'a>
Convert a TSIntersectionType
into a TSType::TSIntersectionType
sourcepub fn ts_type_literal_type(
self,
span: Span,
literal: TSLiteral<'a>,
) -> TSType<'a>
pub fn ts_type_literal_type( self, span: Span, literal: TSLiteral<'a>, ) -> TSType<'a>
Build a TSType::TSLiteralType
This node contains a TSLiteralType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - literal
sourcepub fn ts_type_from_ts_literal_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_literal_type<T>(self, inner: T) -> TSType<'a>
Convert a TSLiteralType
into a TSType::TSLiteralType
sourcepub fn ts_type_mapped_type<T1>(
self,
span: Span,
type_parameter: T1,
name_type: Option<TSType<'a>>,
type_annotation: Option<TSType<'a>>,
optional: TSMappedTypeModifierOperator,
readonly: TSMappedTypeModifierOperator,
) -> TSType<'a>
pub fn ts_type_mapped_type<T1>( self, span: Span, type_parameter: T1, name_type: Option<TSType<'a>>, type_annotation: Option<TSType<'a>>, optional: TSMappedTypeModifierOperator, readonly: TSMappedTypeModifierOperator, ) -> TSType<'a>
Build a TSType::TSMappedType
This node contains a TSMappedType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_parameter
- name_type
- type_annotation
- optional
- readonly
sourcepub fn ts_type_from_ts_mapped_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_mapped_type<T>(self, inner: T) -> TSType<'a>
Convert a TSMappedType
into a TSType::TSMappedType
sourcepub fn ts_type_named_tuple_member(
self,
span: Span,
element_type: TSTupleElement<'a>,
label: IdentifierName<'a>,
optional: bool,
) -> TSType<'a>
pub fn ts_type_named_tuple_member( self, span: Span, element_type: TSTupleElement<'a>, label: IdentifierName<'a>, optional: bool, ) -> TSType<'a>
Build a TSType::TSNamedTupleMember
This node contains a TSNamedTupleMember
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - element_type
- label
- optional
sourcepub fn ts_type_from_ts_named_tuple_member<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_named_tuple_member<T>(self, inner: T) -> TSType<'a>
Convert a TSNamedTupleMember
into a TSType::TSNamedTupleMember
sourcepub fn ts_type_qualified_name(
self,
span: Span,
left: TSTypeName<'a>,
right: IdentifierName<'a>,
) -> TSType<'a>
pub fn ts_type_qualified_name( self, span: Span, left: TSTypeName<'a>, right: IdentifierName<'a>, ) -> TSType<'a>
Build a TSType::TSQualifiedName
This node contains a TSQualifiedName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn ts_type_from_ts_qualified_name<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_qualified_name<T>(self, inner: T) -> TSType<'a>
Convert a TSQualifiedName
into a TSType::TSQualifiedName
sourcepub fn ts_type_template_literal_type(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
types: Vec<'a, TSType<'a>>,
) -> TSType<'a>
pub fn ts_type_template_literal_type( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, types: Vec<'a, TSType<'a>>, ) -> TSType<'a>
Build a TSType::TSTemplateLiteralType
This node contains a TSTemplateLiteralType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - quasis
- types
sourcepub fn ts_type_from_ts_template_literal_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_template_literal_type<T>(self, inner: T) -> TSType<'a>
Convert a TSTemplateLiteralType
into a TSType::TSTemplateLiteralType
sourcepub fn ts_type_this_type(self, span: Span) -> TSType<'a>
pub fn ts_type_this_type(self, span: Span) -> TSType<'a>
Build a TSType::TSThisType
This node contains a TSThisType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_ts_this_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_this_type<T>(self, inner: T) -> TSType<'a>
Convert a TSThisType
into a TSType::TSThisType
sourcepub fn ts_type_tuple_type(
self,
span: Span,
element_types: Vec<'a, TSTupleElement<'a>>,
) -> TSType<'a>
pub fn ts_type_tuple_type( self, span: Span, element_types: Vec<'a, TSTupleElement<'a>>, ) -> TSType<'a>
Build a TSType::TSTupleType
This node contains a TSTupleType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - element_types
sourcepub fn ts_type_from_ts_tuple_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_tuple_type<T>(self, inner: T) -> TSType<'a>
Convert a TSTupleType
into a TSType::TSTupleType
sourcepub fn ts_type_type_literal(
self,
span: Span,
members: Vec<'a, TSSignature<'a>>,
) -> TSType<'a>
pub fn ts_type_type_literal( self, span: Span, members: Vec<'a, TSSignature<'a>>, ) -> TSType<'a>
Build a TSType::TSTypeLiteral
This node contains a TSTypeLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - members
sourcepub fn ts_type_from_ts_type_literal<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_type_literal<T>(self, inner: T) -> TSType<'a>
Convert a TSTypeLiteral
into a TSType::TSTypeLiteral
sourcepub fn ts_type_type_operator(
self,
span: Span,
operator: TSTypeOperatorOperator,
type_annotation: TSType<'a>,
) -> TSType<'a>
pub fn ts_type_type_operator( self, span: Span, operator: TSTypeOperatorOperator, type_annotation: TSType<'a>, ) -> TSType<'a>
Build a TSType::TSTypeOperatorType
This node contains a TSTypeOperator
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - operator
- type_annotation
sourcepub fn ts_type_from_ts_type_operator<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_type_operator<T>(self, inner: T) -> TSType<'a>
Convert a TSTypeOperator
into a TSType::TSTypeOperatorType
sourcepub fn ts_type_type_predicate<T1>(
self,
span: Span,
parameter_name: TSTypePredicateName<'a>,
asserts: bool,
type_annotation: T1,
) -> TSType<'a>
pub fn ts_type_type_predicate<T1>( self, span: Span, parameter_name: TSTypePredicateName<'a>, asserts: bool, type_annotation: T1, ) -> TSType<'a>
Build a TSType::TSTypePredicate
This node contains a TSTypePredicate
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - parameter_name
- asserts
- type_annotation
sourcepub fn ts_type_from_ts_type_predicate<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_type_predicate<T>(self, inner: T) -> TSType<'a>
Convert a TSTypePredicate
into a TSType::TSTypePredicate
sourcepub fn ts_type_type_query<T1>(
self,
span: Span,
expr_name: TSTypeQueryExprName<'a>,
type_parameters: T1,
) -> TSType<'a>
pub fn ts_type_type_query<T1>( self, span: Span, expr_name: TSTypeQueryExprName<'a>, type_parameters: T1, ) -> TSType<'a>
Build a TSType::TSTypeQuery
This node contains a TSTypeQuery
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expr_name
- type_parameters
sourcepub fn ts_type_from_ts_type_query<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_type_query<T>(self, inner: T) -> TSType<'a>
Convert a TSTypeQuery
into a TSType::TSTypeQuery
sourcepub fn ts_type_type_reference<T1>(
self,
span: Span,
type_name: TSTypeName<'a>,
type_parameters: T1,
) -> TSType<'a>
pub fn ts_type_type_reference<T1>( self, span: Span, type_name: TSTypeName<'a>, type_parameters: T1, ) -> TSType<'a>
Build a TSType::TSTypeReference
This node contains a TSTypeReference
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_name
- type_parameters
sourcepub fn ts_type_from_ts_type_reference<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_type_reference<T>(self, inner: T) -> TSType<'a>
Convert a TSTypeReference
into a TSType::TSTypeReference
sourcepub fn ts_type_union_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> TSType<'a>
pub fn ts_type_union_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> TSType<'a>
Build a TSType::TSUnionType
This node contains a TSUnionType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn ts_type_from_ts_union_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_union_type<T>(self, inner: T) -> TSType<'a>
Convert a TSUnionType
into a TSType::TSUnionType
sourcepub fn ts_type_parenthesized_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSType<'a>
pub fn ts_type_parenthesized_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSType<'a>
Build a TSType::TSParenthesizedType
This node contains a TSParenthesizedType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_type_from_ts_parenthesized_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_ts_parenthesized_type<T>(self, inner: T) -> TSType<'a>
Convert a TSParenthesizedType
into a TSType::TSParenthesizedType
sourcepub fn ts_type_js_doc_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> TSType<'a>
pub fn ts_type_js_doc_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> TSType<'a>
Build a TSType::JSDocNullableType
This node contains a JSDocNullableType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix: Was
?
after the type annotation?
sourcepub fn ts_type_from_js_doc_nullable_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_js_doc_nullable_type<T>(self, inner: T) -> TSType<'a>
Convert a JSDocNullableType
into a TSType::JSDocNullableType
sourcepub fn ts_type_js_doc_non_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> TSType<'a>
pub fn ts_type_js_doc_non_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> TSType<'a>
Build a TSType::JSDocNonNullableType
This node contains a JSDocNonNullableType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix
sourcepub fn ts_type_from_js_doc_non_nullable_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_js_doc_non_nullable_type<T>(self, inner: T) -> TSType<'a>
Convert a JSDocNonNullableType
into a TSType::JSDocNonNullableType
sourcepub fn ts_type_js_doc_unknown_type(self, span: Span) -> TSType<'a>
pub fn ts_type_js_doc_unknown_type(self, span: Span) -> TSType<'a>
Build a TSType::JSDocUnknownType
This node contains a JSDocUnknownType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_from_js_doc_unknown_type<T>(self, inner: T) -> TSType<'a>
pub fn ts_type_from_js_doc_unknown_type<T>(self, inner: T) -> TSType<'a>
Convert a JSDocUnknownType
into a TSType::JSDocUnknownType
sourcepub fn ts_conditional_type(
self,
span: Span,
check_type: TSType<'a>,
extends_type: TSType<'a>,
true_type: TSType<'a>,
false_type: TSType<'a>,
) -> TSConditionalType<'a>
pub fn ts_conditional_type( self, span: Span, check_type: TSType<'a>, extends_type: TSType<'a>, true_type: TSType<'a>, false_type: TSType<'a>, ) -> TSConditionalType<'a>
Builds a TSConditionalType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_conditional_type
instead.
§Parameters
- span: The
Span
covering this node - check_type
- extends_type
- true_type
- false_type
sourcepub fn alloc_ts_conditional_type(
self,
span: Span,
check_type: TSType<'a>,
extends_type: TSType<'a>,
true_type: TSType<'a>,
false_type: TSType<'a>,
) -> Box<'a, TSConditionalType<'a>>
pub fn alloc_ts_conditional_type( self, span: Span, check_type: TSType<'a>, extends_type: TSType<'a>, true_type: TSType<'a>, false_type: TSType<'a>, ) -> Box<'a, TSConditionalType<'a>>
Builds a TSConditionalType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_conditional_type
instead.
§Parameters
- span: The
Span
covering this node - check_type
- extends_type
- true_type
- false_type
sourcepub fn ts_union_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> TSUnionType<'a>
pub fn ts_union_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> TSUnionType<'a>
Builds a TSUnionType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_union_type
instead.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn alloc_ts_union_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> Box<'a, TSUnionType<'a>>
pub fn alloc_ts_union_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> Box<'a, TSUnionType<'a>>
Builds a TSUnionType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_union_type
instead.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn ts_intersection_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> TSIntersectionType<'a>
pub fn ts_intersection_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> TSIntersectionType<'a>
Builds a TSIntersectionType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_intersection_type
instead.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn alloc_ts_intersection_type(
self,
span: Span,
types: Vec<'a, TSType<'a>>,
) -> Box<'a, TSIntersectionType<'a>>
pub fn alloc_ts_intersection_type( self, span: Span, types: Vec<'a, TSType<'a>>, ) -> Box<'a, TSIntersectionType<'a>>
Builds a TSIntersectionType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_intersection_type
instead.
§Parameters
- span: The
Span
covering this node - types
sourcepub fn ts_parenthesized_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSParenthesizedType<'a>
pub fn ts_parenthesized_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSParenthesizedType<'a>
Builds a TSParenthesizedType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_parenthesized_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn alloc_ts_parenthesized_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> Box<'a, TSParenthesizedType<'a>>
pub fn alloc_ts_parenthesized_type( self, span: Span, type_annotation: TSType<'a>, ) -> Box<'a, TSParenthesizedType<'a>>
Builds a TSParenthesizedType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_parenthesized_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_type_operator(
self,
span: Span,
operator: TSTypeOperatorOperator,
type_annotation: TSType<'a>,
) -> TSTypeOperator<'a>
pub fn ts_type_operator( self, span: Span, operator: TSTypeOperatorOperator, type_annotation: TSType<'a>, ) -> TSTypeOperator<'a>
Builds a TSTypeOperator
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_operator
instead.
§Parameters
- span: The
Span
covering this node - operator
- type_annotation
sourcepub fn alloc_ts_type_operator(
self,
span: Span,
operator: TSTypeOperatorOperator,
type_annotation: TSType<'a>,
) -> Box<'a, TSTypeOperator<'a>>
pub fn alloc_ts_type_operator( self, span: Span, operator: TSTypeOperatorOperator, type_annotation: TSType<'a>, ) -> Box<'a, TSTypeOperator<'a>>
Builds a TSTypeOperator
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_operator
instead.
§Parameters
- span: The
Span
covering this node - operator
- type_annotation
sourcepub fn ts_array_type(
self,
span: Span,
element_type: TSType<'a>,
) -> TSArrayType<'a>
pub fn ts_array_type( self, span: Span, element_type: TSType<'a>, ) -> TSArrayType<'a>
Builds a TSArrayType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_array_type
instead.
§Parameters
- span: The
Span
covering this node - element_type
sourcepub fn alloc_ts_array_type(
self,
span: Span,
element_type: TSType<'a>,
) -> Box<'a, TSArrayType<'a>>
pub fn alloc_ts_array_type( self, span: Span, element_type: TSType<'a>, ) -> Box<'a, TSArrayType<'a>>
Builds a TSArrayType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_array_type
instead.
§Parameters
- span: The
Span
covering this node - element_type
sourcepub fn ts_indexed_access_type(
self,
span: Span,
object_type: TSType<'a>,
index_type: TSType<'a>,
) -> TSIndexedAccessType<'a>
pub fn ts_indexed_access_type( self, span: Span, object_type: TSType<'a>, index_type: TSType<'a>, ) -> TSIndexedAccessType<'a>
Builds a TSIndexedAccessType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_indexed_access_type
instead.
§Parameters
- span: The
Span
covering this node - object_type
- index_type
sourcepub fn alloc_ts_indexed_access_type(
self,
span: Span,
object_type: TSType<'a>,
index_type: TSType<'a>,
) -> Box<'a, TSIndexedAccessType<'a>>
pub fn alloc_ts_indexed_access_type( self, span: Span, object_type: TSType<'a>, index_type: TSType<'a>, ) -> Box<'a, TSIndexedAccessType<'a>>
Builds a TSIndexedAccessType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_indexed_access_type
instead.
§Parameters
- span: The
Span
covering this node - object_type
- index_type
sourcepub fn ts_tuple_type(
self,
span: Span,
element_types: Vec<'a, TSTupleElement<'a>>,
) -> TSTupleType<'a>
pub fn ts_tuple_type( self, span: Span, element_types: Vec<'a, TSTupleElement<'a>>, ) -> TSTupleType<'a>
Builds a TSTupleType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_tuple_type
instead.
§Parameters
- span: The
Span
covering this node - element_types
sourcepub fn alloc_ts_tuple_type(
self,
span: Span,
element_types: Vec<'a, TSTupleElement<'a>>,
) -> Box<'a, TSTupleType<'a>>
pub fn alloc_ts_tuple_type( self, span: Span, element_types: Vec<'a, TSTupleElement<'a>>, ) -> Box<'a, TSTupleType<'a>>
Builds a TSTupleType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_tuple_type
instead.
§Parameters
- span: The
Span
covering this node - element_types
sourcepub fn ts_named_tuple_member(
self,
span: Span,
element_type: TSTupleElement<'a>,
label: IdentifierName<'a>,
optional: bool,
) -> TSNamedTupleMember<'a>
pub fn ts_named_tuple_member( self, span: Span, element_type: TSTupleElement<'a>, label: IdentifierName<'a>, optional: bool, ) -> TSNamedTupleMember<'a>
Builds a TSNamedTupleMember
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_named_tuple_member
instead.
§Parameters
- span: The
Span
covering this node - element_type
- label
- optional
sourcepub fn alloc_ts_named_tuple_member(
self,
span: Span,
element_type: TSTupleElement<'a>,
label: IdentifierName<'a>,
optional: bool,
) -> Box<'a, TSNamedTupleMember<'a>>
pub fn alloc_ts_named_tuple_member( self, span: Span, element_type: TSTupleElement<'a>, label: IdentifierName<'a>, optional: bool, ) -> Box<'a, TSNamedTupleMember<'a>>
Builds a TSNamedTupleMember
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_named_tuple_member
instead.
§Parameters
- span: The
Span
covering this node - element_type
- label
- optional
sourcepub fn ts_optional_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSOptionalType<'a>
pub fn ts_optional_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSOptionalType<'a>
Builds a TSOptionalType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_optional_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn alloc_ts_optional_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> Box<'a, TSOptionalType<'a>>
pub fn alloc_ts_optional_type( self, span: Span, type_annotation: TSType<'a>, ) -> Box<'a, TSOptionalType<'a>>
Builds a TSOptionalType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_optional_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_rest_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSRestType<'a>
pub fn ts_rest_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSRestType<'a>
Builds a TSRestType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_rest_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn alloc_ts_rest_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> Box<'a, TSRestType<'a>>
pub fn alloc_ts_rest_type( self, span: Span, type_annotation: TSType<'a>, ) -> Box<'a, TSRestType<'a>>
Builds a TSRestType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_rest_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_tuple_element_optional_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSTupleElement<'a>
pub fn ts_tuple_element_optional_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSTupleElement<'a>
Build a TSTupleElement::TSOptionalType
This node contains a TSOptionalType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_tuple_element_from_ts_optional_type<T>(
self,
inner: T,
) -> TSTupleElement<'a>
pub fn ts_tuple_element_from_ts_optional_type<T>( self, inner: T, ) -> TSTupleElement<'a>
Convert a TSOptionalType
into a TSTupleElement::TSOptionalType
sourcepub fn ts_tuple_element_rest_type(
self,
span: Span,
type_annotation: TSType<'a>,
) -> TSTupleElement<'a>
pub fn ts_tuple_element_rest_type( self, span: Span, type_annotation: TSType<'a>, ) -> TSTupleElement<'a>
Build a TSTupleElement::TSRestType
This node contains a TSRestType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - type_annotation
sourcepub fn ts_tuple_element_from_ts_rest_type<T>(
self,
inner: T,
) -> TSTupleElement<'a>
pub fn ts_tuple_element_from_ts_rest_type<T>( self, inner: T, ) -> TSTupleElement<'a>
Convert a TSRestType
into a TSTupleElement::TSRestType
pub fn ts_tuple_element_type(self, inner: TSType<'a>) -> TSTupleElement<'a>
sourcepub fn ts_any_keyword(self, span: Span) -> TSAnyKeyword
pub fn ts_any_keyword(self, span: Span) -> TSAnyKeyword
Builds a TSAnyKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_any_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_any_keyword(self, span: Span) -> Box<'a, TSAnyKeyword>
pub fn alloc_ts_any_keyword(self, span: Span) -> Box<'a, TSAnyKeyword>
Builds a TSAnyKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_any_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_string_keyword(self, span: Span) -> TSStringKeyword
pub fn ts_string_keyword(self, span: Span) -> TSStringKeyword
Builds a TSStringKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_string_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_string_keyword(self, span: Span) -> Box<'a, TSStringKeyword>
pub fn alloc_ts_string_keyword(self, span: Span) -> Box<'a, TSStringKeyword>
Builds a TSStringKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_string_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_boolean_keyword(self, span: Span) -> TSBooleanKeyword
pub fn ts_boolean_keyword(self, span: Span) -> TSBooleanKeyword
Builds a TSBooleanKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_boolean_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_boolean_keyword(self, span: Span) -> Box<'a, TSBooleanKeyword>
pub fn alloc_ts_boolean_keyword(self, span: Span) -> Box<'a, TSBooleanKeyword>
Builds a TSBooleanKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_boolean_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_number_keyword(self, span: Span) -> TSNumberKeyword
pub fn ts_number_keyword(self, span: Span) -> TSNumberKeyword
Builds a TSNumberKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_number_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_number_keyword(self, span: Span) -> Box<'a, TSNumberKeyword>
pub fn alloc_ts_number_keyword(self, span: Span) -> Box<'a, TSNumberKeyword>
Builds a TSNumberKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_number_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_never_keyword(self, span: Span) -> TSNeverKeyword
pub fn ts_never_keyword(self, span: Span) -> TSNeverKeyword
Builds a TSNeverKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_never_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_never_keyword(self, span: Span) -> Box<'a, TSNeverKeyword>
pub fn alloc_ts_never_keyword(self, span: Span) -> Box<'a, TSNeverKeyword>
Builds a TSNeverKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_never_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_intrinsic_keyword(self, span: Span) -> TSIntrinsicKeyword
pub fn ts_intrinsic_keyword(self, span: Span) -> TSIntrinsicKeyword
Builds a TSIntrinsicKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_intrinsic_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_intrinsic_keyword(
self,
span: Span,
) -> Box<'a, TSIntrinsicKeyword>
pub fn alloc_ts_intrinsic_keyword( self, span: Span, ) -> Box<'a, TSIntrinsicKeyword>
Builds a TSIntrinsicKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_intrinsic_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_unknown_keyword(self, span: Span) -> TSUnknownKeyword
pub fn ts_unknown_keyword(self, span: Span) -> TSUnknownKeyword
Builds a TSUnknownKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_unknown_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_unknown_keyword(self, span: Span) -> Box<'a, TSUnknownKeyword>
pub fn alloc_ts_unknown_keyword(self, span: Span) -> Box<'a, TSUnknownKeyword>
Builds a TSUnknownKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_unknown_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_null_keyword(self, span: Span) -> TSNullKeyword
pub fn ts_null_keyword(self, span: Span) -> TSNullKeyword
Builds a TSNullKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_null_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_null_keyword(self, span: Span) -> Box<'a, TSNullKeyword>
pub fn alloc_ts_null_keyword(self, span: Span) -> Box<'a, TSNullKeyword>
Builds a TSNullKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_null_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_undefined_keyword(self, span: Span) -> TSUndefinedKeyword
pub fn ts_undefined_keyword(self, span: Span) -> TSUndefinedKeyword
Builds a TSUndefinedKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_undefined_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_undefined_keyword(
self,
span: Span,
) -> Box<'a, TSUndefinedKeyword>
pub fn alloc_ts_undefined_keyword( self, span: Span, ) -> Box<'a, TSUndefinedKeyword>
Builds a TSUndefinedKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_undefined_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_void_keyword(self, span: Span) -> TSVoidKeyword
pub fn ts_void_keyword(self, span: Span) -> TSVoidKeyword
Builds a TSVoidKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_void_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_void_keyword(self, span: Span) -> Box<'a, TSVoidKeyword>
pub fn alloc_ts_void_keyword(self, span: Span) -> Box<'a, TSVoidKeyword>
Builds a TSVoidKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_void_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_symbol_keyword(self, span: Span) -> TSSymbolKeyword
pub fn ts_symbol_keyword(self, span: Span) -> TSSymbolKeyword
Builds a TSSymbolKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_symbol_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_symbol_keyword(self, span: Span) -> Box<'a, TSSymbolKeyword>
pub fn alloc_ts_symbol_keyword(self, span: Span) -> Box<'a, TSSymbolKeyword>
Builds a TSSymbolKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_symbol_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_this_type(self, span: Span) -> TSThisType
pub fn ts_this_type(self, span: Span) -> TSThisType
Builds a TSThisType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_this_type
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_this_type(self, span: Span) -> Box<'a, TSThisType>
pub fn alloc_ts_this_type(self, span: Span) -> Box<'a, TSThisType>
Builds a TSThisType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_this_type
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_object_keyword(self, span: Span) -> TSObjectKeyword
pub fn ts_object_keyword(self, span: Span) -> TSObjectKeyword
Builds a TSObjectKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_object_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_object_keyword(self, span: Span) -> Box<'a, TSObjectKeyword>
pub fn alloc_ts_object_keyword(self, span: Span) -> Box<'a, TSObjectKeyword>
Builds a TSObjectKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_object_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_big_int_keyword(self, span: Span) -> TSBigIntKeyword
pub fn ts_big_int_keyword(self, span: Span) -> TSBigIntKeyword
Builds a TSBigIntKeyword
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_big_int_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_ts_big_int_keyword(self, span: Span) -> Box<'a, TSBigIntKeyword>
pub fn alloc_ts_big_int_keyword(self, span: Span) -> Box<'a, TSBigIntKeyword>
Builds a TSBigIntKeyword
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_big_int_keyword
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn ts_type_reference<T1>(
self,
span: Span,
type_name: TSTypeName<'a>,
type_parameters: T1,
) -> TSTypeReference<'a>
pub fn ts_type_reference<T1>( self, span: Span, type_name: TSTypeName<'a>, type_parameters: T1, ) -> TSTypeReference<'a>
Builds a TSTypeReference
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_reference
instead.
§Parameters
- span: The
Span
covering this node - type_name
- type_parameters
sourcepub fn alloc_ts_type_reference<T1>(
self,
span: Span,
type_name: TSTypeName<'a>,
type_parameters: T1,
) -> Box<'a, TSTypeReference<'a>>
pub fn alloc_ts_type_reference<T1>( self, span: Span, type_name: TSTypeName<'a>, type_parameters: T1, ) -> Box<'a, TSTypeReference<'a>>
Builds a TSTypeReference
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_reference
instead.
§Parameters
- span: The
Span
covering this node - type_name
- type_parameters
sourcepub fn ts_type_name_identifier_reference<A>(
self,
span: Span,
name: A,
) -> TSTypeName<'a>
pub fn ts_type_name_identifier_reference<A>( self, span: Span, name: A, ) -> TSTypeName<'a>
Build a TSTypeName::IdentifierReference
This node contains a IdentifierReference
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier being referenced.
sourcepub fn ts_type_name_from_identifier_reference<T>(
self,
inner: T,
) -> TSTypeName<'a>
pub fn ts_type_name_from_identifier_reference<T>( self, inner: T, ) -> TSTypeName<'a>
Convert a IdentifierReference
into a TSTypeName::IdentifierReference
sourcepub fn ts_type_name_qualified_name(
self,
span: Span,
left: TSTypeName<'a>,
right: IdentifierName<'a>,
) -> TSTypeName<'a>
pub fn ts_type_name_qualified_name( self, span: Span, left: TSTypeName<'a>, right: IdentifierName<'a>, ) -> TSTypeName<'a>
Build a TSTypeName::QualifiedName
This node contains a TSQualifiedName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn ts_type_name_from_ts_qualified_name<T>(self, inner: T) -> TSTypeName<'a>
pub fn ts_type_name_from_ts_qualified_name<T>(self, inner: T) -> TSTypeName<'a>
Convert a TSQualifiedName
into a TSTypeName::QualifiedName
sourcepub fn ts_qualified_name(
self,
span: Span,
left: TSTypeName<'a>,
right: IdentifierName<'a>,
) -> TSQualifiedName<'a>
pub fn ts_qualified_name( self, span: Span, left: TSTypeName<'a>, right: IdentifierName<'a>, ) -> TSQualifiedName<'a>
Builds a TSQualifiedName
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_qualified_name
instead.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn alloc_ts_qualified_name(
self,
span: Span,
left: TSTypeName<'a>,
right: IdentifierName<'a>,
) -> Box<'a, TSQualifiedName<'a>>
pub fn alloc_ts_qualified_name( self, span: Span, left: TSTypeName<'a>, right: IdentifierName<'a>, ) -> Box<'a, TSQualifiedName<'a>>
Builds a TSQualifiedName
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_qualified_name
instead.
§Parameters
- span: The
Span
covering this node - left
- right
sourcepub fn ts_type_parameter_instantiation(
self,
span: Span,
params: Vec<'a, TSType<'a>>,
) -> TSTypeParameterInstantiation<'a>
pub fn ts_type_parameter_instantiation( self, span: Span, params: Vec<'a, TSType<'a>>, ) -> TSTypeParameterInstantiation<'a>
Builds a TSTypeParameterInstantiation
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_parameter_instantiation
instead.
§Parameters
- span: The
Span
covering this node - params
sourcepub fn alloc_ts_type_parameter_instantiation(
self,
span: Span,
params: Vec<'a, TSType<'a>>,
) -> Box<'a, TSTypeParameterInstantiation<'a>>
pub fn alloc_ts_type_parameter_instantiation( self, span: Span, params: Vec<'a, TSType<'a>>, ) -> Box<'a, TSTypeParameterInstantiation<'a>>
Builds a TSTypeParameterInstantiation
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_parameter_instantiation
instead.
§Parameters
- span: The
Span
covering this node - params
sourcepub fn ts_type_parameter(
self,
span: Span,
name: BindingIdentifier<'a>,
constraint: Option<TSType<'a>>,
default: Option<TSType<'a>>,
in: bool,
out: bool,
const: bool,
) -> TSTypeParameter<'a>
pub fn ts_type_parameter( self, span: Span, name: BindingIdentifier<'a>, constraint: Option<TSType<'a>>, default: Option<TSType<'a>>, in: bool, out: bool, const: bool, ) -> TSTypeParameter<'a>
Builds a TSTypeParameter
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_parameter
instead.
§Parameters
- span: The
Span
covering this node - name
- constraint
- default
- r#in
- out
- r#const
sourcepub fn alloc_ts_type_parameter(
self,
span: Span,
name: BindingIdentifier<'a>,
constraint: Option<TSType<'a>>,
default: Option<TSType<'a>>,
in: bool,
out: bool,
const: bool,
) -> Box<'a, TSTypeParameter<'a>>
pub fn alloc_ts_type_parameter( self, span: Span, name: BindingIdentifier<'a>, constraint: Option<TSType<'a>>, default: Option<TSType<'a>>, in: bool, out: bool, const: bool, ) -> Box<'a, TSTypeParameter<'a>>
Builds a TSTypeParameter
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_parameter
instead.
§Parameters
- span: The
Span
covering this node - name
- constraint
- default
- r#in
- out
- r#const
sourcepub fn ts_type_parameter_declaration(
self,
span: Span,
params: Vec<'a, TSTypeParameter<'a>>,
) -> TSTypeParameterDeclaration<'a>
pub fn ts_type_parameter_declaration( self, span: Span, params: Vec<'a, TSTypeParameter<'a>>, ) -> TSTypeParameterDeclaration<'a>
Builds a TSTypeParameterDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_parameter_declaration
instead.
§Parameters
- span: The
Span
covering this node - params
sourcepub fn alloc_ts_type_parameter_declaration(
self,
span: Span,
params: Vec<'a, TSTypeParameter<'a>>,
) -> Box<'a, TSTypeParameterDeclaration<'a>>
pub fn alloc_ts_type_parameter_declaration( self, span: Span, params: Vec<'a, TSTypeParameter<'a>>, ) -> Box<'a, TSTypeParameterDeclaration<'a>>
Builds a TSTypeParameterDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_parameter_declaration
instead.
§Parameters
- span: The
Span
covering this node - params
sourcepub fn ts_type_alias_declaration<T1>(
self,
span: Span,
id: BindingIdentifier<'a>,
type_parameters: T1,
type_annotation: TSType<'a>,
declare: bool,
) -> TSTypeAliasDeclaration<'a>
pub fn ts_type_alias_declaration<T1>( self, span: Span, id: BindingIdentifier<'a>, type_parameters: T1, type_annotation: TSType<'a>, declare: bool, ) -> TSTypeAliasDeclaration<'a>
Builds a TSTypeAliasDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_alias_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- type_parameters
- type_annotation
- declare
sourcepub fn alloc_ts_type_alias_declaration<T1>(
self,
span: Span,
id: BindingIdentifier<'a>,
type_parameters: T1,
type_annotation: TSType<'a>,
declare: bool,
) -> Box<'a, TSTypeAliasDeclaration<'a>>
pub fn alloc_ts_type_alias_declaration<T1>( self, span: Span, id: BindingIdentifier<'a>, type_parameters: T1, type_annotation: TSType<'a>, declare: bool, ) -> Box<'a, TSTypeAliasDeclaration<'a>>
Builds a TSTypeAliasDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_alias_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- type_parameters
- type_annotation
- declare
sourcepub fn ts_class_implements<T1>(
self,
span: Span,
expression: TSTypeName<'a>,
type_parameters: T1,
) -> TSClassImplements<'a>
pub fn ts_class_implements<T1>( self, span: Span, expression: TSTypeName<'a>, type_parameters: T1, ) -> TSClassImplements<'a>
Builds a TSClassImplements
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_class_implements
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn alloc_ts_class_implements<T1>(
self,
span: Span,
expression: TSTypeName<'a>,
type_parameters: T1,
) -> Box<'a, TSClassImplements<'a>>
pub fn alloc_ts_class_implements<T1>( self, span: Span, expression: TSTypeName<'a>, type_parameters: T1, ) -> Box<'a, TSClassImplements<'a>>
Builds a TSClassImplements
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_class_implements
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> TSInterfaceDeclaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
pub fn ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> TSInterfaceDeclaration<'a>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
Builds a TSInterfaceDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_interface_declaration
instead.
§Parameters
- span: The
Span
covering this node - id: The identifier (name) of the interface.
- extends
- type_parameters
- body
- declare
sourcepub fn alloc_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> Box<'a, TSInterfaceDeclaration<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
pub fn alloc_ts_interface_declaration<T1, T2>(
self,
span: Span,
id: BindingIdentifier<'a>,
extends: Option<Vec<'a, TSInterfaceHeritage<'a>>>,
type_parameters: T1,
body: T2,
declare: bool,
) -> Box<'a, TSInterfaceDeclaration<'a>>where
T1: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
T2: IntoIn<'a, Box<'a, TSInterfaceBody<'a>>>,
Builds a TSInterfaceDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_interface_declaration
instead.
§Parameters
- span: The
Span
covering this node - id: The identifier (name) of the interface.
- extends
- type_parameters
- body
- declare
sourcepub fn ts_interface_body(
self,
span: Span,
body: Vec<'a, TSSignature<'a>>,
) -> TSInterfaceBody<'a>
pub fn ts_interface_body( self, span: Span, body: Vec<'a, TSSignature<'a>>, ) -> TSInterfaceBody<'a>
Builds a TSInterfaceBody
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_interface_body
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn alloc_ts_interface_body(
self,
span: Span,
body: Vec<'a, TSSignature<'a>>,
) -> Box<'a, TSInterfaceBody<'a>>
pub fn alloc_ts_interface_body( self, span: Span, body: Vec<'a, TSSignature<'a>>, ) -> Box<'a, TSInterfaceBody<'a>>
Builds a TSInterfaceBody
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_interface_body
instead.
§Parameters
- span: The
Span
covering this node - body
sourcepub fn ts_property_signature<T1>(
self,
span: Span,
computed: bool,
optional: bool,
readonly: bool,
key: PropertyKey<'a>,
type_annotation: T1,
) -> TSPropertySignature<'a>
pub fn ts_property_signature<T1>( self, span: Span, computed: bool, optional: bool, readonly: bool, key: PropertyKey<'a>, type_annotation: T1, ) -> TSPropertySignature<'a>
Builds a TSPropertySignature
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_property_signature
instead.
§Parameters
- span: The
Span
covering this node - computed
- optional
- readonly
- key
- type_annotation
sourcepub fn alloc_ts_property_signature<T1>(
self,
span: Span,
computed: bool,
optional: bool,
readonly: bool,
key: PropertyKey<'a>,
type_annotation: T1,
) -> Box<'a, TSPropertySignature<'a>>
pub fn alloc_ts_property_signature<T1>( self, span: Span, computed: bool, optional: bool, readonly: bool, key: PropertyKey<'a>, type_annotation: T1, ) -> Box<'a, TSPropertySignature<'a>>
Builds a TSPropertySignature
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_property_signature
instead.
§Parameters
- span: The
Span
covering this node - computed
- optional
- readonly
- key
- type_annotation
sourcepub fn ts_signature_index_signature<T1>(
self,
span: Span,
parameters: Vec<'a, TSIndexSignatureName<'a>>,
type_annotation: T1,
readonly: bool,
) -> TSSignature<'a>
pub fn ts_signature_index_signature<T1>( self, span: Span, parameters: Vec<'a, TSIndexSignatureName<'a>>, type_annotation: T1, readonly: bool, ) -> TSSignature<'a>
Build a TSSignature::TSIndexSignature
This node contains a TSIndexSignature
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - parameters
- type_annotation
- readonly
sourcepub fn ts_signature_from_ts_index_signature<T>(
self,
inner: T,
) -> TSSignature<'a>
pub fn ts_signature_from_ts_index_signature<T>( self, inner: T, ) -> TSSignature<'a>
Convert a TSIndexSignature
into a TSSignature::TSIndexSignature
sourcepub fn ts_signature_property_signature<T1>(
self,
span: Span,
computed: bool,
optional: bool,
readonly: bool,
key: PropertyKey<'a>,
type_annotation: T1,
) -> TSSignature<'a>
pub fn ts_signature_property_signature<T1>( self, span: Span, computed: bool, optional: bool, readonly: bool, key: PropertyKey<'a>, type_annotation: T1, ) -> TSSignature<'a>
Build a TSSignature::TSPropertySignature
This node contains a TSPropertySignature
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - computed
- optional
- readonly
- key
- type_annotation
sourcepub fn ts_signature_from_ts_property_signature<T>(
self,
inner: T,
) -> TSSignature<'a>
pub fn ts_signature_from_ts_property_signature<T>( self, inner: T, ) -> TSSignature<'a>
Convert a TSPropertySignature
into a TSSignature::TSPropertySignature
sourcepub fn ts_signature_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_signature_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Build a TSSignature::TSCallSignatureDeclaration
This node contains a TSCallSignatureDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn ts_signature_from_ts_call_signature_declaration<T>(
self,
inner: T,
) -> TSSignature<'a>
pub fn ts_signature_from_ts_call_signature_declaration<T>( self, inner: T, ) -> TSSignature<'a>
Convert a TSCallSignatureDeclaration
into a TSSignature::TSCallSignatureDeclaration
sourcepub fn ts_signature_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_signature_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Build a TSSignature::TSConstructSignatureDeclaration
This node contains a TSConstructSignatureDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - params
- return_type
- type_parameters
sourcepub fn ts_signature_from_ts_construct_signature_declaration<T>(
self,
inner: T,
) -> TSSignature<'a>
pub fn ts_signature_from_ts_construct_signature_declaration<T>( self, inner: T, ) -> TSSignature<'a>
sourcepub fn ts_signature_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_signature_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Build a TSSignature::TSMethodSignature
This node contains a TSMethodSignature
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - key
- computed
- optional
- kind
- this_param
- params
- return_type
- type_parameters
sourcepub fn ts_signature_from_ts_method_signature<T>(
self,
inner: T,
) -> TSSignature<'a>
pub fn ts_signature_from_ts_method_signature<T>( self, inner: T, ) -> TSSignature<'a>
Convert a TSMethodSignature
into a TSSignature::TSMethodSignature
sourcepub fn ts_index_signature<T1>(
self,
span: Span,
parameters: Vec<'a, TSIndexSignatureName<'a>>,
type_annotation: T1,
readonly: bool,
) -> TSIndexSignature<'a>
pub fn ts_index_signature<T1>( self, span: Span, parameters: Vec<'a, TSIndexSignatureName<'a>>, type_annotation: T1, readonly: bool, ) -> TSIndexSignature<'a>
Builds a TSIndexSignature
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_index_signature
instead.
§Parameters
- span: The
Span
covering this node - parameters
- type_annotation
- readonly
sourcepub fn alloc_ts_index_signature<T1>(
self,
span: Span,
parameters: Vec<'a, TSIndexSignatureName<'a>>,
type_annotation: T1,
readonly: bool,
) -> Box<'a, TSIndexSignature<'a>>
pub fn alloc_ts_index_signature<T1>( self, span: Span, parameters: Vec<'a, TSIndexSignatureName<'a>>, type_annotation: T1, readonly: bool, ) -> Box<'a, TSIndexSignature<'a>>
Builds a TSIndexSignature
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_index_signature
instead.
§Parameters
- span: The
Span
covering this node - parameters
- type_annotation
- readonly
sourcepub fn ts_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSCallSignatureDeclaration<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSCallSignatureDeclaration<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSCallSignatureDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_call_signature_declaration
instead.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn alloc_ts_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSCallSignatureDeclaration<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn alloc_ts_call_signature_declaration<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSCallSignatureDeclaration<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSCallSignatureDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_call_signature_declaration
instead.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn ts_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSMethodSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSMethodSignature<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSMethodSignature
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_method_signature
instead.
§Parameters
- span: The
Span
covering this node - key
- computed
- optional
- kind
- this_param
- params
- return_type
- type_parameters
sourcepub fn alloc_ts_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSMethodSignature<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn alloc_ts_method_signature<T1, T2, T3>(
self,
span: Span,
key: PropertyKey<'a>,
computed: bool,
optional: bool,
kind: TSMethodSignatureKind,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSMethodSignature<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSMethodSignature
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_method_signature
instead.
§Parameters
- span: The
Span
covering this node - key
- computed
- optional
- kind
- this_param
- params
- return_type
- type_parameters
sourcepub fn ts_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSConstructSignatureDeclaration<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSConstructSignatureDeclaration<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSConstructSignatureDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_construct_signature_declaration
instead.
§Parameters
- span: The
Span
covering this node - params
- return_type
- type_parameters
sourcepub fn alloc_ts_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSConstructSignatureDeclaration<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn alloc_ts_construct_signature_declaration<T1, T2, T3>(
self,
span: Span,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSConstructSignatureDeclaration<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Option<Box<'a, TSTypeAnnotation<'a>>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSConstructSignatureDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_construct_signature_declaration
instead.
§Parameters
- span: The
Span
covering this node - params
- return_type
- type_parameters
sourcepub fn ts_index_signature_name<A, T1>(
self,
span: Span,
name: A,
type_annotation: T1,
) -> TSIndexSignatureName<'a>
pub fn ts_index_signature_name<A, T1>( self, span: Span, name: A, type_annotation: T1, ) -> TSIndexSignatureName<'a>
Builds a TSIndexSignatureName
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_index_signature_name
instead.
§Parameters
- span: The
Span
covering this node - name
- type_annotation
sourcepub fn alloc_ts_index_signature_name<A, T1>(
self,
span: Span,
name: A,
type_annotation: T1,
) -> Box<'a, TSIndexSignatureName<'a>>
pub fn alloc_ts_index_signature_name<A, T1>( self, span: Span, name: A, type_annotation: T1, ) -> Box<'a, TSIndexSignatureName<'a>>
Builds a TSIndexSignatureName
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_index_signature_name
instead.
§Parameters
- span: The
Span
covering this node - name
- type_annotation
sourcepub fn ts_interface_heritage<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> TSInterfaceHeritage<'a>
pub fn ts_interface_heritage<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> TSInterfaceHeritage<'a>
Builds a TSInterfaceHeritage
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_interface_heritage
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn alloc_ts_interface_heritage<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> Box<'a, TSInterfaceHeritage<'a>>
pub fn alloc_ts_interface_heritage<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> Box<'a, TSInterfaceHeritage<'a>>
Builds a TSInterfaceHeritage
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_interface_heritage
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn ts_type_predicate<T1>(
self,
span: Span,
parameter_name: TSTypePredicateName<'a>,
asserts: bool,
type_annotation: T1,
) -> TSTypePredicate<'a>
pub fn ts_type_predicate<T1>( self, span: Span, parameter_name: TSTypePredicateName<'a>, asserts: bool, type_annotation: T1, ) -> TSTypePredicate<'a>
Builds a TSTypePredicate
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_predicate
instead.
§Parameters
- span: The
Span
covering this node - parameter_name
- asserts
- type_annotation
sourcepub fn alloc_ts_type_predicate<T1>(
self,
span: Span,
parameter_name: TSTypePredicateName<'a>,
asserts: bool,
type_annotation: T1,
) -> Box<'a, TSTypePredicate<'a>>
pub fn alloc_ts_type_predicate<T1>( self, span: Span, parameter_name: TSTypePredicateName<'a>, asserts: bool, type_annotation: T1, ) -> Box<'a, TSTypePredicate<'a>>
Builds a TSTypePredicate
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_predicate
instead.
§Parameters
- span: The
Span
covering this node - parameter_name
- asserts
- type_annotation
sourcepub fn ts_type_predicate_name_identifier_name<A>(
self,
span: Span,
name: A,
) -> TSTypePredicateName<'a>
pub fn ts_type_predicate_name_identifier_name<A>( self, span: Span, name: A, ) -> TSTypePredicateName<'a>
Build a TSTypePredicateName::Identifier
This node contains a IdentifierName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn ts_type_predicate_name_from_identifier_name<T>(
self,
inner: T,
) -> TSTypePredicateName<'a>
pub fn ts_type_predicate_name_from_identifier_name<T>( self, inner: T, ) -> TSTypePredicateName<'a>
Convert a IdentifierName
into a TSTypePredicateName::Identifier
sourcepub fn ts_type_predicate_name_this_type(
self,
span: Span,
) -> TSTypePredicateName<'a>
pub fn ts_type_predicate_name_this_type( self, span: Span, ) -> TSTypePredicateName<'a>
sourcepub fn ts_type_predicate_name_from_ts_this_type<T>(
self,
inner: T,
) -> TSTypePredicateName<'a>where
T: IntoIn<'a, TSThisType>,
pub fn ts_type_predicate_name_from_ts_this_type<T>(
self,
inner: T,
) -> TSTypePredicateName<'a>where
T: IntoIn<'a, TSThisType>,
Convert a TSThisType
into a TSTypePredicateName::This
sourcepub fn ts_module_declaration(
self,
span: Span,
id: TSModuleDeclarationName<'a>,
body: Option<TSModuleDeclarationBody<'a>>,
kind: TSModuleDeclarationKind,
declare: bool,
) -> TSModuleDeclaration<'a>
pub fn ts_module_declaration( self, span: Span, id: TSModuleDeclarationName<'a>, body: Option<TSModuleDeclarationBody<'a>>, kind: TSModuleDeclarationKind, declare: bool, ) -> TSModuleDeclaration<'a>
Builds a TSModuleDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_module_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- body
- kind: The keyword used to define this module declaration
- declare
sourcepub fn alloc_ts_module_declaration(
self,
span: Span,
id: TSModuleDeclarationName<'a>,
body: Option<TSModuleDeclarationBody<'a>>,
kind: TSModuleDeclarationKind,
declare: bool,
) -> Box<'a, TSModuleDeclaration<'a>>
pub fn alloc_ts_module_declaration( self, span: Span, id: TSModuleDeclarationName<'a>, body: Option<TSModuleDeclarationBody<'a>>, kind: TSModuleDeclarationKind, declare: bool, ) -> Box<'a, TSModuleDeclaration<'a>>
Builds a TSModuleDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_module_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- body
- kind: The keyword used to define this module declaration
- declare
sourcepub fn ts_module_declaration_name_identifier_name<A>(
self,
span: Span,
name: A,
) -> TSModuleDeclarationName<'a>
pub fn ts_module_declaration_name_identifier_name<A>( self, span: Span, name: A, ) -> TSModuleDeclarationName<'a>
sourcepub fn ts_module_declaration_name_from_identifier_name<T>(
self,
inner: T,
) -> TSModuleDeclarationName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
pub fn ts_module_declaration_name_from_identifier_name<T>(
self,
inner: T,
) -> TSModuleDeclarationName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
Convert a IdentifierName
into a TSModuleDeclarationName::Identifier
sourcepub fn ts_module_declaration_name_string_literal<A>(
self,
span: Span,
value: A,
) -> TSModuleDeclarationName<'a>
pub fn ts_module_declaration_name_string_literal<A>( self, span: Span, value: A, ) -> TSModuleDeclarationName<'a>
sourcepub fn ts_module_declaration_name_from_string_literal<T>(
self,
inner: T,
) -> TSModuleDeclarationName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
pub fn ts_module_declaration_name_from_string_literal<T>(
self,
inner: T,
) -> TSModuleDeclarationName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
Convert a StringLiteral
into a TSModuleDeclarationName::StringLiteral
sourcepub fn ts_module_declaration_body_module_declaration(
self,
span: Span,
id: TSModuleDeclarationName<'a>,
body: Option<TSModuleDeclarationBody<'a>>,
kind: TSModuleDeclarationKind,
declare: bool,
) -> TSModuleDeclarationBody<'a>
pub fn ts_module_declaration_body_module_declaration( self, span: Span, id: TSModuleDeclarationName<'a>, body: Option<TSModuleDeclarationBody<'a>>, kind: TSModuleDeclarationKind, declare: bool, ) -> TSModuleDeclarationBody<'a>
Build a TSModuleDeclarationBody::TSModuleDeclaration
This node contains a TSModuleDeclaration
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - id
- body
- kind: The keyword used to define this module declaration
- declare
sourcepub fn ts_module_declaration_body_from_ts_module_declaration<T>(
self,
inner: T,
) -> TSModuleDeclarationBody<'a>
pub fn ts_module_declaration_body_from_ts_module_declaration<T>( self, inner: T, ) -> TSModuleDeclarationBody<'a>
Convert a TSModuleDeclaration
into a TSModuleDeclarationBody::TSModuleDeclaration
sourcepub fn ts_module_declaration_body_module_block(
self,
span: Span,
directives: Vec<'a, Directive<'a>>,
body: Vec<'a, Statement<'a>>,
) -> TSModuleDeclarationBody<'a>
pub fn ts_module_declaration_body_module_block( self, span: Span, directives: Vec<'a, Directive<'a>>, body: Vec<'a, Statement<'a>>, ) -> TSModuleDeclarationBody<'a>
Build a TSModuleDeclarationBody::TSModuleBlock
This node contains a TSModuleBlock
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - directives
- body
sourcepub fn ts_module_declaration_body_from_ts_module_block<T>(
self,
inner: T,
) -> TSModuleDeclarationBody<'a>
pub fn ts_module_declaration_body_from_ts_module_block<T>( self, inner: T, ) -> TSModuleDeclarationBody<'a>
Convert a TSModuleBlock
into a TSModuleDeclarationBody::TSModuleBlock
sourcepub fn ts_module_block(
self,
span: Span,
directives: Vec<'a, Directive<'a>>,
body: Vec<'a, Statement<'a>>,
) -> TSModuleBlock<'a>
pub fn ts_module_block( self, span: Span, directives: Vec<'a, Directive<'a>>, body: Vec<'a, Statement<'a>>, ) -> TSModuleBlock<'a>
Builds a TSModuleBlock
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_module_block
instead.
§Parameters
- span: The
Span
covering this node - directives
- body
sourcepub fn alloc_ts_module_block(
self,
span: Span,
directives: Vec<'a, Directive<'a>>,
body: Vec<'a, Statement<'a>>,
) -> Box<'a, TSModuleBlock<'a>>
pub fn alloc_ts_module_block( self, span: Span, directives: Vec<'a, Directive<'a>>, body: Vec<'a, Statement<'a>>, ) -> Box<'a, TSModuleBlock<'a>>
Builds a TSModuleBlock
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_module_block
instead.
§Parameters
- span: The
Span
covering this node - directives
- body
sourcepub fn ts_type_literal(
self,
span: Span,
members: Vec<'a, TSSignature<'a>>,
) -> TSTypeLiteral<'a>
pub fn ts_type_literal( self, span: Span, members: Vec<'a, TSSignature<'a>>, ) -> TSTypeLiteral<'a>
Builds a TSTypeLiteral
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_literal
instead.
§Parameters
- span: The
Span
covering this node - members
sourcepub fn alloc_ts_type_literal(
self,
span: Span,
members: Vec<'a, TSSignature<'a>>,
) -> Box<'a, TSTypeLiteral<'a>>
pub fn alloc_ts_type_literal( self, span: Span, members: Vec<'a, TSSignature<'a>>, ) -> Box<'a, TSTypeLiteral<'a>>
Builds a TSTypeLiteral
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_literal
instead.
§Parameters
- span: The
Span
covering this node - members
sourcepub fn ts_infer_type<T1>(
self,
span: Span,
type_parameter: T1,
) -> TSInferType<'a>
pub fn ts_infer_type<T1>( self, span: Span, type_parameter: T1, ) -> TSInferType<'a>
Builds a TSInferType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_infer_type
instead.
§Parameters
- span: The
Span
covering this node - type_parameter
sourcepub fn alloc_ts_infer_type<T1>(
self,
span: Span,
type_parameter: T1,
) -> Box<'a, TSInferType<'a>>
pub fn alloc_ts_infer_type<T1>( self, span: Span, type_parameter: T1, ) -> Box<'a, TSInferType<'a>>
Builds a TSInferType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_infer_type
instead.
§Parameters
- span: The
Span
covering this node - type_parameter
sourcepub fn ts_type_query<T1>(
self,
span: Span,
expr_name: TSTypeQueryExprName<'a>,
type_parameters: T1,
) -> TSTypeQuery<'a>
pub fn ts_type_query<T1>( self, span: Span, expr_name: TSTypeQueryExprName<'a>, type_parameters: T1, ) -> TSTypeQuery<'a>
Builds a TSTypeQuery
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_query
instead.
§Parameters
- span: The
Span
covering this node - expr_name
- type_parameters
sourcepub fn alloc_ts_type_query<T1>(
self,
span: Span,
expr_name: TSTypeQueryExprName<'a>,
type_parameters: T1,
) -> Box<'a, TSTypeQuery<'a>>
pub fn alloc_ts_type_query<T1>( self, span: Span, expr_name: TSTypeQueryExprName<'a>, type_parameters: T1, ) -> Box<'a, TSTypeQuery<'a>>
Builds a TSTypeQuery
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_query
instead.
§Parameters
- span: The
Span
covering this node - expr_name
- type_parameters
sourcepub fn ts_type_query_expr_name_import_type<T1>(
self,
span: Span,
is_type_of: bool,
parameter: TSType<'a>,
qualifier: Option<TSTypeName<'a>>,
attributes: Option<TSImportAttributes<'a>>,
type_parameters: T1,
) -> TSTypeQueryExprName<'a>
pub fn ts_type_query_expr_name_import_type<T1>( self, span: Span, is_type_of: bool, parameter: TSType<'a>, qualifier: Option<TSTypeName<'a>>, attributes: Option<TSImportAttributes<'a>>, type_parameters: T1, ) -> TSTypeQueryExprName<'a>
Build a TSTypeQueryExprName::TSImportType
This node contains a TSImportType
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - is_type_of
- parameter
- qualifier
- attributes
- type_parameters
sourcepub fn ts_type_query_expr_name_from_ts_import_type<T>(
self,
inner: T,
) -> TSTypeQueryExprName<'a>
pub fn ts_type_query_expr_name_from_ts_import_type<T>( self, inner: T, ) -> TSTypeQueryExprName<'a>
Convert a TSImportType
into a TSTypeQueryExprName::TSImportType
pub fn ts_type_query_expr_name_type_name( self, inner: TSTypeName<'a>, ) -> TSTypeQueryExprName<'a>
sourcepub fn ts_import_type<T1>(
self,
span: Span,
is_type_of: bool,
parameter: TSType<'a>,
qualifier: Option<TSTypeName<'a>>,
attributes: Option<TSImportAttributes<'a>>,
type_parameters: T1,
) -> TSImportType<'a>
pub fn ts_import_type<T1>( self, span: Span, is_type_of: bool, parameter: TSType<'a>, qualifier: Option<TSTypeName<'a>>, attributes: Option<TSImportAttributes<'a>>, type_parameters: T1, ) -> TSImportType<'a>
Builds a TSImportType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_import_type
instead.
§Parameters
- span: The
Span
covering this node - is_type_of
- parameter
- qualifier
- attributes
- type_parameters
sourcepub fn alloc_ts_import_type<T1>(
self,
span: Span,
is_type_of: bool,
parameter: TSType<'a>,
qualifier: Option<TSTypeName<'a>>,
attributes: Option<TSImportAttributes<'a>>,
type_parameters: T1,
) -> Box<'a, TSImportType<'a>>
pub fn alloc_ts_import_type<T1>( self, span: Span, is_type_of: bool, parameter: TSType<'a>, qualifier: Option<TSTypeName<'a>>, attributes: Option<TSImportAttributes<'a>>, type_parameters: T1, ) -> Box<'a, TSImportType<'a>>
Builds a TSImportType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_import_type
instead.
§Parameters
- span: The
Span
covering this node - is_type_of
- parameter
- qualifier
- attributes
- type_parameters
sourcepub fn ts_import_attributes(
self,
span: Span,
attributes_keyword: IdentifierName<'a>,
elements: Vec<'a, TSImportAttribute<'a>>,
) -> TSImportAttributes<'a>
pub fn ts_import_attributes( self, span: Span, attributes_keyword: IdentifierName<'a>, elements: Vec<'a, TSImportAttribute<'a>>, ) -> TSImportAttributes<'a>
Builds a TSImportAttributes
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_import_attributes
instead.
§Parameters
- span: The
Span
covering this node - attributes_keyword
- elements
sourcepub fn alloc_ts_import_attributes(
self,
span: Span,
attributes_keyword: IdentifierName<'a>,
elements: Vec<'a, TSImportAttribute<'a>>,
) -> Box<'a, TSImportAttributes<'a>>
pub fn alloc_ts_import_attributes( self, span: Span, attributes_keyword: IdentifierName<'a>, elements: Vec<'a, TSImportAttribute<'a>>, ) -> Box<'a, TSImportAttributes<'a>>
Builds a TSImportAttributes
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_import_attributes
instead.
§Parameters
- span: The
Span
covering this node - attributes_keyword
- elements
sourcepub fn ts_import_attribute(
self,
span: Span,
name: TSImportAttributeName<'a>,
value: Expression<'a>,
) -> TSImportAttribute<'a>
pub fn ts_import_attribute( self, span: Span, name: TSImportAttributeName<'a>, value: Expression<'a>, ) -> TSImportAttribute<'a>
Builds a TSImportAttribute
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_import_attribute
instead.
§Parameters
- span: The
Span
covering this node - name
- value
sourcepub fn alloc_ts_import_attribute(
self,
span: Span,
name: TSImportAttributeName<'a>,
value: Expression<'a>,
) -> Box<'a, TSImportAttribute<'a>>
pub fn alloc_ts_import_attribute( self, span: Span, name: TSImportAttributeName<'a>, value: Expression<'a>, ) -> Box<'a, TSImportAttribute<'a>>
Builds a TSImportAttribute
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_import_attribute
instead.
§Parameters
- span: The
Span
covering this node - name
- value
sourcepub fn ts_import_attribute_name_identifier_name<A>(
self,
span: Span,
name: A,
) -> TSImportAttributeName<'a>
pub fn ts_import_attribute_name_identifier_name<A>( self, span: Span, name: A, ) -> TSImportAttributeName<'a>
sourcepub fn ts_import_attribute_name_from_identifier_name<T>(
self,
inner: T,
) -> TSImportAttributeName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
pub fn ts_import_attribute_name_from_identifier_name<T>(
self,
inner: T,
) -> TSImportAttributeName<'a>where
T: IntoIn<'a, IdentifierName<'a>>,
Convert a IdentifierName
into a TSImportAttributeName::Identifier
sourcepub fn ts_import_attribute_name_string_literal<A>(
self,
span: Span,
value: A,
) -> TSImportAttributeName<'a>
pub fn ts_import_attribute_name_string_literal<A>( self, span: Span, value: A, ) -> TSImportAttributeName<'a>
sourcepub fn ts_import_attribute_name_from_string_literal<T>(
self,
inner: T,
) -> TSImportAttributeName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
pub fn ts_import_attribute_name_from_string_literal<T>(
self,
inner: T,
) -> TSImportAttributeName<'a>where
T: IntoIn<'a, StringLiteral<'a>>,
Convert a StringLiteral
into a TSImportAttributeName::StringLiteral
sourcepub fn ts_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSFunctionType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSFunctionType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSFunctionType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_function_type
instead.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn alloc_ts_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSFunctionType<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn alloc_ts_function_type<T1, T2, T3>(
self,
span: Span,
this_param: Option<TSThisParameter<'a>>,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSFunctionType<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSFunctionType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_function_type
instead.
§Parameters
- span: The
Span
covering this node - this_param
- params
- return_type
- type_parameters
sourcepub fn ts_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSConstructorType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn ts_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> TSConstructorType<'a>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSConstructorType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_constructor_type
instead.
§Parameters
- span: The
Span
covering this node - r#abstract
- params
- return_type
- type_parameters
sourcepub fn alloc_ts_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSConstructorType<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
pub fn alloc_ts_constructor_type<T1, T2, T3>(
self,
span: Span,
abstract: bool,
params: T1,
return_type: T2,
type_parameters: T3,
) -> Box<'a, TSConstructorType<'a>>where
T1: IntoIn<'a, Box<'a, FormalParameters<'a>>>,
T2: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
T3: IntoIn<'a, Option<Box<'a, TSTypeParameterDeclaration<'a>>>>,
Builds a TSConstructorType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_constructor_type
instead.
§Parameters
- span: The
Span
covering this node - r#abstract
- params
- return_type
- type_parameters
sourcepub fn ts_mapped_type<T1>(
self,
span: Span,
type_parameter: T1,
name_type: Option<TSType<'a>>,
type_annotation: Option<TSType<'a>>,
optional: TSMappedTypeModifierOperator,
readonly: TSMappedTypeModifierOperator,
) -> TSMappedType<'a>
pub fn ts_mapped_type<T1>( self, span: Span, type_parameter: T1, name_type: Option<TSType<'a>>, type_annotation: Option<TSType<'a>>, optional: TSMappedTypeModifierOperator, readonly: TSMappedTypeModifierOperator, ) -> TSMappedType<'a>
Builds a TSMappedType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_mapped_type
instead.
§Parameters
- span: The
Span
covering this node - type_parameter
- name_type
- type_annotation
- optional
- readonly
sourcepub fn alloc_ts_mapped_type<T1>(
self,
span: Span,
type_parameter: T1,
name_type: Option<TSType<'a>>,
type_annotation: Option<TSType<'a>>,
optional: TSMappedTypeModifierOperator,
readonly: TSMappedTypeModifierOperator,
) -> Box<'a, TSMappedType<'a>>
pub fn alloc_ts_mapped_type<T1>( self, span: Span, type_parameter: T1, name_type: Option<TSType<'a>>, type_annotation: Option<TSType<'a>>, optional: TSMappedTypeModifierOperator, readonly: TSMappedTypeModifierOperator, ) -> Box<'a, TSMappedType<'a>>
Builds a TSMappedType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_mapped_type
instead.
§Parameters
- span: The
Span
covering this node - type_parameter
- name_type
- type_annotation
- optional
- readonly
sourcepub fn ts_template_literal_type(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
types: Vec<'a, TSType<'a>>,
) -> TSTemplateLiteralType<'a>
pub fn ts_template_literal_type( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, types: Vec<'a, TSType<'a>>, ) -> TSTemplateLiteralType<'a>
Builds a TSTemplateLiteralType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_template_literal_type
instead.
§Parameters
- span: The
Span
covering this node - quasis
- types
sourcepub fn alloc_ts_template_literal_type(
self,
span: Span,
quasis: Vec<'a, TemplateElement<'a>>,
types: Vec<'a, TSType<'a>>,
) -> Box<'a, TSTemplateLiteralType<'a>>
pub fn alloc_ts_template_literal_type( self, span: Span, quasis: Vec<'a, TemplateElement<'a>>, types: Vec<'a, TSType<'a>>, ) -> Box<'a, TSTemplateLiteralType<'a>>
Builds a TSTemplateLiteralType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_template_literal_type
instead.
§Parameters
- span: The
Span
covering this node - quasis
- types
sourcepub fn ts_as_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> TSAsExpression<'a>
pub fn ts_as_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> TSAsExpression<'a>
Builds a TSAsExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_as_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn alloc_ts_as_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Box<'a, TSAsExpression<'a>>
pub fn alloc_ts_as_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Box<'a, TSAsExpression<'a>>
Builds a TSAsExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_as_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn ts_satisfies_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> TSSatisfiesExpression<'a>
pub fn ts_satisfies_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> TSSatisfiesExpression<'a>
Builds a TSSatisfiesExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_satisfies_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn alloc_ts_satisfies_expression(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Box<'a, TSSatisfiesExpression<'a>>
pub fn alloc_ts_satisfies_expression( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Box<'a, TSSatisfiesExpression<'a>>
Builds a TSSatisfiesExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_satisfies_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn ts_type_assertion(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> TSTypeAssertion<'a>
pub fn ts_type_assertion( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> TSTypeAssertion<'a>
Builds a TSTypeAssertion
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_type_assertion
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn alloc_ts_type_assertion(
self,
span: Span,
expression: Expression<'a>,
type_annotation: TSType<'a>,
) -> Box<'a, TSTypeAssertion<'a>>
pub fn alloc_ts_type_assertion( self, span: Span, expression: Expression<'a>, type_annotation: TSType<'a>, ) -> Box<'a, TSTypeAssertion<'a>>
Builds a TSTypeAssertion
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_type_assertion
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_annotation
sourcepub fn ts_import_equals_declaration(
self,
span: Span,
id: BindingIdentifier<'a>,
module_reference: TSModuleReference<'a>,
import_kind: ImportOrExportKind,
) -> TSImportEqualsDeclaration<'a>
pub fn ts_import_equals_declaration( self, span: Span, id: BindingIdentifier<'a>, module_reference: TSModuleReference<'a>, import_kind: ImportOrExportKind, ) -> TSImportEqualsDeclaration<'a>
Builds a TSImportEqualsDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_import_equals_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- module_reference
- import_kind
sourcepub fn alloc_ts_import_equals_declaration(
self,
span: Span,
id: BindingIdentifier<'a>,
module_reference: TSModuleReference<'a>,
import_kind: ImportOrExportKind,
) -> Box<'a, TSImportEqualsDeclaration<'a>>
pub fn alloc_ts_import_equals_declaration( self, span: Span, id: BindingIdentifier<'a>, module_reference: TSModuleReference<'a>, import_kind: ImportOrExportKind, ) -> Box<'a, TSImportEqualsDeclaration<'a>>
Builds a TSImportEqualsDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_import_equals_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
- module_reference
- import_kind
sourcepub fn ts_module_reference_external_module_reference(
self,
span: Span,
expression: StringLiteral<'a>,
) -> TSModuleReference<'a>
pub fn ts_module_reference_external_module_reference( self, span: Span, expression: StringLiteral<'a>, ) -> TSModuleReference<'a>
Build a TSModuleReference::ExternalModuleReference
This node contains a TSExternalModuleReference
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn ts_module_reference_from_ts_external_module_reference<T>(
self,
inner: T,
) -> TSModuleReference<'a>
pub fn ts_module_reference_from_ts_external_module_reference<T>( self, inner: T, ) -> TSModuleReference<'a>
Convert a TSExternalModuleReference
into a TSModuleReference::ExternalModuleReference
pub fn ts_module_reference_type_name( self, inner: TSTypeName<'a>, ) -> TSModuleReference<'a>
sourcepub fn ts_external_module_reference(
self,
span: Span,
expression: StringLiteral<'a>,
) -> TSExternalModuleReference<'a>
pub fn ts_external_module_reference( self, span: Span, expression: StringLiteral<'a>, ) -> TSExternalModuleReference<'a>
Builds a TSExternalModuleReference
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_external_module_reference
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_ts_external_module_reference(
self,
span: Span,
expression: StringLiteral<'a>,
) -> Box<'a, TSExternalModuleReference<'a>>
pub fn alloc_ts_external_module_reference( self, span: Span, expression: StringLiteral<'a>, ) -> Box<'a, TSExternalModuleReference<'a>>
Builds a TSExternalModuleReference
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_external_module_reference
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn ts_non_null_expression(
self,
span: Span,
expression: Expression<'a>,
) -> TSNonNullExpression<'a>
pub fn ts_non_null_expression( self, span: Span, expression: Expression<'a>, ) -> TSNonNullExpression<'a>
Builds a TSNonNullExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_non_null_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_ts_non_null_expression(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, TSNonNullExpression<'a>>
pub fn alloc_ts_non_null_expression( self, span: Span, expression: Expression<'a>, ) -> Box<'a, TSNonNullExpression<'a>>
Builds a TSNonNullExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_non_null_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn decorator(self, span: Span, expression: Expression<'a>) -> Decorator<'a>
pub fn decorator(self, span: Span, expression: Expression<'a>) -> Decorator<'a>
Builds a Decorator
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_decorator
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_decorator(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, Decorator<'a>>
pub fn alloc_decorator( self, span: Span, expression: Expression<'a>, ) -> Box<'a, Decorator<'a>>
Builds a Decorator
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::decorator
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn ts_export_assignment(
self,
span: Span,
expression: Expression<'a>,
) -> TSExportAssignment<'a>
pub fn ts_export_assignment( self, span: Span, expression: Expression<'a>, ) -> TSExportAssignment<'a>
Builds a TSExportAssignment
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_export_assignment
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn alloc_ts_export_assignment(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, TSExportAssignment<'a>>
pub fn alloc_ts_export_assignment( self, span: Span, expression: Expression<'a>, ) -> Box<'a, TSExportAssignment<'a>>
Builds a TSExportAssignment
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_export_assignment
instead.
§Parameters
- span: The
Span
covering this node - expression
sourcepub fn ts_namespace_export_declaration(
self,
span: Span,
id: IdentifierName<'a>,
) -> TSNamespaceExportDeclaration<'a>
pub fn ts_namespace_export_declaration( self, span: Span, id: IdentifierName<'a>, ) -> TSNamespaceExportDeclaration<'a>
Builds a TSNamespaceExportDeclaration
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_namespace_export_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
sourcepub fn alloc_ts_namespace_export_declaration(
self,
span: Span,
id: IdentifierName<'a>,
) -> Box<'a, TSNamespaceExportDeclaration<'a>>
pub fn alloc_ts_namespace_export_declaration( self, span: Span, id: IdentifierName<'a>, ) -> Box<'a, TSNamespaceExportDeclaration<'a>>
Builds a TSNamespaceExportDeclaration
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_namespace_export_declaration
instead.
§Parameters
- span: The
Span
covering this node - id
sourcepub fn ts_instantiation_expression<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> TSInstantiationExpression<'a>
pub fn ts_instantiation_expression<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> TSInstantiationExpression<'a>
Builds a TSInstantiationExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_ts_instantiation_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn alloc_ts_instantiation_expression<T1>(
self,
span: Span,
expression: Expression<'a>,
type_parameters: T1,
) -> Box<'a, TSInstantiationExpression<'a>>
pub fn alloc_ts_instantiation_expression<T1>( self, span: Span, expression: Expression<'a>, type_parameters: T1, ) -> Box<'a, TSInstantiationExpression<'a>>
Builds a TSInstantiationExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::ts_instantiation_expression
instead.
§Parameters
- span: The
Span
covering this node - expression
- type_parameters
sourcepub fn js_doc_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> JSDocNullableType<'a>
pub fn js_doc_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> JSDocNullableType<'a>
Builds a JSDocNullableType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_js_doc_nullable_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix: Was
?
after the type annotation?
sourcepub fn alloc_js_doc_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> Box<'a, JSDocNullableType<'a>>
pub fn alloc_js_doc_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> Box<'a, JSDocNullableType<'a>>
Builds a JSDocNullableType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::js_doc_nullable_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix: Was
?
after the type annotation?
sourcepub fn js_doc_non_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> JSDocNonNullableType<'a>
pub fn js_doc_non_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> JSDocNonNullableType<'a>
Builds a JSDocNonNullableType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_js_doc_non_nullable_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix
sourcepub fn alloc_js_doc_non_nullable_type(
self,
span: Span,
type_annotation: TSType<'a>,
postfix: bool,
) -> Box<'a, JSDocNonNullableType<'a>>
pub fn alloc_js_doc_non_nullable_type( self, span: Span, type_annotation: TSType<'a>, postfix: bool, ) -> Box<'a, JSDocNonNullableType<'a>>
Builds a JSDocNonNullableType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::js_doc_non_nullable_type
instead.
§Parameters
- span: The
Span
covering this node - type_annotation
- postfix
sourcepub fn js_doc_unknown_type(self, span: Span) -> JSDocUnknownType
pub fn js_doc_unknown_type(self, span: Span) -> JSDocUnknownType
Builds a JSDocUnknownType
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_js_doc_unknown_type
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_js_doc_unknown_type(self, span: Span) -> Box<'a, JSDocUnknownType>
pub fn alloc_js_doc_unknown_type(self, span: Span) -> Box<'a, JSDocUnknownType>
Builds a JSDocUnknownType
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::js_doc_unknown_type
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXElement<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
pub fn jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXElement<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
Builds a JSXElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_element
instead.
§Parameters
sourcepub fn alloc_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> Box<'a, JSXElement<'a>>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
pub fn alloc_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> Box<'a, JSXElement<'a>>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
Builds a JSXElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_element
instead.
§Parameters
sourcepub fn jsx_opening_element<T1>(
self,
span: Span,
self_closing: bool,
name: JSXElementName<'a>,
attributes: Vec<'a, JSXAttributeItem<'a>>,
type_parameters: T1,
) -> JSXOpeningElement<'a>
pub fn jsx_opening_element<T1>( self, span: Span, self_closing: bool, name: JSXElementName<'a>, attributes: Vec<'a, JSXAttributeItem<'a>>, type_parameters: T1, ) -> JSXOpeningElement<'a>
Builds a JSXOpeningElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_opening_element
instead.
§Parameters
- span: The
Span
covering this node - self_closing: Is this tag self-closing?
- name
- attributes: List of JSX attributes. In React-like applications, these become props.
- type_parameters: Type parameters for generic JSX elements.
sourcepub fn alloc_jsx_opening_element<T1>(
self,
span: Span,
self_closing: bool,
name: JSXElementName<'a>,
attributes: Vec<'a, JSXAttributeItem<'a>>,
type_parameters: T1,
) -> Box<'a, JSXOpeningElement<'a>>
pub fn alloc_jsx_opening_element<T1>( self, span: Span, self_closing: bool, name: JSXElementName<'a>, attributes: Vec<'a, JSXAttributeItem<'a>>, type_parameters: T1, ) -> Box<'a, JSXOpeningElement<'a>>
Builds a JSXOpeningElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_opening_element
instead.
§Parameters
- span: The
Span
covering this node - self_closing: Is this tag self-closing?
- name
- attributes: List of JSX attributes. In React-like applications, these become props.
- type_parameters: Type parameters for generic JSX elements.
sourcepub fn jsx_closing_element(
self,
span: Span,
name: JSXElementName<'a>,
) -> JSXClosingElement<'a>
pub fn jsx_closing_element( self, span: Span, name: JSXElementName<'a>, ) -> JSXClosingElement<'a>
Builds a JSXClosingElement
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_closing_element
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn alloc_jsx_closing_element(
self,
span: Span,
name: JSXElementName<'a>,
) -> Box<'a, JSXClosingElement<'a>>
pub fn alloc_jsx_closing_element( self, span: Span, name: JSXElementName<'a>, ) -> Box<'a, JSXClosingElement<'a>>
Builds a JSXClosingElement
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_closing_element
instead.
§Parameters
- span: The
Span
covering this node - name
sourcepub fn jsx_fragment(
self,
span: Span,
opening_fragment: JSXOpeningFragment,
closing_fragment: JSXClosingFragment,
children: Vec<'a, JSXChild<'a>>,
) -> JSXFragment<'a>
pub fn jsx_fragment( self, span: Span, opening_fragment: JSXOpeningFragment, closing_fragment: JSXClosingFragment, children: Vec<'a, JSXChild<'a>>, ) -> JSXFragment<'a>
Builds a JSXFragment
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_fragment
instead.
§Parameters
- span: The
Span
covering this node - opening_fragment:
<>
- closing_fragment:
</>
- children: Elements inside the fragment.
sourcepub fn alloc_jsx_fragment(
self,
span: Span,
opening_fragment: JSXOpeningFragment,
closing_fragment: JSXClosingFragment,
children: Vec<'a, JSXChild<'a>>,
) -> Box<'a, JSXFragment<'a>>
pub fn alloc_jsx_fragment( self, span: Span, opening_fragment: JSXOpeningFragment, closing_fragment: JSXClosingFragment, children: Vec<'a, JSXChild<'a>>, ) -> Box<'a, JSXFragment<'a>>
Builds a JSXFragment
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_fragment
instead.
§Parameters
- span: The
Span
covering this node - opening_fragment:
<>
- closing_fragment:
</>
- children: Elements inside the fragment.
sourcepub fn jsx_element_name_jsx_identifier<A>(
self,
span: Span,
name: A,
) -> JSXElementName<'a>
pub fn jsx_element_name_jsx_identifier<A>( self, span: Span, name: A, ) -> JSXElementName<'a>
Build a JSXElementName::Identifier
This node contains a JSXIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier.
sourcepub fn jsx_element_name_from_jsx_identifier<T>(
self,
inner: T,
) -> JSXElementName<'a>
pub fn jsx_element_name_from_jsx_identifier<T>( self, inner: T, ) -> JSXElementName<'a>
Convert a JSXIdentifier
into a JSXElementName::Identifier
sourcepub fn jsx_element_name_jsx_namespaced_name(
self,
span: Span,
namespace: JSXIdentifier<'a>,
property: JSXIdentifier<'a>,
) -> JSXElementName<'a>
pub fn jsx_element_name_jsx_namespaced_name( self, span: Span, namespace: JSXIdentifier<'a>, property: JSXIdentifier<'a>, ) -> JSXElementName<'a>
Build a JSXElementName::NamespacedName
This node contains a JSXNamespacedName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - namespace: Namespace portion of the name, e.g.
Apple
in<Apple:Orange />
- property: Name portion of the name, e.g.
Orange
in<Apple:Orange />
sourcepub fn jsx_element_name_from_jsx_namespaced_name<T>(
self,
inner: T,
) -> JSXElementName<'a>
pub fn jsx_element_name_from_jsx_namespaced_name<T>( self, inner: T, ) -> JSXElementName<'a>
Convert a JSXNamespacedName
into a JSXElementName::NamespacedName
sourcepub fn jsx_element_name_jsx_member_expression(
self,
span: Span,
object: JSXMemberExpressionObject<'a>,
property: JSXIdentifier<'a>,
) -> JSXElementName<'a>
pub fn jsx_element_name_jsx_member_expression( self, span: Span, object: JSXMemberExpressionObject<'a>, property: JSXIdentifier<'a>, ) -> JSXElementName<'a>
Build a JSXElementName::MemberExpression
This node contains a JSXMemberExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object: The object being accessed. This is everything before the last
.
. - property: The property being accessed. This is everything after the last
.
.
sourcepub fn jsx_element_name_from_jsx_member_expression<T>(
self,
inner: T,
) -> JSXElementName<'a>
pub fn jsx_element_name_from_jsx_member_expression<T>( self, inner: T, ) -> JSXElementName<'a>
Convert a JSXMemberExpression
into a JSXElementName::MemberExpression
sourcepub fn jsx_namespaced_name(
self,
span: Span,
namespace: JSXIdentifier<'a>,
property: JSXIdentifier<'a>,
) -> JSXNamespacedName<'a>
pub fn jsx_namespaced_name( self, span: Span, namespace: JSXIdentifier<'a>, property: JSXIdentifier<'a>, ) -> JSXNamespacedName<'a>
Builds a JSXNamespacedName
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_namespaced_name
instead.
§Parameters
- span: The
Span
covering this node - namespace: Namespace portion of the name, e.g.
Apple
in<Apple:Orange />
- property: Name portion of the name, e.g.
Orange
in<Apple:Orange />
sourcepub fn alloc_jsx_namespaced_name(
self,
span: Span,
namespace: JSXIdentifier<'a>,
property: JSXIdentifier<'a>,
) -> Box<'a, JSXNamespacedName<'a>>
pub fn alloc_jsx_namespaced_name( self, span: Span, namespace: JSXIdentifier<'a>, property: JSXIdentifier<'a>, ) -> Box<'a, JSXNamespacedName<'a>>
Builds a JSXNamespacedName
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_namespaced_name
instead.
§Parameters
- span: The
Span
covering this node - namespace: Namespace portion of the name, e.g.
Apple
in<Apple:Orange />
- property: Name portion of the name, e.g.
Orange
in<Apple:Orange />
sourcepub fn jsx_member_expression(
self,
span: Span,
object: JSXMemberExpressionObject<'a>,
property: JSXIdentifier<'a>,
) -> JSXMemberExpression<'a>
pub fn jsx_member_expression( self, span: Span, object: JSXMemberExpressionObject<'a>, property: JSXIdentifier<'a>, ) -> JSXMemberExpression<'a>
Builds a JSXMemberExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object: The object being accessed. This is everything before the last
.
. - property: The property being accessed. This is everything after the last
.
.
sourcepub fn alloc_jsx_member_expression(
self,
span: Span,
object: JSXMemberExpressionObject<'a>,
property: JSXIdentifier<'a>,
) -> Box<'a, JSXMemberExpression<'a>>
pub fn alloc_jsx_member_expression( self, span: Span, object: JSXMemberExpressionObject<'a>, property: JSXIdentifier<'a>, ) -> Box<'a, JSXMemberExpression<'a>>
Builds a JSXMemberExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_member_expression
instead.
§Parameters
- span: The
Span
covering this node - object: The object being accessed. This is everything before the last
.
. - property: The property being accessed. This is everything after the last
.
.
sourcepub fn jsx_member_expression_object_jsx_identifier<A>(
self,
span: Span,
name: A,
) -> JSXMemberExpressionObject<'a>
pub fn jsx_member_expression_object_jsx_identifier<A>( self, span: Span, name: A, ) -> JSXMemberExpressionObject<'a>
Build a JSXMemberExpressionObject::Identifier
This node contains a JSXIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier.
sourcepub fn jsx_member_expression_object_from_jsx_identifier<T>(
self,
inner: T,
) -> JSXMemberExpressionObject<'a>
pub fn jsx_member_expression_object_from_jsx_identifier<T>( self, inner: T, ) -> JSXMemberExpressionObject<'a>
Convert a JSXIdentifier
into a JSXMemberExpressionObject::Identifier
sourcepub fn jsx_member_expression_object_jsx_member_expression(
self,
span: Span,
object: JSXMemberExpressionObject<'a>,
property: JSXIdentifier<'a>,
) -> JSXMemberExpressionObject<'a>
pub fn jsx_member_expression_object_jsx_member_expression( self, span: Span, object: JSXMemberExpressionObject<'a>, property: JSXIdentifier<'a>, ) -> JSXMemberExpressionObject<'a>
Build a JSXMemberExpressionObject::MemberExpression
This node contains a JSXMemberExpression
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - object: The object being accessed. This is everything before the last
.
. - property: The property being accessed. This is everything after the last
.
.
sourcepub fn jsx_member_expression_object_from_jsx_member_expression<T>(
self,
inner: T,
) -> JSXMemberExpressionObject<'a>
pub fn jsx_member_expression_object_from_jsx_member_expression<T>( self, inner: T, ) -> JSXMemberExpressionObject<'a>
Convert a JSXMemberExpression
into a JSXMemberExpressionObject::MemberExpression
sourcepub fn jsx_expression_container(
self,
span: Span,
expression: JSXExpression<'a>,
) -> JSXExpressionContainer<'a>
pub fn jsx_expression_container( self, span: Span, expression: JSXExpression<'a>, ) -> JSXExpressionContainer<'a>
Builds a JSXExpressionContainer
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_expression_container
instead.
§Parameters
- span: The
Span
covering this node - expression: The expression inside the container.
sourcepub fn alloc_jsx_expression_container(
self,
span: Span,
expression: JSXExpression<'a>,
) -> Box<'a, JSXExpressionContainer<'a>>
pub fn alloc_jsx_expression_container( self, span: Span, expression: JSXExpression<'a>, ) -> Box<'a, JSXExpressionContainer<'a>>
Builds a JSXExpressionContainer
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_expression_container
instead.
§Parameters
- span: The
Span
covering this node - expression: The expression inside the container.
sourcepub fn jsx_expression_jsx_empty_expression(
self,
span: Span,
) -> JSXExpression<'a>
pub fn jsx_expression_jsx_empty_expression( self, span: Span, ) -> JSXExpression<'a>
sourcepub fn jsx_expression_from_jsx_empty_expression<T>(
self,
inner: T,
) -> JSXExpression<'a>where
T: IntoIn<'a, JSXEmptyExpression>,
pub fn jsx_expression_from_jsx_empty_expression<T>(
self,
inner: T,
) -> JSXExpression<'a>where
T: IntoIn<'a, JSXEmptyExpression>,
Convert a JSXEmptyExpression
into a JSXExpression::EmptyExpression
pub fn jsx_expression_expression( self, inner: Expression<'a>, ) -> JSXExpression<'a>
sourcepub fn jsx_empty_expression(self, span: Span) -> JSXEmptyExpression
pub fn jsx_empty_expression(self, span: Span) -> JSXEmptyExpression
Builds a JSXEmptyExpression
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_empty_expression
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn alloc_jsx_empty_expression(
self,
span: Span,
) -> Box<'a, JSXEmptyExpression>
pub fn alloc_jsx_empty_expression( self, span: Span, ) -> Box<'a, JSXEmptyExpression>
Builds a JSXEmptyExpression
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_empty_expression
instead.
§Parameters
- span: The
Span
covering this node
sourcepub fn jsx_attribute_item_jsx_attribute(
self,
span: Span,
name: JSXAttributeName<'a>,
value: Option<JSXAttributeValue<'a>>,
) -> JSXAttributeItem<'a>
pub fn jsx_attribute_item_jsx_attribute( self, span: Span, name: JSXAttributeName<'a>, value: Option<JSXAttributeValue<'a>>, ) -> JSXAttributeItem<'a>
Build a JSXAttributeItem::Attribute
This node contains a JSXAttribute
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the attribute. This is a prop in React-like applications.
- value: The value of the attribute. This can be a string literal, an expression,
sourcepub fn jsx_attribute_item_from_jsx_attribute<T>(
self,
inner: T,
) -> JSXAttributeItem<'a>
pub fn jsx_attribute_item_from_jsx_attribute<T>( self, inner: T, ) -> JSXAttributeItem<'a>
Convert a JSXAttribute
into a JSXAttributeItem::Attribute
sourcepub fn jsx_attribute_item_jsx_spread_attribute(
self,
span: Span,
argument: Expression<'a>,
) -> JSXAttributeItem<'a>
pub fn jsx_attribute_item_jsx_spread_attribute( self, span: Span, argument: Expression<'a>, ) -> JSXAttributeItem<'a>
Build a JSXAttributeItem::SpreadAttribute
This node contains a JSXSpreadAttribute
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn jsx_attribute_item_from_jsx_spread_attribute<T>(
self,
inner: T,
) -> JSXAttributeItem<'a>
pub fn jsx_attribute_item_from_jsx_spread_attribute<T>( self, inner: T, ) -> JSXAttributeItem<'a>
Convert a JSXSpreadAttribute
into a JSXAttributeItem::SpreadAttribute
sourcepub fn jsx_attribute(
self,
span: Span,
name: JSXAttributeName<'a>,
value: Option<JSXAttributeValue<'a>>,
) -> JSXAttribute<'a>
pub fn jsx_attribute( self, span: Span, name: JSXAttributeName<'a>, value: Option<JSXAttributeValue<'a>>, ) -> JSXAttribute<'a>
Builds a JSXAttribute
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_attribute
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the attribute. This is a prop in React-like applications.
- value: The value of the attribute. This can be a string literal, an expression,
sourcepub fn alloc_jsx_attribute(
self,
span: Span,
name: JSXAttributeName<'a>,
value: Option<JSXAttributeValue<'a>>,
) -> Box<'a, JSXAttribute<'a>>
pub fn alloc_jsx_attribute( self, span: Span, name: JSXAttributeName<'a>, value: Option<JSXAttributeValue<'a>>, ) -> Box<'a, JSXAttribute<'a>>
Builds a JSXAttribute
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_attribute
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the attribute. This is a prop in React-like applications.
- value: The value of the attribute. This can be a string literal, an expression,
sourcepub fn jsx_spread_attribute(
self,
span: Span,
argument: Expression<'a>,
) -> JSXSpreadAttribute<'a>
pub fn jsx_spread_attribute( self, span: Span, argument: Expression<'a>, ) -> JSXSpreadAttribute<'a>
Builds a JSXSpreadAttribute
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_spread_attribute
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn alloc_jsx_spread_attribute(
self,
span: Span,
argument: Expression<'a>,
) -> Box<'a, JSXSpreadAttribute<'a>>
pub fn alloc_jsx_spread_attribute( self, span: Span, argument: Expression<'a>, ) -> Box<'a, JSXSpreadAttribute<'a>>
Builds a JSXSpreadAttribute
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_spread_attribute
instead.
§Parameters
- span: The
Span
covering this node - argument
sourcepub fn jsx_attribute_name_jsx_identifier<A>(
self,
span: Span,
name: A,
) -> JSXAttributeName<'a>
pub fn jsx_attribute_name_jsx_identifier<A>( self, span: Span, name: A, ) -> JSXAttributeName<'a>
Build a JSXAttributeName::Identifier
This node contains a JSXIdentifier
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier.
sourcepub fn jsx_attribute_name_from_jsx_identifier<T>(
self,
inner: T,
) -> JSXAttributeName<'a>
pub fn jsx_attribute_name_from_jsx_identifier<T>( self, inner: T, ) -> JSXAttributeName<'a>
Convert a JSXIdentifier
into a JSXAttributeName::Identifier
sourcepub fn jsx_attribute_name_jsx_namespaced_name(
self,
span: Span,
namespace: JSXIdentifier<'a>,
property: JSXIdentifier<'a>,
) -> JSXAttributeName<'a>
pub fn jsx_attribute_name_jsx_namespaced_name( self, span: Span, namespace: JSXIdentifier<'a>, property: JSXIdentifier<'a>, ) -> JSXAttributeName<'a>
Build a JSXAttributeName::NamespacedName
This node contains a JSXNamespacedName
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - namespace: Namespace portion of the name, e.g.
Apple
in<Apple:Orange />
- property: Name portion of the name, e.g.
Orange
in<Apple:Orange />
sourcepub fn jsx_attribute_name_from_jsx_namespaced_name<T>(
self,
inner: T,
) -> JSXAttributeName<'a>
pub fn jsx_attribute_name_from_jsx_namespaced_name<T>( self, inner: T, ) -> JSXAttributeName<'a>
Convert a JSXNamespacedName
into a JSXAttributeName::NamespacedName
sourcepub fn jsx_attribute_value_string_literal<A>(
self,
span: Span,
value: A,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_string_literal<A>( self, span: Span, value: A, ) -> JSXAttributeValue<'a>
Build a JSXAttributeValue::StringLiteral
This node contains a StringLiteral
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value
sourcepub fn jsx_attribute_value_from_string_literal<T>(
self,
inner: T,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_from_string_literal<T>( self, inner: T, ) -> JSXAttributeValue<'a>
Convert a StringLiteral
into a JSXAttributeValue::StringLiteral
sourcepub fn jsx_attribute_value_jsx_expression_container(
self,
span: Span,
expression: JSXExpression<'a>,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_jsx_expression_container( self, span: Span, expression: JSXExpression<'a>, ) -> JSXAttributeValue<'a>
Build a JSXAttributeValue::ExpressionContainer
This node contains a JSXExpressionContainer
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression: The expression inside the container.
sourcepub fn jsx_attribute_value_from_jsx_expression_container<T>(
self,
inner: T,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_from_jsx_expression_container<T>( self, inner: T, ) -> JSXAttributeValue<'a>
Convert a JSXExpressionContainer
into a JSXAttributeValue::ExpressionContainer
sourcepub fn jsx_attribute_value_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXAttributeValue<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
pub fn jsx_attribute_value_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXAttributeValue<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
Build a JSXAttributeValue::Element
This node contains a JSXElement
that will be stored in the memory arena.
§Parameters
sourcepub fn jsx_attribute_value_from_jsx_element<T>(
self,
inner: T,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_from_jsx_element<T>( self, inner: T, ) -> JSXAttributeValue<'a>
Convert a JSXElement
into a JSXAttributeValue::Element
sourcepub fn jsx_attribute_value_jsx_fragment(
self,
span: Span,
opening_fragment: JSXOpeningFragment,
closing_fragment: JSXClosingFragment,
children: Vec<'a, JSXChild<'a>>,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_jsx_fragment( self, span: Span, opening_fragment: JSXOpeningFragment, closing_fragment: JSXClosingFragment, children: Vec<'a, JSXChild<'a>>, ) -> JSXAttributeValue<'a>
Build a JSXAttributeValue::Fragment
This node contains a JSXFragment
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - opening_fragment:
<>
- closing_fragment:
</>
- children: Elements inside the fragment.
sourcepub fn jsx_attribute_value_from_jsx_fragment<T>(
self,
inner: T,
) -> JSXAttributeValue<'a>
pub fn jsx_attribute_value_from_jsx_fragment<T>( self, inner: T, ) -> JSXAttributeValue<'a>
Convert a JSXFragment
into a JSXAttributeValue::Fragment
sourcepub fn jsx_identifier<A>(self, span: Span, name: A) -> JSXIdentifier<'a>
pub fn jsx_identifier<A>(self, span: Span, name: A) -> JSXIdentifier<'a>
Builds a JSXIdentifier
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_identifier
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier.
sourcepub fn alloc_jsx_identifier<A>(
self,
span: Span,
name: A,
) -> Box<'a, JSXIdentifier<'a>>
pub fn alloc_jsx_identifier<A>( self, span: Span, name: A, ) -> Box<'a, JSXIdentifier<'a>>
Builds a JSXIdentifier
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_identifier
instead.
§Parameters
- span: The
Span
covering this node - name: The name of the identifier.
sourcepub fn jsx_child_jsx_text<A>(self, span: Span, value: A) -> JSXChild<'a>
pub fn jsx_child_jsx_text<A>(self, span: Span, value: A) -> JSXChild<'a>
Build a JSXChild::Text
This node contains a JSXText
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - value: The text content.
sourcepub fn jsx_child_from_jsx_text<T>(self, inner: T) -> JSXChild<'a>
pub fn jsx_child_from_jsx_text<T>(self, inner: T) -> JSXChild<'a>
Convert a JSXText
into a JSXChild::Text
sourcepub fn jsx_child_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXChild<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
pub fn jsx_child_jsx_element<T1, T2>(
self,
span: Span,
opening_element: T1,
closing_element: T2,
children: Vec<'a, JSXChild<'a>>,
) -> JSXChild<'a>where
T1: IntoIn<'a, Box<'a, JSXOpeningElement<'a>>>,
T2: IntoIn<'a, Option<Box<'a, JSXClosingElement<'a>>>>,
Build a JSXChild::Element
This node contains a JSXElement
that will be stored in the memory arena.
§Parameters
sourcepub fn jsx_child_from_jsx_element<T>(self, inner: T) -> JSXChild<'a>
pub fn jsx_child_from_jsx_element<T>(self, inner: T) -> JSXChild<'a>
Convert a JSXElement
into a JSXChild::Element
sourcepub fn jsx_child_jsx_fragment(
self,
span: Span,
opening_fragment: JSXOpeningFragment,
closing_fragment: JSXClosingFragment,
children: Vec<'a, JSXChild<'a>>,
) -> JSXChild<'a>
pub fn jsx_child_jsx_fragment( self, span: Span, opening_fragment: JSXOpeningFragment, closing_fragment: JSXClosingFragment, children: Vec<'a, JSXChild<'a>>, ) -> JSXChild<'a>
Build a JSXChild::Fragment
This node contains a JSXFragment
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - opening_fragment:
<>
- closing_fragment:
</>
- children: Elements inside the fragment.
sourcepub fn jsx_child_from_jsx_fragment<T>(self, inner: T) -> JSXChild<'a>
pub fn jsx_child_from_jsx_fragment<T>(self, inner: T) -> JSXChild<'a>
Convert a JSXFragment
into a JSXChild::Fragment
sourcepub fn jsx_child_jsx_expression_container(
self,
span: Span,
expression: JSXExpression<'a>,
) -> JSXChild<'a>
pub fn jsx_child_jsx_expression_container( self, span: Span, expression: JSXExpression<'a>, ) -> JSXChild<'a>
Build a JSXChild::ExpressionContainer
This node contains a JSXExpressionContainer
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression: The expression inside the container.
sourcepub fn jsx_child_from_jsx_expression_container<T>(
self,
inner: T,
) -> JSXChild<'a>
pub fn jsx_child_from_jsx_expression_container<T>( self, inner: T, ) -> JSXChild<'a>
Convert a JSXExpressionContainer
into a JSXChild::ExpressionContainer
sourcepub fn jsx_child_jsx_spread_child(
self,
span: Span,
expression: Expression<'a>,
) -> JSXChild<'a>
pub fn jsx_child_jsx_spread_child( self, span: Span, expression: Expression<'a>, ) -> JSXChild<'a>
Build a JSXChild::Spread
This node contains a JSXSpreadChild
that will be stored in the memory arena.
§Parameters
- span: The
Span
covering this node - expression: The expression being spread.
sourcepub fn jsx_child_from_jsx_spread_child<T>(self, inner: T) -> JSXChild<'a>
pub fn jsx_child_from_jsx_spread_child<T>(self, inner: T) -> JSXChild<'a>
Convert a JSXSpreadChild
into a JSXChild::Spread
sourcepub fn jsx_spread_child(
self,
span: Span,
expression: Expression<'a>,
) -> JSXSpreadChild<'a>
pub fn jsx_spread_child( self, span: Span, expression: Expression<'a>, ) -> JSXSpreadChild<'a>
Builds a JSXSpreadChild
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_spread_child
instead.
§Parameters
- span: The
Span
covering this node - expression: The expression being spread.
sourcepub fn alloc_jsx_spread_child(
self,
span: Span,
expression: Expression<'a>,
) -> Box<'a, JSXSpreadChild<'a>>
pub fn alloc_jsx_spread_child( self, span: Span, expression: Expression<'a>, ) -> Box<'a, JSXSpreadChild<'a>>
Builds a JSXSpreadChild
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_spread_child
instead.
§Parameters
- span: The
Span
covering this node - expression: The expression being spread.
sourcepub fn jsx_text<A>(self, span: Span, value: A) -> JSXText<'a>
pub fn jsx_text<A>(self, span: Span, value: A) -> JSXText<'a>
Builds a JSXText
If you want the built node to be allocated in the memory arena, use AstBuilder::alloc_jsx_text
instead.
§Parameters
- span: The
Span
covering this node - value: The text content.
sourcepub fn alloc_jsx_text<A>(self, span: Span, value: A) -> Box<'a, JSXText<'a>>
pub fn alloc_jsx_text<A>(self, span: Span, value: A) -> Box<'a, JSXText<'a>>
Builds a JSXText
and stores it in the memory arena.
Returns a Box
containing the newly-allocated node. If you want a stack-allocated node, use AstBuilder::jsx_text
instead.
§Parameters
- span: The
Span
covering this node - value: The text content.
Trait Implementations§
source§impl<'a> Clone for AstBuilder<'a>
impl<'a> Clone for AstBuilder<'a>
source§fn clone(&self) -> AstBuilder<'a>
fn clone(&self) -> AstBuilder<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl<'a> Copy for AstBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for AstBuilder<'a>
impl<'a> !RefUnwindSafe for AstBuilder<'a>
impl<'a> !Send for AstBuilder<'a>
impl<'a> !Sync for AstBuilder<'a>
impl<'a> Unpin for AstBuilder<'a>
impl<'a> !UnwindSafe for AstBuilder<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read moresource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more