rolldown 1.0.0-beta.2-commit.2666b23 → 1.0.0-beta.20

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 (236) hide show
  1. package/bin/cli.mjs +2 -0
  2. package/dist/{cjs/cli.cjs → cli.cjs} +630 -603
  3. package/dist/cli.d.cts +1 -0
  4. package/dist/cli.d.mts +1 -0
  5. package/dist/{esm/cli.mjs → cli.mjs} +605 -575
  6. package/dist/config.cjs +12 -0
  7. package/dist/config.d.cts +10 -0
  8. package/dist/config.d.mts +10 -0
  9. package/dist/config.mjs +10 -0
  10. package/dist/experimental-index.cjs +107 -0
  11. package/dist/experimental-index.d.cts +63 -0
  12. package/dist/experimental-index.d.mts +63 -0
  13. package/dist/experimental-index.mjs +82 -0
  14. package/dist/experimental-runtime-types.d.ts +52 -0
  15. package/dist/filter-index.cjs +105 -0
  16. package/dist/filter-index.d.cts +4 -0
  17. package/dist/filter-index.d.mts +4 -0
  18. package/dist/filter-index.mjs +44 -0
  19. package/dist/index.cjs +9 -0
  20. package/dist/index.d.cts +3 -0
  21. package/dist/index.d.mts +3 -0
  22. package/dist/index.mjs +5 -0
  23. package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +6 -14
  24. package/dist/parallel-plugin-worker.d.cts +1 -0
  25. package/dist/parallel-plugin-worker.d.mts +1 -0
  26. package/dist/{esm/parallel-plugin-worker.mjs → parallel-plugin-worker.mjs} +5 -12
  27. package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +1 -2
  28. package/dist/parallel-plugin.d.cts +14 -0
  29. package/dist/parallel-plugin.d.mts +14 -0
  30. package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -1
  31. package/dist/parse-ast-index.cjs +4 -0
  32. package/dist/parse-ast-index.d.cts +9 -0
  33. package/dist/parse-ast-index.d.mts +9 -0
  34. package/dist/parse-ast-index.mjs +3 -0
  35. package/dist/shared/binding-5O9lFYtz.d.mts +1215 -0
  36. package/dist/shared/binding-BvKFOCZr.d.cts +1215 -0
  37. package/dist/shared/{chunk-qZFfknuJ.cjs → chunk-DDkG_k5U.cjs} +0 -1
  38. package/dist/shared/define-config-BOD4oRSZ.d.cts +1204 -0
  39. package/dist/shared/define-config-DdVYel_V.d.mts +1204 -0
  40. package/dist/shared/load-config-B_hPIyxu.mjs +119 -0
  41. package/dist/shared/load-config-BdY850xq.cjs +125 -0
  42. package/dist/shared/misc-BKp5iIef.cjs +67 -0
  43. package/dist/shared/misc-BN0nse6C.mjs +25 -0
  44. package/dist/shared/parse-ast-index-CVVmsBjK.cjs +738 -0
  45. package/dist/shared/parse-ast-index-DW8kbzjr.mjs +616 -0
  46. package/dist/shared/{prompt-Nfm4Xz36.mjs → prompt-C5jz26Zn.mjs} +247 -246
  47. package/dist/shared/{prompt-B7tq3GL9.cjs → prompt-QNI93ne7.cjs} +250 -250
  48. package/dist/shared/src-CZ0tgOug.cjs +4851 -0
  49. package/dist/shared/src-DHXNdTPA.mjs +4647 -0
  50. package/package.json +63 -67
  51. package/bin/cli.js +0 -2
  52. package/dist/cjs/experimental-index.cjs +0 -79
  53. package/dist/cjs/index.cjs +0 -8
  54. package/dist/cjs/parse-ast-index.cjs +0 -57
  55. package/dist/esm/experimental-index.mjs +0 -56
  56. package/dist/esm/index.mjs +0 -4
  57. package/dist/esm/parse-ast-index.mjs +0 -55
  58. package/dist/shared/binding-l7VLSKnB.mjs +0 -610
  59. package/dist/shared/binding-orkvONpS.cjs +0 -661
  60. package/dist/shared/src-BC6S-BmL.cjs +0 -2828
  61. package/dist/shared/src-mupmacNC.mjs +0 -2647
  62. package/dist/types/api/build.d.ts +0 -18
  63. package/dist/types/api/build.js +0 -22
  64. package/dist/types/api/experimental.d.ts +0 -7
  65. package/dist/types/api/experimental.js +0 -13
  66. package/dist/types/api/rolldown/index.d.ts +0 -3
  67. package/dist/types/api/rolldown/index.js +0 -7
  68. package/dist/types/api/rolldown/rolldown-build.d.ts +0 -12
  69. package/dist/types/api/rolldown/rolldown-build.js +0 -43
  70. package/dist/types/api/watch/index.d.ts +0 -3
  71. package/dist/types/api/watch/index.js +0 -8
  72. package/dist/types/api/watch/watch-emitter.d.ts +0 -31
  73. package/dist/types/api/watch/watch-emitter.js +0 -69
  74. package/dist/types/api/watch/watcher.d.ts +0 -13
  75. package/dist/types/api/watch/watcher.js +0 -66
  76. package/dist/types/binding.d.ts +0 -1327
  77. package/dist/types/builtin-plugin/alias-plugin.d.ts +0 -10
  78. package/dist/types/builtin-plugin/alias-plugin.js +0 -4
  79. package/dist/types/builtin-plugin/constructors.d.ts +0 -20
  80. package/dist/types/builtin-plugin/constructors.js +0 -68
  81. package/dist/types/builtin-plugin/replace-plugin.d.ts +0 -28
  82. package/dist/types/builtin-plugin/replace-plugin.js +0 -29
  83. package/dist/types/builtin-plugin/transform-plugin.d.ts +0 -9
  84. package/dist/types/builtin-plugin/transform-plugin.js +0 -16
  85. package/dist/types/builtin-plugin/utils.d.ts +0 -8
  86. package/dist/types/builtin-plugin/utils.js +0 -19
  87. package/dist/types/cli/arguments/alias.d.ts +0 -16
  88. package/dist/types/cli/arguments/alias.js +0 -63
  89. package/dist/types/cli/arguments/index.d.ts +0 -15
  90. package/dist/types/cli/arguments/index.js +0 -127
  91. package/dist/types/cli/arguments/normalize.d.ts +0 -12
  92. package/dist/types/cli/arguments/normalize.js +0 -48
  93. package/dist/types/cli/arguments/utils.d.ts +0 -8
  94. package/dist/types/cli/arguments/utils.js +0 -67
  95. package/dist/types/cli/colors.d.ts +0 -11
  96. package/dist/types/cli/colors.js +0 -17
  97. package/dist/types/cli/commands/bundle.d.ts +0 -3
  98. package/dist/types/cli/commands/bundle.js +0 -203
  99. package/dist/types/cli/commands/help.d.ts +0 -1
  100. package/dist/types/cli/commands/help.js +0 -88
  101. package/dist/types/cli/index.d.ts +0 -1
  102. package/dist/types/cli/index.js +0 -27
  103. package/dist/types/cli/load-config.d.ts +0 -3
  104. package/dist/types/cli/load-config.js +0 -95
  105. package/dist/types/cli/logger.d.ts +0 -5
  106. package/dist/types/cli/logger.js +0 -35
  107. package/dist/types/constants/plugin-context.d.ts +0 -7
  108. package/dist/types/constants/plugin-context.js +0 -7
  109. package/dist/types/constants/plugin.d.ts +0 -45
  110. package/dist/types/constants/plugin.js +0 -69
  111. package/dist/types/experimental-index.d.ts +0 -9
  112. package/dist/types/experimental-index.js +0 -9
  113. package/dist/types/index.d.ts +0 -28
  114. package/dist/types/index.js +0 -7
  115. package/dist/types/log/logHandler.d.ts +0 -4
  116. package/dist/types/log/logHandler.js +0 -25
  117. package/dist/types/log/logger.d.ts +0 -6
  118. package/dist/types/log/logger.js +0 -107
  119. package/dist/types/log/logging.d.ts +0 -11
  120. package/dist/types/log/logging.js +0 -11
  121. package/dist/types/log/logs.d.ts +0 -18
  122. package/dist/types/log/logs.js +0 -86
  123. package/dist/types/options/input-options.d.ts +0 -170
  124. package/dist/types/options/input-options.js +0 -1
  125. package/dist/types/options/normalized-input-options.d.ts +0 -18
  126. package/dist/types/options/normalized-input-options.js +0 -21
  127. package/dist/types/options/normalized-output-options.d.ts +0 -67
  128. package/dist/types/options/normalized-output-options.js +0 -99
  129. package/dist/types/options/output-options.d.ts +0 -86
  130. package/dist/types/options/output-options.js +0 -1
  131. package/dist/types/options/watch-options.d.ts +0 -5
  132. package/dist/types/options/watch-options.js +0 -1
  133. package/dist/types/parallel-plugin-worker.d.ts +0 -1
  134. package/dist/types/parallel-plugin-worker.js +0 -31
  135. package/dist/types/parallel-plugin.d.ts +0 -1
  136. package/dist/types/parallel-plugin.js +0 -1
  137. package/dist/types/parse-ast-index.d.ts +0 -4
  138. package/dist/types/parse-ast-index.js +0 -73
  139. package/dist/types/plugin/bindingify-build-hooks.d.ts +0 -10
  140. package/dist/types/plugin/bindingify-build-hooks.js +0 -213
  141. package/dist/types/plugin/bindingify-hook-filter.d.ts +0 -7
  142. package/dist/types/plugin/bindingify-hook-filter.js +0 -39
  143. package/dist/types/plugin/bindingify-output-hooks.d.ts +0 -14
  144. package/dist/types/plugin/bindingify-output-hooks.js +0 -189
  145. package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +0 -8
  146. package/dist/types/plugin/bindingify-plugin-hook-meta.js +0 -19
  147. package/dist/types/plugin/bindingify-plugin.d.ts +0 -15
  148. package/dist/types/plugin/bindingify-plugin.js +0 -124
  149. package/dist/types/plugin/bindingify-watch-hooks.d.ts +0 -5
  150. package/dist/types/plugin/bindingify-watch-hooks.js +0 -29
  151. package/dist/types/plugin/hook-filter.d.ts +0 -48
  152. package/dist/types/plugin/hook-filter.js +0 -1
  153. package/dist/types/plugin/index.d.ts +0 -126
  154. package/dist/types/plugin/index.js +0 -1
  155. package/dist/types/plugin/minimal-plugin-context.d.ts +0 -15
  156. package/dist/types/plugin/minimal-plugin-context.js +0 -25
  157. package/dist/types/plugin/parallel-plugin-implementation.d.ts +0 -10
  158. package/dist/types/plugin/parallel-plugin-implementation.js +0 -3
  159. package/dist/types/plugin/parallel-plugin.d.ts +0 -9
  160. package/dist/types/plugin/parallel-plugin.js +0 -6
  161. package/dist/types/plugin/plugin-context-data.d.ts +0 -16
  162. package/dist/types/plugin/plugin-context-data.js +0 -55
  163. package/dist/types/plugin/plugin-context.d.ts +0 -52
  164. package/dist/types/plugin/plugin-context.js +0 -108
  165. package/dist/types/plugin/plugin-driver.d.ts +0 -8
  166. package/dist/types/plugin/plugin-driver.js +0 -88
  167. package/dist/types/plugin/transform-plugin-context.d.ts +0 -17
  168. package/dist/types/plugin/transform-plugin-context.js +0 -37
  169. package/dist/types/types/assert.d.ts +0 -13
  170. package/dist/types/types/assert.js +0 -1
  171. package/dist/types/types/config-export.d.ts +0 -5
  172. package/dist/types/types/config-export.js +0 -1
  173. package/dist/types/types/misc.d.ts +0 -40
  174. package/dist/types/types/misc.js +0 -1
  175. package/dist/types/types/module-info.d.ts +0 -15
  176. package/dist/types/types/module-info.js +0 -1
  177. package/dist/types/types/module-side-effects.d.ts +0 -10
  178. package/dist/types/types/module-side-effects.js +0 -1
  179. package/dist/types/types/output-bundle.d.ts +0 -4
  180. package/dist/types/types/output-bundle.js +0 -1
  181. package/dist/types/types/rolldown-options.d.ts +0 -5
  182. package/dist/types/types/rolldown-options.js +0 -1
  183. package/dist/types/types/rolldown-output.d.ts +0 -63
  184. package/dist/types/types/rolldown-output.js +0 -1
  185. package/dist/types/types/schema.d.ts +0 -33
  186. package/dist/types/types/schema.js +0 -1
  187. package/dist/types/types/sourcemap.d.ts +0 -13
  188. package/dist/types/types/sourcemap.js +0 -16
  189. package/dist/types/types/utils.d.ts +0 -13
  190. package/dist/types/types/utils.js +0 -1
  191. package/dist/types/utils/asset-source.d.ts +0 -4
  192. package/dist/types/utils/asset-source.js +0 -8
  193. package/dist/types/utils/async-flatten.d.ts +0 -1
  194. package/dist/types/utils/async-flatten.js +0 -7
  195. package/dist/types/utils/bindingify-input-options.d.ts +0 -7
  196. package/dist/types/utils/bindingify-input-options.js +0 -225
  197. package/dist/types/utils/bindingify-output-options.d.ts +0 -3
  198. package/dist/types/utils/bindingify-output-options.js +0 -92
  199. package/dist/types/utils/code-frame.d.ts +0 -1
  200. package/dist/types/utils/code-frame.js +0 -46
  201. package/dist/types/utils/compose-js-plugins.d.ts +0 -2
  202. package/dist/types/utils/compose-js-plugins.js +0 -400
  203. package/dist/types/utils/create-bundler-option.d.ts +0 -11
  204. package/dist/types/utils/create-bundler-option.js +0 -53
  205. package/dist/types/utils/create-bundler.d.ts +0 -8
  206. package/dist/types/utils/create-bundler.js +0 -15
  207. package/dist/types/utils/define-config.d.ts +0 -5
  208. package/dist/types/utils/define-config.js +0 -3
  209. package/dist/types/utils/error.d.ts +0 -2
  210. package/dist/types/utils/error.js +0 -65
  211. package/dist/types/utils/initialize-parallel-plugins.d.ts +0 -19
  212. package/dist/types/utils/initialize-parallel-plugins.js +0 -54
  213. package/dist/types/utils/misc.d.ts +0 -6
  214. package/dist/types/utils/misc.js +0 -22
  215. package/dist/types/utils/normalize-hook.d.ts +0 -7
  216. package/dist/types/utils/normalize-hook.js +0 -21
  217. package/dist/types/utils/normalize-plugin-option.d.ts +0 -13
  218. package/dist/types/utils/normalize-plugin-option.js +0 -35
  219. package/dist/types/utils/normalize-string-or-regex.d.ts +0 -2
  220. package/dist/types/utils/normalize-string-or-regex.js +0 -14
  221. package/dist/types/utils/plugin/index.d.ts +0 -2
  222. package/dist/types/utils/plugin/index.js +0 -7
  223. package/dist/types/utils/transform-module-info.d.ts +0 -4
  224. package/dist/types/utils/transform-module-info.js +0 -19
  225. package/dist/types/utils/transform-rendered-chunk.d.ts +0 -4
  226. package/dist/types/utils/transform-rendered-chunk.js +0 -43
  227. package/dist/types/utils/transform-rendered-module.d.ts +0 -3
  228. package/dist/types/utils/transform-rendered-module.js +0 -10
  229. package/dist/types/utils/transform-side-effects.d.ts +0 -3
  230. package/dist/types/utils/transform-side-effects.js +0 -16
  231. package/dist/types/utils/transform-sourcemap.d.ts +0 -3
  232. package/dist/types/utils/transform-sourcemap.js +0 -29
  233. package/dist/types/utils/transform-to-rollup-output.d.ts +0 -11
  234. package/dist/types/utils/transform-to-rollup-output.js +0 -165
  235. package/dist/types/utils/validator.d.ts +0 -7
  236. package/dist/types/utils/validator.js +0 -275
