@rollipop/rolldown 1.0.0-rc.2 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cli-setup.mjs +1 -1
  2. package/dist/cli.mjs +27 -996
  3. package/dist/config.d.mts +10 -5
  4. package/dist/config.mjs +9 -12
  5. package/dist/experimental-index.d.mts +72 -14
  6. package/dist/experimental-index.mjs +64 -11
  7. package/dist/experimental-runtime-types.d.ts +0 -5
  8. package/dist/filter-index.d.mts +2 -2
  9. package/dist/filter-index.mjs +24 -1
  10. package/dist/get-log-filter.d.mts +3 -7
  11. package/dist/get-log-filter.mjs +23 -2
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.mjs +10 -9
  14. package/dist/parallel-plugin-worker.mjs +5 -4
  15. package/dist/parallel-plugin.d.mts +2 -2
  16. package/dist/parse-ast-index.d.mts +26 -2
  17. package/dist/parse-ast-index.mjs +61 -2
  18. package/dist/plugins-index.d.mts +8 -5
  19. package/dist/plugins-index.mjs +8 -5
  20. package/dist/shared/{binding-Bo6UcGYl.d.mts → binding-C4ZlFAt6.d.mts} +302 -117
  21. package/dist/shared/{binding-9QXxzPo6.mjs → binding-D25Pz9Tj.mjs} +32 -26
  22. package/dist/shared/{bindingify-input-options-C--dZCPv.mjs → bindingify-input-options-D6jfpJ6l.mjs} +52 -113
  23. package/dist/shared/{constructors-DsYXT8FB.mjs → constructors-BAGdj697.mjs} +8 -5
  24. package/dist/shared/{constructors-B64fS2o1.d.mts → constructors-C-tyKVjw.d.mts} +9 -4
  25. package/dist/shared/{define-config-DT_Hpxdr.d.mts → define-config-BKLqq_zt.d.mts} +148 -43
  26. package/dist/shared/error-BoaGIj5N.mjs +90 -0
  27. package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
  28. package/dist/shared/{load-config-TBowPn4n.mjs → load-config-CV5K8wKJ.mjs} +10 -2
  29. package/dist/shared/{logs-NH298mHo.mjs → logs-CCc_0vhs.mjs} +1 -1
  30. package/dist/shared/{normalize-string-or-regex-CaBvmZZK.mjs → normalize-string-or-regex-tBSnk6HY.mjs} +2 -2
  31. package/dist/shared/parse-DWZRPGsB.mjs +77 -0
  32. package/dist/shared/{rolldown-5hTSdYMy.mjs → rolldown-CZ1SIh-x.mjs} +1 -1
  33. package/dist/shared/{rolldown-build-B7oitB1K.mjs → rolldown-build-BYA-VVk0.mjs} +1019 -26
  34. package/dist/shared/transform-CIcvJTbn.mjs +93 -0
  35. package/dist/shared/transform-DoG7c5_r.d.mts +132 -0
  36. package/dist/shared/{watch-CkctCkiN.mjs → watch-DV7vV2OV.mjs} +6 -5
  37. package/dist/utils-index.d.mts +376 -0
  38. package/dist/utils-index.mjs +2426 -0
  39. package/package.json +17 -16
  40. package/dist/shared/parse-ast-index-BQ9Myuc2.mjs +0 -99
  41. /package/dist/shared/{define-config-BVG4QvnP.mjs → define-config-BMj_QknW.mjs} +0 -0
  42. /package/dist/shared/{logging-CE90D8JR.d.mts → logging-C6h4g8dA.d.mts} +0 -0
  43. /package/dist/shared/{misc-CCZIsXVO.mjs → misc-Xty885dB.mjs} +0 -0
  44. /package/dist/shared/{prompt-CI-U8Lh4.mjs → prompt-B56gTa4S.mjs} +0 -0
