stylex_transform/transform/
fold.rs1mod fold_computed_prop_name_impl;
2mod fold_decl;
3mod fold_export_decl;
4mod fold_export_default_expr;
5mod fold_expr;
6mod fold_ident;
8mod fold_import_decl;
9mod fold_jsx_attr_or_spread;
10mod fold_jsx_opening_element_impl;
11mod fold_member_expression;
12mod fold_member_prop;
13mod fold_module;
14mod fold_module_items;
15mod fold_named_export;
16mod fold_prop_name;
17mod fold_stmt;
18mod fold_stmts;
19mod fold_var_declarator;
20mod fold_var_declarators;
21
22use super::StyleXTransform;
23use swc_core::{
24 common::comments::Comments,
25 ecma::{
26 ast::{
27 ComputedPropName, Decl, ExportDecl, ExportDefaultExpr, Expr, Ident, ImportDecl,
28 JSXOpeningElement, MemberExpr, MemberProp, Module, ModuleItem, NamedExport, PropName, Stmt,
29 VarDeclarator,
30 },
31 visit::{Fold, noop_fold_type},
32 },
33};
34
35impl<C> Fold for StyleXTransform<C>
36where
37 C: Comments,
38{
39 noop_fold_type!();
40
41 fn fold_module(&mut self, module: Module) -> Module {
42 self.fold_module_impl(module)
43 }
44
45 fn fold_module_items(&mut self, module_items: Vec<ModuleItem>) -> Vec<ModuleItem> {
46 self.fold_module_items(module_items)
47 }
48
49 fn fold_import_decl(&mut self, import_decl: ImportDecl) -> ImportDecl {
50 self.fold_import_decl_impl(import_decl)
51 }
52
53 fn fold_var_declarators(&mut self, var_declarators: Vec<VarDeclarator>) -> Vec<VarDeclarator> {
54 self.fold_var_declarators_impl(var_declarators)
55 }
56
57 fn fold_var_declarator(&mut self, var_declarator: VarDeclarator) -> VarDeclarator {
58 self.fold_var_declarator_impl(var_declarator)
59 }
60
61 fn fold_export_decl(&mut self, export_decl: ExportDecl) -> ExportDecl {
66 self.fold_export_decl_impl(export_decl)
67 }
68
69 fn fold_stmts(&mut self, stmts: Vec<Stmt>) -> Vec<Stmt> {
70 self.fold_stmts_impl(stmts)
71 }
72
73 fn fold_stmt(&mut self, stmt: Stmt) -> Stmt {
74 self.fold_stmt_impl(stmt)
75 }
76
77 fn fold_expr(&mut self, expr: Expr) -> Expr {
78 self.fold_expr_impl(expr)
79 }
80
81 fn fold_prop_name(&mut self, prop_name: PropName) -> PropName {
82 self.fold_prop_name_impl(prop_name)
83 }
84
85 fn fold_member_prop(&mut self, member_prop: MemberProp) -> MemberProp {
86 self.fold_member_prop_impl(member_prop)
87 }
88
89 fn fold_member_expr(&mut self, member_expresseion: MemberExpr) -> MemberExpr {
90 self.fold_member_expr_impl(member_expresseion)
91 }
92
93 fn fold_computed_prop_name(&mut self, computed_prop_name: ComputedPropName) -> ComputedPropName {
94 self.fold_computed_prop_name_impl(computed_prop_name)
95 }
96
97 fn fold_export_default_expr(
98 &mut self,
99 export_default_expr: ExportDefaultExpr,
100 ) -> ExportDefaultExpr {
101 self.fold_export_default_expr_impl(export_default_expr)
102 }
103
104 fn fold_named_export(&mut self, named_export: NamedExport) -> NamedExport {
105 self.fold_named_export_impl(named_export)
106 }
107
108 fn fold_ident(&mut self, ident: Ident) -> Ident {
109 self.fold_ident_impl(ident)
110 }
111
112 fn fold_decl(&mut self, decl: Decl) -> Decl {
113 self.fold_decl_impl(decl)
114 }
115
116 fn fold_jsx_opening_element(
117 &mut self,
118 jsx_opening_element: JSXOpeningElement,
119 ) -> JSXOpeningElement {
120 self.fold_jsx_opening_element_impl(jsx_opening_element)
121 }
122
123 fn fold_jsx_attr_or_spreads(
124 &mut self,
125 jsx_attrs: Vec<swc_core::ecma::ast::JSXAttrOrSpread>,
126 ) -> Vec<swc_core::ecma::ast::JSXAttrOrSpread> {
127 self.fold_jsx_attr_or_spreads(jsx_attrs)
128 }
129}