@@ -1,1327 +0,0 @@
1
- type MaybePromise<T> = T | Promise<T>
2
- type Nullable<T> = T | null | undefined
3
- type VoidNullable<T = void> = T | null | undefined | void
4
- export type BindingStringOrRegex = string | RegExp
5
-
6
- export declare class BindingBundleEndEventData {
7
- output: string
8
- duration: number
9
- }
10
-
11
- export declare class BindingCallableBuiltinPlugin {
12
- constructor(plugin: BindingBuiltinPlugin)
13
- resolveId(id: string, importer?: string | undefined | null, options?: BindingHookJsResolveIdOptions | undefined | null): Promise<BindingHookJsResolveIdOutput | null>
14
- load(id: string): Promise<BindingHookJsLoadOutput | null>
15
- watchChange(path: string, event: BindingJsWatchChangeEvent): Promise<void>
16
- }
17
-
18
- export declare class BindingError {
19
- kind: string
20
- message: string
21
- }
22
-
23
- export declare class BindingLog {
24
- code: string
25
- message: string
26
- }
27
-
28
- export declare class BindingModuleInfo {
29
- id: string
30
- importers: Array<string>
31
- dynamicImporters: Array<string>
32
- importedIds: Array<string>
33
- dynamicallyImportedIds: Array<string>
34
- exports: Array<string>
35
- isEntry: boolean
36
- get code(): string | null
37
- }
38
-
39
- export declare class BindingNormalizedOptions {
40
- get input(): Array<string> | Record<string, string>
41
- get cwd(): string | null
42
- get platform(): 'node' | 'browser' | 'neutral'
43
- get shimMissingExports(): boolean
44
- get name(): string | null
45
- get cssEntryFilenames(): string | undefined
46
- get cssChunkFilenames(): string | undefined
47
- get entryFilenames(): string | undefined
48
- get chunkFilenames(): string | undefined
49
- get assetFilenames(): string
50
- get dir(): string | null
51
- get file(): string | null
52
- get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd'
53
- get exports(): 'default' | 'named' | 'none' | 'auto'
54
- get esModule(): boolean | 'if-default-prop'
55
- get inlineDynamicImports(): boolean
56
- get sourcemap(): boolean | 'inline' | 'hidden'
57
- get banner(): string | undefined | null | undefined
58
- get footer(): string | undefined | null | undefined
59
- get intro(): string | undefined | null | undefined
60
- get outro(): string | undefined | null | undefined
61
- get externalLiveBindings(): boolean
62
- get extend(): boolean
63
- get globals(): Record<string, string> | undefined
64
- get hashCharacters(): 'base64' | 'base36' | 'hex'
65
- get sourcemapDebugIds(): boolean
66
- get minify(): boolean
67
- get polyfillRequire(): boolean
68
- get comments(): 'none' | 'preserve-legal'
69
- }
70
-
71
- export declare class BindingOutputAsset {
72
- get fileName(): string
73
- get originalFileName(): string | null
74
- get originalFileNames(): Array<string>
75
- get source(): BindingAssetSource
76
- get name(): string | null
77
- get names(): Array<string>
78
- }
79
-
80
- export declare class BindingOutputChunk {
81
- get isEntry(): boolean
82
- get isDynamicEntry(): boolean
83
- get facadeModuleId(): string | null
84
- get moduleIds(): Array<string>
85
- get exports(): Array<string>
86
- get fileName(): string
87
- get modules(): BindingModules
88
- get imports(): Array<string>
89
- get dynamicImports(): Array<string>
90
- get code(): string
91
- get map(): string | null
92
- get sourcemapFileName(): string | null
93
- get preliminaryFileName(): string
94
- get name(): string
95
- }
96
-
97
- export declare class BindingOutputs {
98
- get chunks(): Array<BindingOutputChunk>
99
- get assets(): Array<BindingOutputAsset>
100
- get errors(): Array<Error | BindingError>
101
- }
102
-
103
- export declare class BindingPluginContext {
104
- load(specifier: string, sideEffects: BindingHookSideEffects | undefined, fn: () => void): Promise<void>
105
- resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null>
106
- emitFile(file: BindingEmittedAsset): string
107
- emitChunk(file: BindingEmittedChunk): string
108
- getFileName(referenceId: string): string
109
- getModuleInfo(moduleId: string): BindingModuleInfo | null
110
- getModuleIds(): Array<string>
111
- addWatchFile(file: string): void
112
- }
113
-
114
- export declare class BindingRenderedModule {
115
- get code(): string | null
116
- }
117
-
118
- export declare class BindingTransformPluginContext {
119
- getCombinedSourcemap(): string
120
- inner(): BindingPluginContext
121
- }
122
-
123
- export declare class BindingWatcher {
124
- constructor(options: Array<BindingBundlerOptions>, notifyOption?: BindingNotifyOption | undefined | null)
125
- close(): Promise<void>
126
- start(listener: (data: BindingWatcherEvent) => void): Promise<void>
127
- }
128
-
129
- export declare class BindingWatcherChangeData {
130
- path: string
131
- kind: string
132
- }
133
-
134
- export declare class BindingWatcherEvent {
135
- eventKind(): string
136
- watchChangeData(): BindingWatcherChangeData
137
- bundleEndData(): BindingBundleEndEventData
138
- bundleEventKind(): string
139
- errors(): Array<Error | BindingError>
140
- }
141
-
142
- export declare class Bundler {
143
- constructor(option: BindingBundlerOptions)
144
- write(): Promise<BindingOutputs>
145
- generate(): Promise<BindingOutputs>
146
- scan(): Promise<BindingOutputs>
147
- close(): Promise<void>
148
- get closed(): boolean
149
- }
150
-
151
- export declare class MagicString {
152
- /** Get source text from utf8 offset. */
153
- getSourceText(start: number, end: number): string
154
- /** Get 0-based line and column number from utf8 offset. */
155
- getLineColumnNumber(offset: number): LineColumn
156
- /** Get UTF16 byte offset from UTF8 byte offset. */
157
- getUtf16ByteOffset(offset: number): number
158
- length(): number
159
- toString(): string
160
- hasChanged(): boolean
161
- append(input: string): this
162
- appendLeft(index: number, input: string): this
163
- appendRight(index: number, input: string): this
164
- indent(): this
165
- prepend(input: string): this
166
- prependLeft(index: number, input: string): this
167
- prependRight(index: number, input: string): this
168
- relocate(start: number, end: number, to: number): this
169
- remove(start: number, end: number): this
170
- generateMap(options?: Partial<GenerateDecodedMapOptions>): {
171
- toString: () => string;
172
- toUrl: () => string;
173
- toMap: () => {
174
- file?: string
175
- mappings: string
176
- names: Array<string>
177
- sourceRoot?: string
178
- sources: Array<string>
179
- sourcesContent?: Array<string>
180
- version: number
181
- x_google_ignoreList?: Array<number>
182
- }
183
- }
184
- }
185
-
186
- export declare class ParallelJsPluginRegistry {
187
- id: number
188
- workerCount: number
189
- constructor(workerCount: number)
190
- }
191
-
192
- export declare class ParseResult {
193
- get program(): import("@oxc-project/types").Program
194
- get module(): EcmaScriptModule
195
- get comments(): Array<Comment>
196
- get errors(): Array<OxcError>
197
- get magicString(): MagicString
198
- }
199
-
200
- export declare class RenderedChunk {
201
- get name(): string
202
- get isEntry(): boolean
203
- get isDynamicEntry(): boolean
204
- get facadeModuleId(): string | null
205
- get moduleIds(): Array<string>
206
- get exports(): Array<string>
207
- get fileName(): string
208
- get modules(): BindingModules
209
- get imports(): Array<string>
210
- get dynamicImports(): Array<string>
211
- }
212
-
213
- export interface AliasItem {
214
- find: string
215
- replacements: Array<string>
216
- }
217
-
218
- export interface ArrowFunctionsOptions {
219
- /**
220
- * This option enables the following:
221
- * * Wrap the generated function in .bind(this) and keeps uses of this inside the function as-is, instead of using a renamed this.
222
- * * Add a runtime check to ensure the functions are not instantiated.
223
- * * Add names to arrow functions.
224
- *
225
- * @default false
226
- */
227
- spec?: boolean
228
- }
229
-
230
- export interface BindingAdvancedChunksOptions {
231
- minSize?: number
232
- minShareCount?: number
233
- groups?: Array<BindingMatchGroup>
234
- maxSize?: number
235
- minModuleSize?: number
236
- maxModuleSize?: number
237
- }
238
-
239
- export interface BindingAliasPluginAlias {
240
- find: BindingStringOrRegex
241
- replacement: string
242
- }
243
-
244
- export interface BindingAliasPluginConfig {
245
- entries: Array<BindingAliasPluginAlias>
246
- }
247
-
248
- export interface BindingAssetSource {
249
- inner: string | Uint8Array
250
- }
251
-
252
- export interface BindingBuildImportAnalysisPluginConfig {
253
- preloadCode: string
254
- insertPreload: boolean
255
- optimizeModulePreloadRelativePaths: boolean
256
- renderBuiltUrl: boolean
257
- isRelativeBase: boolean
258
- }
259
-
260
- export interface BindingBuiltinPlugin {
261
- __name: BindingBuiltinPluginName
262
- options?: unknown
263
- }
264
-
265
- export type BindingBuiltinPluginName = 'builtin:wasm-helper'|
266
- 'builtin:import-glob'|
267
- 'builtin:dynamic-import-vars'|
268
- 'builtin:module-preload-polyfill'|
269
- 'builtin:manifest'|
270
- 'builtin:load-fallback'|
271
- 'builtin:transform'|
272
- 'builtin:wasm-fallback'|
273
- 'builtin:alias'|
274
- 'builtin:json'|
275
- 'builtin:build-import-analysis'|
276
- 'builtin:replace'|
277
- 'builtin:vite-resolve'|
278
- 'builtin:module-federation';
279
-
280
- export interface BindingBundlerOptions {
281
- inputOptions: BindingInputOptions
282
- outputOptions: BindingOutputOptions
283
- parallelPluginsRegistry?: ParallelJsPluginRegistry
284
- }
285
-
286
- export interface BindingChecksOptions {
287
- circularDependency?: boolean
288
- }
289
-
290
- export interface BindingEmittedAsset {
291
- name?: string
292
- fileName?: string
293
- originalFileName?: string
294
- source: BindingAssetSource
295
- }
296
-
297
- export interface BindingEmittedChunk {
298
- name?: string
299
- fileName?: string
300
- id: string
301
- importer?: string
302
- }
303
-
304
- export interface BindingExperimentalOptions {
305
- strictExecutionOrder?: boolean
306
- disableLiveBindings?: boolean
307
- viteMode?: boolean
308
- resolveNewUrlToAsset?: boolean
309
- }
310
-
311
- export interface BindingGeneralHookFilter {
312
- include?: Array<BindingStringOrRegex>
313
- exclude?: Array<BindingStringOrRegex>
314
- }
315
-
316
- export interface BindingGlobImportPluginConfig {
317
- root?: string
318
- restoreQueryExtension?: boolean
319
- }
320
-
321
- export interface BindingHookJsLoadOutput {
322
- code: string
323
- map?: string
324
- sideEffects: boolean | 'no-treeshake'
325
- }
326
-
327
- export interface BindingHookJsResolveIdOptions {
328
- scan?: boolean
329
- }
330
-
331
- export interface BindingHookJsResolveIdOutput {
332
- id: string
333
- external?: boolean
334
- sideEffects: boolean | 'no-treeshake'
335
- }
336
-
337
- export interface BindingHookLoadOutput {
338
- code: string
339
- sideEffects?: BindingHookSideEffects
340
- map?: BindingSourcemap
341
- moduleType?: string
342
- }
343
-
344
- export interface BindingHookRenderChunkOutput {
345
- code: string
346
- map?: BindingSourcemap
347
- }
348
-
349
- export interface BindingHookResolveIdExtraArgs {
350
- custom?: number
351
- isEntry: boolean
352
- kind: 'import' | 'dynamic-import' | 'require-call'
353
- }
354
-
355
- export interface BindingHookResolveIdOutput {
356
- id: string
357
- external?: boolean
358
- sideEffects?: BindingHookSideEffects
359
- }
360
-
361
- export declare enum BindingHookSideEffects {
362
- True = 0,
363
- False = 1,
364
- NoTreeshake = 2
365
- }
366
-
367
- export interface BindingHookTransformOutput {
368
- code?: string
369
- sideEffects?: BindingHookSideEffects
370
- map?: BindingSourcemap
371
- moduleType?: string
372
- }
373
-
374
- export interface BindingInjectImportNamed {
375
- tagNamed: true
376
- imported: string
377
- alias?: string
378
- from: string
379
- }
380
-
381
- export interface BindingInjectImportNamespace {
382
- tagNamespace: true
383
- alias: string
384
- from: string
385
- }
386
-
387
- export interface BindingInputItem {
388
- name?: string
389
- import: string
390
- }
391
-
392
- export interface BindingInputOptions {
393
- external?: undefined | ((source: string, importer: string | undefined, isResolved: boolean) => boolean)
394
- input: Array<BindingInputItem>
395
- plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[]
396
- resolve?: BindingResolveOptions
397
- shimMissingExports?: boolean
398
- platform?: 'node' | 'browser' | 'neutral'
399
- logLevel: BindingLogLevel
400
- onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void
401
- cwd: string
402
- treeshake?: BindingTreeshake
403
- moduleTypes?: Record<string, string>
404
- define?: Array<[string, string]>
405
- dropLabels?: Array<string>
406
- inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace>
407
- experimental?: BindingExperimentalOptions
408
- profilerNames?: boolean
409
- jsx?: BindingJsx
410
- watch?: BindingWatchOption
411
- keepNames?: boolean
412
- checks?: BindingChecksOptions
413
- }
414
-
415
- export interface BindingJsonPluginConfig {
416
- stringify?: BindingJsonPluginStringify
417
- isBuild?: boolean
418
- namedExports?: boolean
419
- }
420
-
421
- export type BindingJsonPluginStringify =
422
- boolean | string
423
-
424
- export interface BindingJsonSourcemap {
425
- file?: string
426
- mappings?: string
427
- sourceRoot?: string
428
- sources?: Array<string | undefined | null>
429
- sourcesContent?: Array<string | undefined | null>
430
- names?: Array<string>
431
- }
432
-
433
- export interface BindingJsWatchChangeEvent {
434
- event: string
435
- }
436
-
437
- export type BindingJsx =
438
- | { type: 'Disable' }
439
- | { type: 'Preserve' }
440
- | { type: 'Enable', field0: JsxOptions }
441
-
442
- export declare enum BindingLogLevel {
443
- Silent = 0,
444
- Warn = 1,
445
- Info = 2,
446
- Debug = 3
447
- }
448
-
449
- export interface BindingManifestPluginConfig {
450
- root: string
451
- outPath: string
452
- }
453
-
454
- export interface BindingMatchGroup {
455
- name: string
456
- test?: BindingStringOrRegex
457
- priority?: number
458
- minSize?: number
459
- minShareCount?: number
460
- minModuleSize?: number
461
- maxModuleSize?: number
462
- maxSize?: number
463
- }
464
-
465
- export interface BindingModuleFederationPluginOption {
466
- name: string
467
- filename?: string
468
- exposes?: Record<string, string>
469
- remotes?: Array<BindingRemote>
470
- shared?: Record<string, BindingShared>
471
- runtimePlugins?: Array<string>
472
- }
473
-
474
- export interface BindingModulePreloadPolyfillPluginConfig {
475
- skip?: boolean
476
- }
477
-
478
- export interface BindingModules {
479
- value: Array<BindingRenderedModule>
480
- idToIndex: Record<string, number>
481
- }
482
-
483
- export interface BindingModuleSideEffectsRule {
484
- test?: RegExp | undefined
485
- sideEffects: boolean
486
- external?: boolean | undefined
487
- }
488
-
489
- export interface BindingNotifyOption {
490
- pollInterval?: number
491
- compareContents?: boolean
492
- }
493
-
494
- export interface BindingOutputOptions {
495
- name?: string
496
- assetFileNames?: string
497
- entryFileNames?: string | ((chunk: PreRenderedChunk) => string)
498
- chunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
499
- cssEntryFileNames?: string | ((chunk: PreRenderedChunk) => string)
500
- cssChunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
501
- banner?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
502
- dir?: string
503
- file?: string
504
- esModule?: boolean | 'if-default-prop'
505
- exports?: 'default' | 'named' | 'none' | 'auto'
506
- extend?: boolean
507
- externalLiveBindings?: boolean
508
- footer?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
509
- format?: 'es' | 'cjs' | 'iife' | 'umd' | 'app'
510
- globals?: Record<string, string> | ((name: string) => string)
511
- hashCharacters?: 'base64' | 'base36' | 'hex'
512
- inlineDynamicImports?: boolean
513
- intro?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
514
- outro?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>
515
- plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[]
516
- sourcemap?: 'file' | 'inline' | 'hidden'
517
- sourcemapIgnoreList?: (source: string, sourcemapPath: string) => boolean
518
- sourcemapDebugIds?: boolean
519
- sourcemapPathTransform?: (source: string, sourcemapPath: string) => string
520
- minify?: boolean
521
- advancedChunks?: BindingAdvancedChunksOptions
522
- comments?: 'none' | 'preserve-legal'
523
- polyfillRequire?: boolean
524
- target?: string
525
- }
526
-
527
- export interface BindingPluginContextResolvedId {
528
- id: string
529
- external: boolean
530
- }
531
-
532
- export interface BindingPluginContextResolveOptions {
533
- importKind?: 'import' | 'dynamic-import' | 'require-call'
534
- skipSelf?: boolean
535
- custom?: number
536
- }
537
-
538
- export interface BindingPluginHookMeta {
539
- order?: BindingPluginOrder
540
- }
541
-
542
- export interface BindingPluginOptions {
543
- name: string
544
- buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable>
545
- buildStartMeta?: BindingPluginHookMeta
546
- resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
547
- resolveIdMeta?: BindingPluginHookMeta
548
- resolveIdFilter?: BindingGeneralHookFilter
549
- resolveDynamicImport?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
550
- resolveDynamicImportMeta?: BindingPluginHookMeta
551
- load?: (ctx: BindingPluginContext, id: string) => MaybePromise<VoidNullable<BindingHookLoadOutput>>
552
- loadMeta?: BindingPluginHookMeta
553
- loadFilter?: BindingGeneralHookFilter
554
- transform?: (ctx: BindingTransformPluginContext, id: string, code: string, module_type: BindingTransformHookExtraArgs) => MaybePromise<VoidNullable<BindingHookTransformOutput>>
555
- transformMeta?: BindingPluginHookMeta
556
- transformFilter?: BindingTransformHookFilter
557
- moduleParsed?: (ctx: BindingPluginContext, module: BindingModuleInfo) => MaybePromise<VoidNullable>
558
- moduleParsedMeta?: BindingPluginHookMeta
559
- buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable>
560
- buildEndMeta?: BindingPluginHookMeta
561
- renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>>
562
- renderChunkMeta?: BindingPluginHookMeta
563
- augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string>
564
- augmentChunkHashMeta?: BindingPluginHookMeta
565
- renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void
566
- renderStartMeta?: BindingPluginHookMeta
567
- renderError?: (ctx: BindingPluginContext, error: (Error | BindingError)[]) => void
568
- renderErrorMeta?: BindingPluginHookMeta
569
- generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>>
570
- generateBundleMeta?: BindingPluginHookMeta
571
- writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>>
572
- writeBundleMeta?: BindingPluginHookMeta
573
- closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>
574
- closeBundleMeta?: BindingPluginHookMeta
575
- watchChange?: (ctx: BindingPluginContext, path: string, event: string) => MaybePromise<VoidNullable>
576
- watchChangeMeta?: BindingPluginHookMeta
577
- closeWatcher?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>
578
- closeWatcherMeta?: BindingPluginHookMeta
579
- banner?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
580
- bannerMeta?: BindingPluginHookMeta
581
- footer?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
582
- footerMeta?: BindingPluginHookMeta
583
- intro?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
584
- introMeta?: BindingPluginHookMeta
585
- outro?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
586
- outroMeta?: BindingPluginHookMeta
587
- }
588
-
589
- export declare enum BindingPluginOrder {
590
- Pre = 0,
591
- Post = 1
592
- }
593
-
594
- export interface BindingPluginWithIndex {
595
- index: number
596
- plugin: BindingPluginOptions
597
- }
598
-
599
- export interface BindingRemote {
600
- type?: string
601
- entry: string
602
- name: string
603
- entryGlobalName?: string
604
- shareScope?: string
605
- }
606
-
607
- export interface BindingReplacePluginConfig {
608
- values: Record<string, string>
609
- delimiters?: [string, string]
610
- preventAssignment?: boolean
611
- objectGuards?: boolean
612
- sourcemap?: boolean
613
- }
614
-
615
- export interface BindingResolveOptions {
616
- alias?: Array<AliasItem>
617
- aliasFields?: Array<Array<string>>
618
- conditionNames?: Array<string>
619
- exportsFields?: Array<Array<string>>
620
- extensions?: Array<string>
621
- extensionAlias?: Array<ExtensionAliasItem>
622
- mainFields?: Array<string>
623
- mainFiles?: Array<string>
624
- modules?: Array<string>
625
- symlinks?: boolean
626
- tsconfigFilename?: string
627
- }
628
-
629
- export interface BindingShared {
630
- version?: string
631
- shareScope?: string
632
- singleton?: boolean
633
- requiredVersion?: string
634
- strictVersion?: boolean
635
- }
636
-
637
- export interface BindingSourcemap {
638
- inner: string | BindingJsonSourcemap
639
- }
640
-
641
- export interface BindingTransformHookExtraArgs {
642
- moduleType: string
643
- }
644
-
645
- export interface BindingTransformHookFilter {
646
- code?: BindingGeneralHookFilter
647
- moduleType?: Array<string>
648
- id?: BindingGeneralHookFilter
649
- }
650
-
651
- export interface BindingTransformPluginConfig {
652
- include?: Array<BindingStringOrRegex>
653
- exclude?: Array<BindingStringOrRegex>
654
- jsxInject?: string
655
- reactRefresh?: boolean
656
- target?: string
657
- browserslist?: string
658
- }
659
-
660
- export interface BindingTreeshake {
661
- moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
662
- annotations?: boolean
663
- }
664
-
665
- export interface BindingViteResolvePluginConfig {
666
- resolveOptions: BindingViteResolvePluginResolveOptions
667
- environmentConsumer: string
668
- environmentName: string
669
- external: true | string[]
670
- noExternal: true | Array<string | RegExp>
671
- dedupe: Array<string>
672
- finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>
673
- finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>
674
- runtime: string
675
- }
676
-
677
- export interface BindingViteResolvePluginResolveOptions {
678
- isBuild: boolean
679
- isProduction: boolean
680
- asSrc: boolean
681
- preferRelative: boolean
682
- isRequire?: boolean
683
- root: string
684
- scan: boolean
685
- mainFields: Array<string>
686
- conditions: Array<string>
687
- externalConditions: Array<string>
688
- extensions: Array<string>
689
- tryIndex: boolean
690
- tryPrefix?: string
691
- preserveSymlinks: boolean
692
- }
693
-
694
- export interface BindingWatchOption {
695
- skipWrite?: boolean
696
- include?: Array<BindingStringOrRegex>
697
- exclude?: Array<BindingStringOrRegex>
698
- }
699
-
700
- export interface Comment {
701
- type: 'Line' | 'Block'
702
- value: string
703
- start: number
704
- end: number
705
- }
706
-
707
- export interface CompilerAssumptions {
708
- ignoreFunctionLength?: boolean
709
- noDocumentAll?: boolean
710
- objectRestNoSymbols?: boolean
711
- pureGetters?: boolean
712
- setPublicClassFields?: boolean
713
- }
714
-
715
- export interface DynamicImport {
716
- start: number
717
- end: number
718
- moduleRequest: Span
719
- }
720
-
721
- export interface EcmaScriptModule {
722
- /**
723
- * Has ESM syntax.
724
- *
725
- * i.e. `import` and `export` statements, and `import.meta`.
726
- *
727
- * Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files.
728
- */
729
- hasModuleSyntax: boolean
730
- /** Import statements. */
731
- staticImports: Array<StaticImport>
732
- /** Export statements. */
733
- staticExports: Array<StaticExport>
734
- /** Dynamic import expressions. */
735
- dynamicImports: Array<DynamicImport>
736
- /** Span positions` of `import.meta` */
737
- importMetas: Array<Span>
738
- }
739
-
740
- export interface ErrorLabel {
741
- message?: string
742
- start: number
743
- end: number
744
- }
745
-
746
- export interface Es2015Options {
747
- /** Transform arrow functions into function expressions. */
748
- arrowFunction?: ArrowFunctionsOptions
749
- }
750
-
751
- export interface ExportExportName {
752
- kind: ExportExportNameKind
753
- name?: string
754
- start?: number
755
- end?: number
756
- }
757
-
758
- export type ExportExportNameKind = /** `export { name } */
759
- 'Name'|
760
- /** `export default expression` */
761
- 'Default'|
762
- /** `export * from "mod" */
763
- 'None';
764
-
765
- export interface ExportImportName {
766
- kind: ExportImportNameKind
767
- name?: string
768
- start?: number
769
- end?: number
770
- }
771
-
772
- export type ExportImportNameKind = /** `export { name } */
773
- 'Name'|
774
- /** `export * as ns from "mod"` */
775
- 'All'|
776
- /** `export * from "mod"` */
777
- 'AllButDefault'|
778
- /** Does not have a specifier. */
779
- 'None';
780
-
781
- export interface ExportLocalName {
782
- kind: ExportLocalNameKind
783
- name?: string
784
- start?: number
785
- end?: number
786
- }
787
-
788
- export type ExportLocalNameKind = /** `export { name } */
789
- 'Name'|
790
- /** `export default expression` */
791
- 'Default'|
792
- /**
793
- * If the exported value is not locally accessible from within the module.
794
- * `export default function () {}`
795
- */
796
- 'None';
797
-
798
- export interface ExtensionAliasItem {
799
- target: string
800
- replacements: Array<string>
801
- }
802
-
803
- export interface GenerateDecodedMapOptions {
804
- /** The filename of the file containing the original source. */
805
- source?: string
806
- /** Whether to include the original content in the map's `sourcesContent` array. */
807
- includeContent: boolean
808
- /** Whether the mapping should be high-resolution. */
809
- hires: boolean | 'boundary'
810
- }
811
-
812
- export type HelperMode = /**
813
- * Runtime mode (default): Helper functions are imported from a runtime package.
814
- *
815
- * Example:
816
- *
817
- * ```js
818
- * import helperName from "@babel/runtime/helpers/helperName";
819
- * helperName(...arguments);
820
- * ```
821
- */
822
- 'Runtime'|
823
- /**
824
- * External mode: Helper functions are accessed from a global `babelHelpers` object.
825
- *
826
- * Example:
827
- *
828
- * ```js
829
- * babelHelpers.helperName(...arguments);
830
- * ```
831
- */
832
- 'External';
833
-
834
- export interface Helpers {
835
- mode?: HelperMode
836
- }
837
-
838
- export interface ImportName {
839
- kind: ImportNameKind
840
- name?: string
841
- start?: number
842
- end?: number
843
- }
844
-
845
- export type ImportNameKind = /** `import { x } from "mod"` */
846
- 'Name'|
847
- /** `import * as ns from "mod"` */
848
- 'NamespaceObject'|
849
- /** `import defaultExport from "mod"` */
850
- 'Default';
851
-
852
- /** TypeScript Isolated Declarations for Standalone DTS Emit */
853
- export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
854
-
855
- export interface IsolatedDeclarationsOptions {
856
- /**
857
- * Do not emit declarations for code that has an @internal annotation in its JSDoc comment.
858
- * This is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid.
859
- *
860
- * Default: `false`
861
- *
862
- * See <https://www.typescriptlang.org/tsconfig/#stripInternal>
863
- */
864
- stripInternal?: boolean
865
- sourcemap?: boolean
866
- }
867
-
868
- export interface IsolatedDeclarationsResult {
869
- code: string
870
- map?: SourceMap
871
- errors: Array<OxcError>
872
- }
873
-
874
- export interface JsChangedOutputs {
875
- chunks: Array<JsOutputChunk>
876
- assets: Array<JsOutputAsset>
877
- deleted: Array<string>
878
- }
879
-
880
- export interface JsOutputAsset {
881
- names: Array<string>
882
- originalFileNames: Array<string>
883
- filename: string
884
- source: BindingAssetSource
885
- }
886
-
887
- export interface JsOutputChunk {
888
- name: string
889
- isEntry: boolean
890
- isDynamicEntry: boolean
891
- facadeModuleId?: string
892
- moduleIds: Array<string>
893
- exports: Array<string>
894
- filename: string
895
- modules: Record<string, BindingRenderedModule>
896
- imports: Array<string>
897
- dynamicImports: Array<string>
898
- code: string
899
- map?: BindingSourcemap
900
- sourcemapFilename?: string
901
- preliminaryFilename: string
902
- }
903
-
904
- /**
905
- * Configure how TSX and JSX are transformed.
906
- *
907
- * @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
908
- */
909
- export interface JsxOptions {
910
- /**
911
- * Decides which runtime to use.
912
- *
913
- * - 'automatic' - auto-import the correct JSX factories
914
- * - 'classic' - no auto-import
915
- *
916
- * @default 'automatic'
917
- */
918
- runtime?: 'classic' | 'automatic'
919
- /**
920
- * Emit development-specific information, such as `__source` and `__self`.
921
- *
922
- * @default false
923
- *
924
- * @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
925
- */
926
- development?: boolean
927
- /**
928
- * Toggles whether or not to throw an error if an XML namespaced tag name
929
- * is used.
930
- *
931
- * Though the JSX spec allows this, it is disabled by default since React's
932
- * JSX does not currently have support for it.
933
- *
934
- * @default true
935
- */
936
- throwIfNamespace?: boolean
937
- /**
938
- * Enables `@babel/plugin-transform-react-pure-annotations`.
939
- *
940
- * It will mark top-level React method calls as pure for tree shaking.
941
- *
942
- * @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations}
943
- *
944
- * @default true
945
- */
946
- pure?: boolean
947
- /**
948
- * Replaces the import source when importing functions.
949
- *
950
- * @default 'react'
951
- */
952
- importSource?: string
953
- /**
954
- * Replace the function used when compiling JSX expressions. It should be a
955
- * qualified name (e.g. `React.createElement`) or an identifier (e.g.
956
- * `createElement`).
957
- *
958
- * Only used for `classic` {@link runtime}.
959
- *
960
- * @default 'React.createElement'
961
- */
962
- pragma?: string
963
- /**
964
- * Replace the component used when compiling JSX fragments. It should be a
965
- * valid JSX tag name.
966
- *
967
- * Only used for `classic` {@link runtime}.
968
- *
969
- * @default 'React.Fragment'
970
- */
971
- pragmaFrag?: string
972
- /**
973
- * When spreading props, use `Object.assign` directly instead of an extend helper.
974
- *
975
- * Only used for `classic` {@link runtime}.
976
- *
977
- * @default false
978
- */
979
- useBuiltIns?: boolean
980
- /**
981
- * When spreading props, use inline object with spread elements directly
982
- * instead of an extend helper or Object.assign.
983
- *
984
- * Only used for `classic` {@link runtime}.
985
- *
986
- * @default false
987
- */
988
- useSpread?: boolean
989
- /**
990
- * Enable React Fast Refresh .
991
- *
992
- * Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh}
993
- *
994
- * @default false
995
- */
996
- refresh?: boolean | ReactRefreshOptions
997
- }
998
-
999
- export interface LineColumn {
1000
- line: number
1001
- column: number
1002
- }
1003
-
1004
- export interface OverwriteOptions {
1005
- contentOnly: boolean
1006
- }
1007
-
1008
- export interface OxcError {
1009
- severity: Severity
1010
- message: string
1011
- labels: Array<ErrorLabel>
1012
- helpMessage?: string
1013
- }
1014
-
1015
- /**
1016
- * Parse asynchronously.
1017
- *
1018
- * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
1019
- */
1020
- export declare function parseAsync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>
1021
-
1022
- export interface ParserOptions {
1023
- sourceType?: 'script' | 'module' | 'unambiguous' | undefined
1024
- /** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
1025
- lang?: 'js' | 'jsx' | 'ts' | 'tsx'
1026
- /**
1027
- * Emit `ParenthesizedExpression` in AST.
1028
- *
1029
- * If this option is true, parenthesized expressions are represented by
1030
- * (non-standard) `ParenthesizedExpression` nodes that have a single `expression` property
1031
- * containing the expression inside parentheses.
1032
- *
1033
- * Default: true
1034
- */
1035
- preserveParens?: boolean
1036
- }
1037
-
1038
- /** Parse synchronously. */
1039
- export declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): ParseResult
1040
-
1041
- /**
1042
- * Parse without returning anything.
1043
- *
1044
- * This is for benchmark purposes such as measuring napi communication overhead.
1045
- */
1046
- export declare function parseWithoutReturn(filename: string, sourceText: string, options?: ParserOptions | undefined | null): void
1047
-
1048
- export interface PreRenderedChunk {
1049
- name: string
1050
- isEntry: boolean
1051
- isDynamicEntry: boolean
1052
- facadeModuleId?: string
1053
- moduleIds: Array<string>
1054
- exports: Array<string>
1055
- }
1056
-
1057
- export interface ReactRefreshOptions {
1058
- /**
1059
- * Specify the identifier of the refresh registration variable.
1060
- *
1061
- * @default `$RefreshReg$`.
1062
- */
1063
- refreshReg?: string
1064
- /**
1065
- * Specify the identifier of the refresh signature variable.
1066
- *
1067
- * @default `$RefreshSig$`.
1068
- */
1069
- refreshSig?: string
1070
- emitFullSignatures?: boolean
1071
- }
1072
-
1073
- export declare function registerPlugins(id: number, plugins: Array<BindingPluginWithIndex>): void
1074
-
1075
- export type Severity = 'Error'|
1076
- 'Warning'|
1077
- 'Advice';
1078
-
1079
- export interface SourceMap {
1080
- file?: string
1081
- mappings: string
1082
- names: Array<string>
1083
- sourceRoot?: string
1084
- sources: Array<string>
1085
- sourcesContent?: Array<string>
1086
- version: number
1087
- x_google_ignoreList?: Array<number>
1088
- }
1089
-
1090
- export interface SourceMapOptions {
1091
- includeContent?: boolean
1092
- source?: string
1093
- hires?: boolean
1094
- }
1095
-
1096
- export interface Span {
1097
- start: number
1098
- end: number
1099
- }
1100
-
1101
- export interface StaticExport {
1102
- start: number
1103
- end: number
1104
- entries: Array<StaticExportEntry>
1105
- }
1106
-
1107
- export interface StaticExportEntry {
1108
- start: number
1109
- end: number
1110
- moduleRequest?: ValueSpan
1111
- /** The name under which the desired binding is exported by the module`. */
1112
- importName: ExportImportName
1113
- /** The name used to export this binding by this module. */
1114
- exportName: ExportExportName
1115
- /** The name that is used to locally access the exported value from within the importing module. */
1116
- localName: ExportLocalName
1117
- }
1118
-
1119
- export interface StaticImport {
1120
- /** Start of import statement. */
1121
- start: number
1122
- /** End of import statement. */
1123
- end: number
1124
- /**
1125
- * Import source.
1126
- *
1127
- * ```js
1128
- * import { foo } from "mod";
1129
- * // ^^^
1130
- * ```
1131
- */
1132
- moduleRequest: ValueSpan
1133
- /**
1134
- * Import specifiers.
1135
- *
1136
- * Empty for `import "mod"`.
1137
- */
1138
- entries: Array<StaticImportEntry>
1139
- }
1140
-
1141
- export interface StaticImportEntry {
1142
- /**
1143
- * The name under which the desired binding is exported by the module.
1144
- *
1145
- * ```js
1146
- * import { foo } from "mod";
1147
- * // ^^^
1148
- * import { foo as bar } from "mod";
1149
- * // ^^^
1150
- * ```
1151
- */
1152
- importName: ImportName
1153
- /**
1154
- * The name that is used to locally access the imported value from within the importing module.
1155
- * ```js
1156
- * import { foo } from "mod";
1157
- * // ^^^
1158
- * import { foo as bar } from "mod";
1159
- * // ^^^
1160
- * ```
1161
- */
1162
- localName: ValueSpan
1163
- /**
1164
- * Whether this binding is for a TypeScript type-only import.
1165
- *
1166
- * `true` for the following imports:
1167
- * ```ts
1168
- * import type { foo } from "mod";
1169
- * import { type foo } from "mod";
1170
- * ```
1171
- */
1172
- isType: boolean
1173
- }
1174
-
1175
- /**
1176
- * Transpile a JavaScript or TypeScript into a target ECMAScript version.
1177
- *
1178
- * @param filename The name of the file being transformed. If this is a
1179
- * relative path, consider setting the {@link TransformOptions#cwd} option..
1180
- * @param sourceText the source code itself
1181
- * @param options The options for the transformation. See {@link
1182
- * TransformOptions} for more information.
1183
- *
1184
- * @returns an object containing the transformed code, source maps, and any
1185
- * errors that occurred during parsing or transformation.
1186
- */
1187
- export declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult
1188
-
1189
- /**
1190
- * Options for transforming a JavaScript or TypeScript file.
1191
- *
1192
- * @see {@link transform}
1193
- */
1194
- export interface TransformOptions {
1195
- sourceType?: 'script' | 'module' | 'unambiguous' | undefined
1196
- /** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
1197
- lang?: 'js' | 'jsx' | 'ts' | 'tsx'
1198
- /**
1199
- * The current working directory. Used to resolve relative paths in other
1200
- * options.
1201
- */
1202
- cwd?: string
1203
- /**
1204
- * Enable source map generation.
1205
- *
1206
- * When `true`, the `sourceMap` field of transform result objects will be populated.
1207
- *
1208
- * @default false
1209
- *
1210
- * @see {@link SourceMap}
1211
- */
1212
- sourcemap?: boolean
1213
- /** Set assumptions in order to produce smaller output. */
1214
- assumptions?: CompilerAssumptions
1215
- /** Configure how TypeScript is transformed. */
1216
- typescript?: TypeScriptOptions
1217
- /** Configure how TSX and JSX are transformed. */
1218
- jsx?: 'preserve' | JsxOptions
1219
- /**
1220
- * Sets the target environment for the generated JavaScript.
1221
- *
1222
- * The lowest target is `es2015`.
1223
- *
1224
- * Example:
1225
- *
1226
- * * 'es2015'
1227
- * * ['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']
1228
- *
1229
- * @default `esnext` (No transformation)
1230
- *
1231
- * @see [esbuild#target](https://esbuild.github.io/api/#target)
1232
- */
1233
- target?: string | Array<string>
1234
- /** Behaviour for runtime helpers. */
1235
- helpers?: Helpers
1236
- /** Define Plugin */
1237
- define?: Record<string, string>
1238
- /** Inject Plugin */
1239
- inject?: Record<string, string | [string, string]>
1240
- }
1241
-
1242
- export interface TransformResult {
1243
- /**
1244
- * The transformed code.
1245
- *
1246
- * If parsing failed, this will be an empty string.
1247
- */
1248
- code: string
1249
- /**
1250
- * The source map for the transformed code.
1251
- *
1252
- * This will be set if {@link TransformOptions#sourcemap} is `true`.
1253
- */
1254
- map?: SourceMap
1255
- /**
1256
- * The `.d.ts` declaration file for the transformed code. Declarations are
1257
- * only generated if `declaration` is set to `true` and a TypeScript file
1258
- * is provided.
1259
- *
1260
- * If parsing failed and `declaration` is set, this will be an empty string.
1261
- *
1262
- * @see {@link TypeScriptOptions#declaration}
1263
- * @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration)
1264
- */
1265
- declaration?: string
1266
- /**
1267
- * Declaration source map. Only generated if both
1268
- * {@link TypeScriptOptions#declaration declaration} and
1269
- * {@link TransformOptions#sourcemap sourcemap} are set to `true`.
1270
- */
1271
- declarationMap?: SourceMap
1272
- /**
1273
- * Helpers used.
1274
- *
1275
- * @internal
1276
- *
1277
- * Example:
1278
- *
1279
- * ```text
1280
- * { "_objectSpread": "@babel/runtime/helpers/objectSpread2" }
1281
- * ```
1282
- */
1283
- helpersUsed: Record<string, string>
1284
- /**
1285
- * Parse and transformation errors.
1286
- *
1287
- * Oxc's parser recovers from common syntax errors, meaning that
1288
- * transformed code may still be available even if there are errors in this
1289
- * list.
1290
- */
1291
- errors: Array<OxcError>
1292
- }
1293
-
1294
- export interface TypeScriptOptions {
1295
- jsxPragma?: string
1296
- jsxPragmaFrag?: string
1297
- onlyRemoveTypeImports?: boolean
1298
- allowNamespaces?: boolean
1299
- allowDeclareFields?: boolean
1300
- /**
1301
- * Also generate a `.d.ts` declaration file for TypeScript files.
1302
- *
1303
- * The source file must be compliant with all
1304
- * [`isolatedDeclarations`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations)
1305
- * requirements.
1306
- *
1307
- * @default false
1308
- */
1309
- declaration?: IsolatedDeclarationsOptions
1310
- /**
1311
- * Rewrite or remove TypeScript import/export declaration extensions.
1312
- *
1313
- * - When set to `rewrite`, it will change `.ts`, `.mts`, `.cts` extensions to `.js`, `.mjs`, `.cjs` respectively.
1314
- * - When set to `remove`, it will remove `.ts`/`.mts`/`.cts`/`.tsx` extension entirely.
1315
- * - When set to `true`, it's equivalent to `rewrite`.
1316
- * - When set to `false` or omitted, no changes will be made to the extensions.
1317
- *
1318
- * @default false
1319
- */
1320
- rewriteImportExtensions?: 'rewrite' | 'remove' | boolean
1321
- }
1322
-
1323
- export interface ValueSpan {
1324
- value: string
1325
- start: number
1326
- end: number
1327
- }