@@ -0,0 +1,93 @@
1
+ import { n as __toESM, t as require_binding } from "./binding-D25Pz9Tj.mjs";
2
+ import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-BoaGIj5N.mjs";
3
+
4
+ //#region src/utils/minify.ts
5
+ var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
6
+ /**
7
+ * Minify asynchronously.
8
+ *
9
+ * Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
10
+ *
11
+ * @category Utilities
12
+ * @experimental
13
+ */
14
+ async function minify(filename, sourceText, options) {
15
+ const inputMap = bindingifySourcemap(options?.inputMap);
16
+ const result = await (0, import_binding.minify)(filename, sourceText, options);
17
+ if (result.map && inputMap) result.map = {
18
+ version: 3,
19
+ ...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
20
+ };
21
+ return result;
22
+ }
23
+ /**
24
+ * Minify synchronously.
25
+ *
26
+ * @category Utilities
27
+ * @experimental
28
+ */
29
+ function minifySync(filename, sourceText, options) {
30
+ const inputMap = bindingifySourcemap(options?.inputMap);
31
+ const result = (0, import_binding.minifySync)(filename, sourceText, options);
32
+ if (result.map && inputMap) result.map = {
33
+ version: 3,
34
+ ...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
35
+ };
36
+ return result;
37
+ }
38
+
39
+ //#endregion
40
+ //#region src/utils/transform.ts
41
+ /**
42
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
43
+ *
44
+ * Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
45
+ *
46
+ * @param filename The name of the file being transformed. If this is a
47
+ * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
48
+ * @param sourceText The source code to transform.
49
+ * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
50
+ * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
51
+ * Only used when `options.tsconfig` is `true`.
52
+ *
53
+ * @returns a promise that resolves to an object containing the transformed code,
54
+ * source maps, and any errors that occurred during parsing or transformation.
55
+ *
56
+ * @category Utilities
57
+ * @experimental
58
+ */
59
+ async function transform(filename, sourceText, options, cache) {
60
+ const result = await (0, import_binding.enhancedTransform)(filename, sourceText, options, cache);
61
+ return {
62
+ ...result,
63
+ errors: result.errors.map(normalizeBindingError),
64
+ warnings: result.warnings.map((w) => w.field0)
65
+ };
66
+ }
67
+ /**
68
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version.
69
+ *
70
+ * @param filename The name of the file being transformed. If this is a
71
+ * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
72
+ * @param sourceText The source code to transform.
73
+ * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
74
+ * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
75
+ * Only used when `options.tsconfig` is `true`.
76
+ *
77
+ * @returns an object containing the transformed code, source maps, and any errors
78
+ * that occurred during parsing or transformation.
79
+ *
80
+ * @category Utilities
81
+ * @experimental
82
+ */
83
+ function transformSync(filename, sourceText, options, cache) {
84
+ const result = (0, import_binding.enhancedTransformSync)(filename, sourceText, options, cache);
85
+ return {
86
+ ...result,
87
+ errors: result.errors.map(normalizeBindingError),
88
+ warnings: result.warnings.map((w) => w.field0)
89
+ };
90
+ }
91
+
92
+ //#endregion
93
+ export { minifySync as a, minify as i, transform as n, transformSync as r, import_binding as t };
@@ -0,0 +1,132 @@
1
+ import { a as RolldownLog } from "./logging-C6h4g8dA.mjs";
2
+ import { I as ParseResult$1, L as ParserOptions$1, N as MinifyOptions$1, P as MinifyResult$1, U as TsconfigCache, V as SourceMap, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult } from "./binding-C4ZlFAt6.mjs";
3
+
4
+ //#region src/utils/parse.d.ts
5
+ /**
6
+ * Result of parsing a code
7
+ *
8
+ * @category Utilities
9
+ */
10
+ interface ParseResult extends ParseResult$1 {}
11
+ /**
12
+ * Options for parsing a code
13
+ *
14
+ * @category Utilities
15
+ */
16
+ interface ParserOptions extends ParserOptions$1 {}
17
+ /**
18
+ * Parse JS/TS source asynchronously on a separate thread.
19
+ *
20
+ * Note that not all of the workload can happen on a separate thread.
21
+ * Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
22
+ * has to happen on current thread. This synchronous deserialization work typically outweighs
23
+ * the asynchronous parsing by a factor of between 3 and 20.
24
+ *
25
+ * i.e. the majority of the workload cannot be parallelized by using this method.
26
+ *
27
+ * Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
28
+ * If you need to parallelize parsing multiple files, it is recommended to use worker threads.
29
+ *
30
+ * @category Utilities
31
+ */
32
+ declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
33
+ /**
34
+ * Parse JS/TS source synchronously on current thread.
35
+ *
36
+ * This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
37
+ * of spawning a thread, and the majority of the workload cannot be parallelized anyway
38
+ * (see {@linkcode parse} documentation for details).
39
+ *
40
+ * If you need to parallelize parsing multiple files, it is recommended to use worker threads
41
+ * with {@linkcode parseSync} rather than using {@linkcode parse}.
42
+ *
43
+ * @category Utilities
44
+ */
45
+ declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
46
+ //#endregion
47
+ //#region src/utils/minify.d.ts
48
+ /**
49
+ * Options for minification.
50
+ *
51
+ * @category Utilities
52
+ */
53
+ interface MinifyOptions extends MinifyOptions$1 {
54
+ inputMap?: SourceMap;
55
+ }
56
+ /**
57
+ * The result of minification.
58
+ *
59
+ * @category Utilities
60
+ */
61
+ interface MinifyResult extends MinifyResult$1 {}
62
+ /**
63
+ * Minify asynchronously.
64
+ *
65
+ * Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
66
+ *
67
+ * @category Utilities
68
+ * @experimental
69
+ */
70
+ declare function minify(filename: string, sourceText: string, options?: MinifyOptions | null): Promise<MinifyResult>;
71
+ /**
72
+ * Minify synchronously.
73
+ *
74
+ * @category Utilities
75
+ * @experimental
76
+ */
77
+ declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions | null): MinifyResult;
78
+ //#endregion
79
+ //#region src/utils/transform.d.ts
80
+ /**
81
+ * Options for transforming a code.
82
+ *
83
+ * @category Utilities
84
+ */
85
+ interface TransformOptions extends BindingEnhancedTransformOptions {}
86
+ /**
87
+ * Result of transforming a code.
88
+ *
89
+ * @category Utilities
90
+ */
91
+ type TransformResult = Omit<BindingEnhancedTransformResult, "errors" | "warnings"> & {
92
+ errors: Error[];
93
+ warnings: RolldownLog[];
94
+ };
95
+ /**
96
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
97
+ *
98
+ * Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
99
+ *
100
+ * @param filename The name of the file being transformed. If this is a
101
+ * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
102
+ * @param sourceText The source code to transform.
103
+ * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
104
+ * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
105
+ * Only used when `options.tsconfig` is `true`.
106
+ *
107
+ * @returns a promise that resolves to an object containing the transformed code,
108
+ * source maps, and any errors that occurred during parsing or transformation.
109
+ *
110
+ * @category Utilities
111
+ * @experimental
112
+ */
113
+ declare function transform(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): Promise<TransformResult>;
114
+ /**
115
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version.
116
+ *
117
+ * @param filename The name of the file being transformed. If this is a
118
+ * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
119
+ * @param sourceText The source code to transform.
120
+ * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
121
+ * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
122
+ * Only used when `options.tsconfig` is `true`.
123
+ *
124
+ * @returns an object containing the transformed code, source maps, and any errors
125
+ * that occurred during parsing or transformation.
126
+ *
127
+ * @category Utilities
128
+ * @experimental
129
+ */
130
+ declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): TransformResult;
131
+ //#endregion
132
+ export { MinifyOptions as a, minifySync as c, parse as d, parseSync as f, transformSync as i, ParseResult as l, TransformResult as n, MinifyResult as o, transform as r, minify as s, TransformOptions as t, ParserOptions as u };
@@ -1,8 +1,9 @@
1
- import { n as __toESM, t as require_binding } from "./binding-9QXxzPo6.mjs";
2
- import { o as logMultiplyNotifyOption } from "./logs-NH298mHo.mjs";
3
- import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-C--dZCPv.mjs";
4
- import { t as arraify } from "./misc-CCZIsXVO.mjs";
5
- import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-B7oitB1K.mjs";
1
+ import { n as __toESM, t as require_binding } from "./binding-D25Pz9Tj.mjs";
2
+ import { o as logMultiplyNotifyOption } from "./logs-CCc_0vhs.mjs";
3
+ import { _ as LOG_LEVEL_WARN } from "./bindingify-input-options-D6jfpJ6l.mjs";
4
+ import { t as arraify } from "./misc-Xty885dB.mjs";
5
+ import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-BYA-VVk0.mjs";
6
+ import { t as aggregateBindingErrorsIntoJsError } from "./error-BoaGIj5N.mjs";
6
7
 
7
8
  //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
8
9
  /**
@@ -0,0 +1,376 @@
1
+ import { U as TsconfigCache, _ as BindingTsconfigRawOptions, g as BindingTsconfigCompilerOptions } from "./shared/binding-C4ZlFAt6.mjs";
2
+ import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as transformSync, l as ParseResult, n as TransformResult, o as MinifyResult, r as transform, s as minify, t as TransformOptions, u as ParserOptions } from "./shared/transform-DoG7c5_r.mjs";
3
+ import * as ESTree from "@oxc-project/types";
4
+ import { Program } from "@oxc-project/types";
5
+
6
+ //#region ../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
7
+ interface VisitorObject$1 {
8
+ DebuggerStatement?: (node: ESTree.DebuggerStatement) => void;
9
+ "DebuggerStatement:exit"?: (node: ESTree.DebuggerStatement) => void;
10
+ EmptyStatement?: (node: ESTree.EmptyStatement) => void;
11
+ "EmptyStatement:exit"?: (node: ESTree.EmptyStatement) => void;
12
+ Literal?: (node: ESTree.BooleanLiteral | ESTree.NullLiteral | ESTree.NumericLiteral | ESTree.StringLiteral | ESTree.BigIntLiteral | ESTree.RegExpLiteral) => void;
13
+ "Literal:exit"?: (node: ESTree.BooleanLiteral | ESTree.NullLiteral | ESTree.NumericLiteral | ESTree.StringLiteral | ESTree.BigIntLiteral | ESTree.RegExpLiteral) => void;
14
+ PrivateIdentifier?: (node: ESTree.PrivateIdentifier) => void;
15
+ "PrivateIdentifier:exit"?: (node: ESTree.PrivateIdentifier) => void;
16
+ Super?: (node: ESTree.Super) => void;
17
+ "Super:exit"?: (node: ESTree.Super) => void;
18
+ TemplateElement?: (node: ESTree.TemplateElement) => void;
19
+ "TemplateElement:exit"?: (node: ESTree.TemplateElement) => void;
20
+ ThisExpression?: (node: ESTree.ThisExpression) => void;
21
+ "ThisExpression:exit"?: (node: ESTree.ThisExpression) => void;
22
+ JSXClosingFragment?: (node: ESTree.JSXClosingFragment) => void;
23
+ "JSXClosingFragment:exit"?: (node: ESTree.JSXClosingFragment) => void;
24
+ JSXEmptyExpression?: (node: ESTree.JSXEmptyExpression) => void;
25
+ "JSXEmptyExpression:exit"?: (node: ESTree.JSXEmptyExpression) => void;
26
+ JSXIdentifier?: (node: ESTree.JSXIdentifier) => void;
27
+ "JSXIdentifier:exit"?: (node: ESTree.JSXIdentifier) => void;
28
+ JSXOpeningFragment?: (node: ESTree.JSXOpeningFragment) => void;
29
+ "JSXOpeningFragment:exit"?: (node: ESTree.JSXOpeningFragment) => void;
30
+ JSXText?: (node: ESTree.JSXText) => void;
31
+ "JSXText:exit"?: (node: ESTree.JSXText) => void;
32
+ TSAnyKeyword?: (node: ESTree.TSAnyKeyword) => void;
33
+ "TSAnyKeyword:exit"?: (node: ESTree.TSAnyKeyword) => void;
34
+ TSBigIntKeyword?: (node: ESTree.TSBigIntKeyword) => void;
35
+ "TSBigIntKeyword:exit"?: (node: ESTree.TSBigIntKeyword) => void;
36
+ TSBooleanKeyword?: (node: ESTree.TSBooleanKeyword) => void;
37
+ "TSBooleanKeyword:exit"?: (node: ESTree.TSBooleanKeyword) => void;
38
+ TSIntrinsicKeyword?: (node: ESTree.TSIntrinsicKeyword) => void;
39
+ "TSIntrinsicKeyword:exit"?: (node: ESTree.TSIntrinsicKeyword) => void;
40
+ TSJSDocUnknownType?: (node: ESTree.JSDocUnknownType) => void;
41
+ "TSJSDocUnknownType:exit"?: (node: ESTree.JSDocUnknownType) => void;
42
+ TSNeverKeyword?: (node: ESTree.TSNeverKeyword) => void;
43
+ "TSNeverKeyword:exit"?: (node: ESTree.TSNeverKeyword) => void;
44
+ TSNullKeyword?: (node: ESTree.TSNullKeyword) => void;
45
+ "TSNullKeyword:exit"?: (node: ESTree.TSNullKeyword) => void;
46
+ TSNumberKeyword?: (node: ESTree.TSNumberKeyword) => void;
47
+ "TSNumberKeyword:exit"?: (node: ESTree.TSNumberKeyword) => void;
48
+ TSObjectKeyword?: (node: ESTree.TSObjectKeyword) => void;
49
+ "TSObjectKeyword:exit"?: (node: ESTree.TSObjectKeyword) => void;
50
+ TSStringKeyword?: (node: ESTree.TSStringKeyword) => void;
51
+ "TSStringKeyword:exit"?: (node: ESTree.TSStringKeyword) => void;
52
+ TSSymbolKeyword?: (node: ESTree.TSSymbolKeyword) => void;
53
+ "TSSymbolKeyword:exit"?: (node: ESTree.TSSymbolKeyword) => void;
54
+ TSThisType?: (node: ESTree.TSThisType) => void;
55
+ "TSThisType:exit"?: (node: ESTree.TSThisType) => void;
56
+ TSUndefinedKeyword?: (node: ESTree.TSUndefinedKeyword) => void;
57
+ "TSUndefinedKeyword:exit"?: (node: ESTree.TSUndefinedKeyword) => void;
58
+ TSUnknownKeyword?: (node: ESTree.TSUnknownKeyword) => void;
59
+ "TSUnknownKeyword:exit"?: (node: ESTree.TSUnknownKeyword) => void;
60
+ TSVoidKeyword?: (node: ESTree.TSVoidKeyword) => void;
61
+ "TSVoidKeyword:exit"?: (node: ESTree.TSVoidKeyword) => void;
62
+ AccessorProperty?: (node: ESTree.AccessorProperty) => void;
63
+ "AccessorProperty:exit"?: (node: ESTree.AccessorProperty) => void;
64
+ ArrayExpression?: (node: ESTree.ArrayExpression) => void;
65
+ "ArrayExpression:exit"?: (node: ESTree.ArrayExpression) => void;
66
+ ArrayPattern?: (node: ESTree.ArrayPattern) => void;
67
+ "ArrayPattern:exit"?: (node: ESTree.ArrayPattern) => void;
68
+ ArrowFunctionExpression?: (node: ESTree.ArrowFunctionExpression) => void;
69
+ "ArrowFunctionExpression:exit"?: (node: ESTree.ArrowFunctionExpression) => void;
70
+ AssignmentExpression?: (node: ESTree.AssignmentExpression) => void;
71
+ "AssignmentExpression:exit"?: (node: ESTree.AssignmentExpression) => void;
72
+ AssignmentPattern?: (node: ESTree.AssignmentPattern) => void;
73
+ "AssignmentPattern:exit"?: (node: ESTree.AssignmentPattern) => void;
74
+ AwaitExpression?: (node: ESTree.AwaitExpression) => void;
75
+ "AwaitExpression:exit"?: (node: ESTree.AwaitExpression) => void;
76
+ BinaryExpression?: (node: ESTree.BinaryExpression) => void;
77
+ "BinaryExpression:exit"?: (node: ESTree.BinaryExpression) => void;
78
+ BlockStatement?: (node: ESTree.BlockStatement) => void;
79
+ "BlockStatement:exit"?: (node: ESTree.BlockStatement) => void;
80
+ BreakStatement?: (node: ESTree.BreakStatement) => void;
81
+ "BreakStatement:exit"?: (node: ESTree.BreakStatement) => void;
82
+ CallExpression?: (node: ESTree.CallExpression) => void;
83
+ "CallExpression:exit"?: (node: ESTree.CallExpression) => void;
84
+ CatchClause?: (node: ESTree.CatchClause) => void;
85
+ "CatchClause:exit"?: (node: ESTree.CatchClause) => void;
86
+ ChainExpression?: (node: ESTree.ChainExpression) => void;
87
+ "ChainExpression:exit"?: (node: ESTree.ChainExpression) => void;
88
+ ClassBody?: (node: ESTree.ClassBody) => void;
89
+ "ClassBody:exit"?: (node: ESTree.ClassBody) => void;
90
+ ClassDeclaration?: (node: ESTree.Class) => void;
91
+ "ClassDeclaration:exit"?: (node: ESTree.Class) => void;
92
+ ClassExpression?: (node: ESTree.Class) => void;
93
+ "ClassExpression:exit"?: (node: ESTree.Class) => void;
94
+ ConditionalExpression?: (node: ESTree.ConditionalExpression) => void;
95
+ "ConditionalExpression:exit"?: (node: ESTree.ConditionalExpression) => void;
96
+ ContinueStatement?: (node: ESTree.ContinueStatement) => void;
97
+ "ContinueStatement:exit"?: (node: ESTree.ContinueStatement) => void;
98
+ Decorator?: (node: ESTree.Decorator) => void;
99
+ "Decorator:exit"?: (node: ESTree.Decorator) => void;
100
+ DoWhileStatement?: (node: ESTree.DoWhileStatement) => void;
101
+ "DoWhileStatement:exit"?: (node: ESTree.DoWhileStatement) => void;
102
+ ExportAllDeclaration?: (node: ESTree.ExportAllDeclaration) => void;
103
+ "ExportAllDeclaration:exit"?: (node: ESTree.ExportAllDeclaration) => void;
104
+ ExportDefaultDeclaration?: (node: ESTree.ExportDefaultDeclaration) => void;
105
+ "ExportDefaultDeclaration:exit"?: (node: ESTree.ExportDefaultDeclaration) => void;
106
+ ExportNamedDeclaration?: (node: ESTree.ExportNamedDeclaration) => void;
107
+ "ExportNamedDeclaration:exit"?: (node: ESTree.ExportNamedDeclaration) => void;
108
+ ExportSpecifier?: (node: ESTree.ExportSpecifier) => void;
109
+ "ExportSpecifier:exit"?: (node: ESTree.ExportSpecifier) => void;
110
+ ExpressionStatement?: (node: ESTree.ExpressionStatement) => void;
111
+ "ExpressionStatement:exit"?: (node: ESTree.ExpressionStatement) => void;
112
+ ForInStatement?: (node: ESTree.ForInStatement) => void;
113
+ "ForInStatement:exit"?: (node: ESTree.ForInStatement) => void;
114
+ ForOfStatement?: (node: ESTree.ForOfStatement) => void;
115
+ "ForOfStatement:exit"?: (node: ESTree.ForOfStatement) => void;
116
+ ForStatement?: (node: ESTree.ForStatement) => void;
117
+ "ForStatement:exit"?: (node: ESTree.ForStatement) => void;
118
+ FunctionDeclaration?: (node: ESTree.Function) => void;
119
+ "FunctionDeclaration:exit"?: (node: ESTree.Function) => void;
120
+ FunctionExpression?: (node: ESTree.Function) => void;
121
+ "FunctionExpression:exit"?: (node: ESTree.Function) => void;
122
+ Identifier?: (node: ESTree.IdentifierName | ESTree.IdentifierReference | ESTree.BindingIdentifier | ESTree.LabelIdentifier | ESTree.TSThisParameter | ESTree.TSIndexSignatureName) => void;
123
+ "Identifier:exit"?: (node: ESTree.IdentifierName | ESTree.IdentifierReference | ESTree.BindingIdentifier | ESTree.LabelIdentifier | ESTree.TSThisParameter | ESTree.TSIndexSignatureName) => void;
124
+ IfStatement?: (node: ESTree.IfStatement) => void;
125
+ "IfStatement:exit"?: (node: ESTree.IfStatement) => void;
126
+ ImportAttribute?: (node: ESTree.ImportAttribute) => void;
127
+ "ImportAttribute:exit"?: (node: ESTree.ImportAttribute) => void;
128
+ ImportDeclaration?: (node: ESTree.ImportDeclaration) => void;
129
+ "ImportDeclaration:exit"?: (node: ESTree.ImportDeclaration) => void;
130
+ ImportDefaultSpecifier?: (node: ESTree.ImportDefaultSpecifier) => void;
131
+ "ImportDefaultSpecifier:exit"?: (node: ESTree.ImportDefaultSpecifier) => void;
132
+ ImportExpression?: (node: ESTree.ImportExpression) => void;
133
+ "ImportExpression:exit"?: (node: ESTree.ImportExpression) => void;
134
+ ImportNamespaceSpecifier?: (node: ESTree.ImportNamespaceSpecifier) => void;
135
+ "ImportNamespaceSpecifier:exit"?: (node: ESTree.ImportNamespaceSpecifier) => void;
136
+ ImportSpecifier?: (node: ESTree.ImportSpecifier) => void;
137
+ "ImportSpecifier:exit"?: (node: ESTree.ImportSpecifier) => void;
138
+ LabeledStatement?: (node: ESTree.LabeledStatement) => void;
139
+ "LabeledStatement:exit"?: (node: ESTree.LabeledStatement) => void;
140
+ LogicalExpression?: (node: ESTree.LogicalExpression) => void;
141
+ "LogicalExpression:exit"?: (node: ESTree.LogicalExpression) => void;
142
+ MemberExpression?: (node: ESTree.MemberExpression) => void;
143
+ "MemberExpression:exit"?: (node: ESTree.MemberExpression) => void;
144
+ MetaProperty?: (node: ESTree.MetaProperty) => void;
145
+ "MetaProperty:exit"?: (node: ESTree.MetaProperty) => void;
146
+ MethodDefinition?: (node: ESTree.MethodDefinition) => void;
147
+ "MethodDefinition:exit"?: (node: ESTree.MethodDefinition) => void;
148
+ NewExpression?: (node: ESTree.NewExpression) => void;
149
+ "NewExpression:exit"?: (node: ESTree.NewExpression) => void;
150
+ ObjectExpression?: (node: ESTree.ObjectExpression) => void;
151
+ "ObjectExpression:exit"?: (node: ESTree.ObjectExpression) => void;
152
+ ObjectPattern?: (node: ESTree.ObjectPattern) => void;
153
+ "ObjectPattern:exit"?: (node: ESTree.ObjectPattern) => void;
154
+ ParenthesizedExpression?: (node: ESTree.ParenthesizedExpression) => void;
155
+ "ParenthesizedExpression:exit"?: (node: ESTree.ParenthesizedExpression) => void;
156
+ Program?: (node: ESTree.Program) => void;
157
+ "Program:exit"?: (node: ESTree.Program) => void;
158
+ Property?: (node: ESTree.ObjectProperty | ESTree.AssignmentTargetProperty | ESTree.AssignmentTargetPropertyProperty | ESTree.BindingProperty) => void;
159
+ "Property:exit"?: (node: ESTree.ObjectProperty | ESTree.AssignmentTargetProperty | ESTree.AssignmentTargetPropertyProperty | ESTree.BindingProperty) => void;
160
+ PropertyDefinition?: (node: ESTree.PropertyDefinition) => void;
161
+ "PropertyDefinition:exit"?: (node: ESTree.PropertyDefinition) => void;
162
+ RestElement?: (node: ESTree.AssignmentTargetRest | ESTree.BindingRestElement | ESTree.FormalParameterRest) => void;
163
+ "RestElement:exit"?: (node: ESTree.AssignmentTargetRest | ESTree.BindingRestElement | ESTree.FormalParameterRest) => void;
164
+ ReturnStatement?: (node: ESTree.ReturnStatement) => void;
165
+ "ReturnStatement:exit"?: (node: ESTree.ReturnStatement) => void;
166
+ SequenceExpression?: (node: ESTree.SequenceExpression) => void;
167
+ "SequenceExpression:exit"?: (node: ESTree.SequenceExpression) => void;
168
+ SpreadElement?: (node: ESTree.SpreadElement) => void;
169
+ "SpreadElement:exit"?: (node: ESTree.SpreadElement) => void;
170
+ StaticBlock?: (node: ESTree.StaticBlock) => void;
171
+ "StaticBlock:exit"?: (node: ESTree.StaticBlock) => void;
172
+ SwitchCase?: (node: ESTree.SwitchCase) => void;
173
+ "SwitchCase:exit"?: (node: ESTree.SwitchCase) => void;
174
+ SwitchStatement?: (node: ESTree.SwitchStatement) => void;
175
+ "SwitchStatement:exit"?: (node: ESTree.SwitchStatement) => void;
176
+ TaggedTemplateExpression?: (node: ESTree.TaggedTemplateExpression) => void;
177
+ "TaggedTemplateExpression:exit"?: (node: ESTree.TaggedTemplateExpression) => void;
178
+ TemplateLiteral?: (node: ESTree.TemplateLiteral) => void;
179
+ "TemplateLiteral:exit"?: (node: ESTree.TemplateLiteral) => void;
180
+ ThrowStatement?: (node: ESTree.ThrowStatement) => void;
181
+ "ThrowStatement:exit"?: (node: ESTree.ThrowStatement) => void;
182
+ TryStatement?: (node: ESTree.TryStatement) => void;
183
+ "TryStatement:exit"?: (node: ESTree.TryStatement) => void;
184
+ UnaryExpression?: (node: ESTree.UnaryExpression) => void;
185
+ "UnaryExpression:exit"?: (node: ESTree.UnaryExpression) => void;
186
+ UpdateExpression?: (node: ESTree.UpdateExpression) => void;
187
+ "UpdateExpression:exit"?: (node: ESTree.UpdateExpression) => void;
188
+ V8IntrinsicExpression?: (node: ESTree.V8IntrinsicExpression) => void;
189
+ "V8IntrinsicExpression:exit"?: (node: ESTree.V8IntrinsicExpression) => void;
190
+ VariableDeclaration?: (node: ESTree.VariableDeclaration) => void;
191
+ "VariableDeclaration:exit"?: (node: ESTree.VariableDeclaration) => void;
192
+ VariableDeclarator?: (node: ESTree.VariableDeclarator) => void;
193
+ "VariableDeclarator:exit"?: (node: ESTree.VariableDeclarator) => void;
194
+ WhileStatement?: (node: ESTree.WhileStatement) => void;
195
+ "WhileStatement:exit"?: (node: ESTree.WhileStatement) => void;
196
+ WithStatement?: (node: ESTree.WithStatement) => void;
197
+ "WithStatement:exit"?: (node: ESTree.WithStatement) => void;
198
+ YieldExpression?: (node: ESTree.YieldExpression) => void;
199
+ "YieldExpression:exit"?: (node: ESTree.YieldExpression) => void;
200
+ JSXAttribute?: (node: ESTree.JSXAttribute) => void;
201
+ "JSXAttribute:exit"?: (node: ESTree.JSXAttribute) => void;
202
+ JSXClosingElement?: (node: ESTree.JSXClosingElement) => void;
203
+ "JSXClosingElement:exit"?: (node: ESTree.JSXClosingElement) => void;
204
+ JSXElement?: (node: ESTree.JSXElement) => void;
205
+ "JSXElement:exit"?: (node: ESTree.JSXElement) => void;
206
+ JSXExpressionContainer?: (node: ESTree.JSXExpressionContainer) => void;
207
+ "JSXExpressionContainer:exit"?: (node: ESTree.JSXExpressionContainer) => void;
208
+ JSXFragment?: (node: ESTree.JSXFragment) => void;
209
+ "JSXFragment:exit"?: (node: ESTree.JSXFragment) => void;
210
+ JSXMemberExpression?: (node: ESTree.JSXMemberExpression) => void;
211
+ "JSXMemberExpression:exit"?: (node: ESTree.JSXMemberExpression) => void;
212
+ JSXNamespacedName?: (node: ESTree.JSXNamespacedName) => void;
213
+ "JSXNamespacedName:exit"?: (node: ESTree.JSXNamespacedName) => void;
214
+ JSXOpeningElement?: (node: ESTree.JSXOpeningElement) => void;
215
+ "JSXOpeningElement:exit"?: (node: ESTree.JSXOpeningElement) => void;
216
+ JSXSpreadAttribute?: (node: ESTree.JSXSpreadAttribute) => void;
217
+ "JSXSpreadAttribute:exit"?: (node: ESTree.JSXSpreadAttribute) => void;
218
+ JSXSpreadChild?: (node: ESTree.JSXSpreadChild) => void;
219
+ "JSXSpreadChild:exit"?: (node: ESTree.JSXSpreadChild) => void;
220
+ TSAbstractAccessorProperty?: (node: ESTree.AccessorProperty) => void;
221
+ "TSAbstractAccessorProperty:exit"?: (node: ESTree.AccessorProperty) => void;
222
+ TSAbstractMethodDefinition?: (node: ESTree.MethodDefinition) => void;
223
+ "TSAbstractMethodDefinition:exit"?: (node: ESTree.MethodDefinition) => void;
224
+ TSAbstractPropertyDefinition?: (node: ESTree.PropertyDefinition) => void;
225
+ "TSAbstractPropertyDefinition:exit"?: (node: ESTree.PropertyDefinition) => void;
226
+ TSArrayType?: (node: ESTree.TSArrayType) => void;
227
+ "TSArrayType:exit"?: (node: ESTree.TSArrayType) => void;
228
+ TSAsExpression?: (node: ESTree.TSAsExpression) => void;
229
+ "TSAsExpression:exit"?: (node: ESTree.TSAsExpression) => void;
230
+ TSCallSignatureDeclaration?: (node: ESTree.TSCallSignatureDeclaration) => void;
231
+ "TSCallSignatureDeclaration:exit"?: (node: ESTree.TSCallSignatureDeclaration) => void;
232
+ TSClassImplements?: (node: ESTree.TSClassImplements) => void;
233
+ "TSClassImplements:exit"?: (node: ESTree.TSClassImplements) => void;
234
+ TSConditionalType?: (node: ESTree.TSConditionalType) => void;
235
+ "TSConditionalType:exit"?: (node: ESTree.TSConditionalType) => void;
236
+ TSConstructSignatureDeclaration?: (node: ESTree.TSConstructSignatureDeclaration) => void;
237
+ "TSConstructSignatureDeclaration:exit"?: (node: ESTree.TSConstructSignatureDeclaration) => void;
238
+ TSConstructorType?: (node: ESTree.TSConstructorType) => void;
239
+ "TSConstructorType:exit"?: (node: ESTree.TSConstructorType) => void;
240
+ TSDeclareFunction?: (node: ESTree.Function) => void;
241
+ "TSDeclareFunction:exit"?: (node: ESTree.Function) => void;
242
+ TSEmptyBodyFunctionExpression?: (node: ESTree.Function) => void;
243
+ "TSEmptyBodyFunctionExpression:exit"?: (node: ESTree.Function) => void;
244
+ TSEnumBody?: (node: ESTree.TSEnumBody) => void;
245
+ "TSEnumBody:exit"?: (node: ESTree.TSEnumBody) => void;
246
+ TSEnumDeclaration?: (node: ESTree.TSEnumDeclaration) => void;
247
+ "TSEnumDeclaration:exit"?: (node: ESTree.TSEnumDeclaration) => void;
248
+ TSEnumMember?: (node: ESTree.TSEnumMember) => void;
249
+ "TSEnumMember:exit"?: (node: ESTree.TSEnumMember) => void;
250
+ TSExportAssignment?: (node: ESTree.TSExportAssignment) => void;
251
+ "TSExportAssignment:exit"?: (node: ESTree.TSExportAssignment) => void;
252
+ TSExternalModuleReference?: (node: ESTree.TSExternalModuleReference) => void;
253
+ "TSExternalModuleReference:exit"?: (node: ESTree.TSExternalModuleReference) => void;
254
+ TSFunctionType?: (node: ESTree.TSFunctionType) => void;
255
+ "TSFunctionType:exit"?: (node: ESTree.TSFunctionType) => void;
256
+ TSImportEqualsDeclaration?: (node: ESTree.TSImportEqualsDeclaration) => void;
257
+ "TSImportEqualsDeclaration:exit"?: (node: ESTree.TSImportEqualsDeclaration) => void;
258
+ TSImportType?: (node: ESTree.TSImportType) => void;
259
+ "TSImportType:exit"?: (node: ESTree.TSImportType) => void;
260
+ TSIndexSignature?: (node: ESTree.TSIndexSignature) => void;
261
+ "TSIndexSignature:exit"?: (node: ESTree.TSIndexSignature) => void;
262
+ TSIndexedAccessType?: (node: ESTree.TSIndexedAccessType) => void;
263
+ "TSIndexedAccessType:exit"?: (node: ESTree.TSIndexedAccessType) => void;
264
+ TSInferType?: (node: ESTree.TSInferType) => void;
265
+ "TSInferType:exit"?: (node: ESTree.TSInferType) => void;
266
+ TSInstantiationExpression?: (node: ESTree.TSInstantiationExpression) => void;
267
+ "TSInstantiationExpression:exit"?: (node: ESTree.TSInstantiationExpression) => void;
268
+ TSInterfaceBody?: (node: ESTree.TSInterfaceBody) => void;
269
+ "TSInterfaceBody:exit"?: (node: ESTree.TSInterfaceBody) => void;
270
+ TSInterfaceDeclaration?: (node: ESTree.TSInterfaceDeclaration) => void;
271
+ "TSInterfaceDeclaration:exit"?: (node: ESTree.TSInterfaceDeclaration) => void;
272
+ TSInterfaceHeritage?: (node: ESTree.TSInterfaceHeritage) => void;
273
+ "TSInterfaceHeritage:exit"?: (node: ESTree.TSInterfaceHeritage) => void;
274
+ TSIntersectionType?: (node: ESTree.TSIntersectionType) => void;
275
+ "TSIntersectionType:exit"?: (node: ESTree.TSIntersectionType) => void;
276
+ TSJSDocNonNullableType?: (node: ESTree.JSDocNonNullableType) => void;
277
+ "TSJSDocNonNullableType:exit"?: (node: ESTree.JSDocNonNullableType) => void;
278
+ TSJSDocNullableType?: (node: ESTree.JSDocNullableType) => void;
279
+ "TSJSDocNullableType:exit"?: (node: ESTree.JSDocNullableType) => void;
280
+ TSLiteralType?: (node: ESTree.TSLiteralType) => void;
281
+ "TSLiteralType:exit"?: (node: ESTree.TSLiteralType) => void;
282
+ TSMappedType?: (node: ESTree.TSMappedType) => void;
283
+ "TSMappedType:exit"?: (node: ESTree.TSMappedType) => void;
284
+ TSMethodSignature?: (node: ESTree.TSMethodSignature) => void;
285
+ "TSMethodSignature:exit"?: (node: ESTree.TSMethodSignature) => void;
286
+ TSModuleBlock?: (node: ESTree.TSModuleBlock) => void;
287
+ "TSModuleBlock:exit"?: (node: ESTree.TSModuleBlock) => void;
288
+ TSModuleDeclaration?: (node: ESTree.TSModuleDeclaration | ESTree.TSGlobalDeclaration) => void;
289
+ "TSModuleDeclaration:exit"?: (node: ESTree.TSModuleDeclaration | ESTree.TSGlobalDeclaration) => void;
290
+ TSNamedTupleMember?: (node: ESTree.TSNamedTupleMember) => void;
291
+ "TSNamedTupleMember:exit"?: (node: ESTree.TSNamedTupleMember) => void;
292
+ TSNamespaceExportDeclaration?: (node: ESTree.TSNamespaceExportDeclaration) => void;
293
+ "TSNamespaceExportDeclaration:exit"?: (node: ESTree.TSNamespaceExportDeclaration) => void;
294
+ TSNonNullExpression?: (node: ESTree.TSNonNullExpression) => void;
295
+ "TSNonNullExpression:exit"?: (node: ESTree.TSNonNullExpression) => void;
296
+ TSOptionalType?: (node: ESTree.TSOptionalType) => void;
297
+ "TSOptionalType:exit"?: (node: ESTree.TSOptionalType) => void;
298
+ TSParameterProperty?: (node: ESTree.TSParameterProperty) => void;
299
+ "TSParameterProperty:exit"?: (node: ESTree.TSParameterProperty) => void;
300
+ TSParenthesizedType?: (node: ESTree.TSParenthesizedType) => void;
301
+ "TSParenthesizedType:exit"?: (node: ESTree.TSParenthesizedType) => void;
302
+ TSPropertySignature?: (node: ESTree.TSPropertySignature) => void;
303
+ "TSPropertySignature:exit"?: (node: ESTree.TSPropertySignature) => void;
304
+ TSQualifiedName?: (node: ESTree.TSQualifiedName) => void;
305
+ "TSQualifiedName:exit"?: (node: ESTree.TSQualifiedName) => void;
306
+ TSRestType?: (node: ESTree.TSRestType) => void;
307
+ "TSRestType:exit"?: (node: ESTree.TSRestType) => void;
308
+ TSSatisfiesExpression?: (node: ESTree.TSSatisfiesExpression) => void;
309
+ "TSSatisfiesExpression:exit"?: (node: ESTree.TSSatisfiesExpression) => void;
310
+ TSTemplateLiteralType?: (node: ESTree.TSTemplateLiteralType) => void;
311
+ "TSTemplateLiteralType:exit"?: (node: ESTree.TSTemplateLiteralType) => void;
312
+ TSTupleType?: (node: ESTree.TSTupleType) => void;
313
+ "TSTupleType:exit"?: (node: ESTree.TSTupleType) => void;
314
+ TSTypeAliasDeclaration?: (node: ESTree.TSTypeAliasDeclaration) => void;
315
+ "TSTypeAliasDeclaration:exit"?: (node: ESTree.TSTypeAliasDeclaration) => void;
316
+ TSTypeAnnotation?: (node: ESTree.TSTypeAnnotation) => void;
317
+ "TSTypeAnnotation:exit"?: (node: ESTree.TSTypeAnnotation) => void;
318
+ TSTypeAssertion?: (node: ESTree.TSTypeAssertion) => void;
319
+ "TSTypeAssertion:exit"?: (node: ESTree.TSTypeAssertion) => void;
320
+ TSTypeLiteral?: (node: ESTree.TSTypeLiteral) => void;
321
+ "TSTypeLiteral:exit"?: (node: ESTree.TSTypeLiteral) => void;
322
+ TSTypeOperator?: (node: ESTree.TSTypeOperator) => void;
323
+ "TSTypeOperator:exit"?: (node: ESTree.TSTypeOperator) => void;
324
+ TSTypeParameter?: (node: ESTree.TSTypeParameter) => void;
325
+ "TSTypeParameter:exit"?: (node: ESTree.TSTypeParameter) => void;
326
+ TSTypeParameterDeclaration?: (node: ESTree.TSTypeParameterDeclaration) => void;
327
+ "TSTypeParameterDeclaration:exit"?: (node: ESTree.TSTypeParameterDeclaration) => void;
328
+ TSTypeParameterInstantiation?: (node: ESTree.TSTypeParameterInstantiation) => void;
329
+ "TSTypeParameterInstantiation:exit"?: (node: ESTree.TSTypeParameterInstantiation) => void;
330
+ TSTypePredicate?: (node: ESTree.TSTypePredicate) => void;
331
+ "TSTypePredicate:exit"?: (node: ESTree.TSTypePredicate) => void;
332
+ TSTypeQuery?: (node: ESTree.TSTypeQuery) => void;
333
+ "TSTypeQuery:exit"?: (node: ESTree.TSTypeQuery) => void;
334
+ TSTypeReference?: (node: ESTree.TSTypeReference) => void;
335
+ "TSTypeReference:exit"?: (node: ESTree.TSTypeReference) => void;
336
+ TSUnionType?: (node: ESTree.TSUnionType) => void;
337
+ "TSUnionType:exit"?: (node: ESTree.TSUnionType) => void;
338
+ }
339
+ //#endregion
340
+ //#region src/utils/visitor.d.ts
341
+ /**
342
+ * Visitor object for traversing AST.
343
+ *
344
+ * @category Utilities
345
+ */
346
+ type VisitorObject = VisitorObject$1;
347
+ /**
348
+ * Visitor class for traversing AST.
349
+ *
350
+ * @example
351
+ * ```ts
352
+ * import { Visitor } from 'rolldown/utils';
353
+ * import { parseSync } from 'rolldown/utils';
354
+ *
355
+ * const result = parseSync(...);
356
+ * const visitor = new Visitor({
357
+ * VariableDeclaration(path) {
358
+ * // Do something with the variable declaration
359
+ * },
360
+ * "VariableDeclaration:exit"(path) {
361
+ * // Do something after visiting the variable declaration
362
+ * }
363
+ * });
364
+ * visitor.visit(result.program);
365
+ * ```
366
+ *
367
+ * @category Utilities
368
+ * @experimental
369
+ */
370
+ declare class Visitor {
371
+ #private;
372
+ constructor(visitor: VisitorObject);
373
+ visit(program: Program): void;
374
+ }
375
+ //#endregion
376
+ export { type ESTree, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type TransformOptions, type TransformResult, TsconfigCache, type BindingTsconfigCompilerOptions as TsconfigCompilerOptions, type BindingTsconfigRawOptions as TsconfigRawOptions, Visitor, type VisitorObject, minify, minifySync, parse, parseSync, transform, transformSync };