@rollipop/rolldown 0.0.0 → 1.0.0-rc.10

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 (50) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +11 -1
  3. package/bin/cli.mjs +2 -0
  4. package/dist/cli.d.mts +1 -0
  5. package/dist/cli.mjs +1191 -0
  6. package/dist/config.d.mts +14 -0
  7. package/dist/config.mjs +4 -0
  8. package/dist/experimental-index.d.mts +316 -0
  9. package/dist/experimental-index.mjs +350 -0
  10. package/dist/experimental-runtime-types.d.ts +98 -0
  11. package/dist/filter-index.d.mts +196 -0
  12. package/dist/filter-index.mjs +386 -0
  13. package/dist/get-log-filter.d.mts +3 -0
  14. package/dist/get-log-filter.mjs +68 -0
  15. package/dist/index.d.mts +4 -0
  16. package/dist/index.mjs +50 -0
  17. package/dist/parallel-plugin-worker.d.mts +1 -0
  18. package/dist/parallel-plugin-worker.mjs +28 -0
  19. package/dist/parallel-plugin.d.mts +13 -0
  20. package/dist/parallel-plugin.mjs +6 -0
  21. package/dist/parse-ast-index.d.mts +32 -0
  22. package/dist/parse-ast-index.mjs +60 -0
  23. package/dist/plugins-index.d.mts +33 -0
  24. package/dist/plugins-index.mjs +40 -0
  25. package/dist/shared/binding-D_jQsHun.mjs +583 -0
  26. package/dist/shared/binding-hSQGgsUz.d.mts +1877 -0
  27. package/dist/shared/bindingify-input-options-DfXGy4QO.mjs +2193 -0
  28. package/dist/shared/constructors-B-HbV10G.mjs +68 -0
  29. package/dist/shared/constructors-DMl58KN5.d.mts +37 -0
  30. package/dist/shared/define-config-BSxBeCq6.d.mts +3810 -0
  31. package/dist/shared/define-config-DJOr6Iwt.mjs +6 -0
  32. package/dist/shared/error-D5tMcn3l.mjs +85 -0
  33. package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
  34. package/dist/shared/load-config-CNjYgiQv.mjs +120 -0
  35. package/dist/shared/logging-C6h4g8dA.d.mts +50 -0
  36. package/dist/shared/logs-D80CXhvg.mjs +180 -0
  37. package/dist/shared/misc-DJYbNKZX.mjs +21 -0
  38. package/dist/shared/normalize-string-or-regex-B8PEhdn1.mjs +66 -0
  39. package/dist/shared/parse-iQx2ihYn.mjs +74 -0
  40. package/dist/shared/prompt-BYQIwEjg.mjs +845 -0
  41. package/dist/shared/resolve-tsconfig-CxoM-bno.mjs +113 -0
  42. package/dist/shared/rolldown-C0o3hS3w.mjs +40 -0
  43. package/dist/shared/rolldown-build-80GULIOI.mjs +3326 -0
  44. package/dist/shared/transform-DY2pi3Qm.d.mts +149 -0
  45. package/dist/shared/watch-C2am0Ahc.mjs +374 -0
  46. package/dist/utils-index.d.mts +376 -0
  47. package/dist/utils-index.mjs +2414 -0
  48. package/package.json +130 -2
  49. package/.editorconfig +0 -10
  50. package/.gitattributes +0 -4
@@ -0,0 +1,1877 @@
1
+ import * as _oxc_project_types0 from "@oxc-project/types";
2
+
3
+ //#region src/binding.d.cts
4
+ type MaybePromise<T> = T | Promise<T>;
5
+ type VoidNullable<T = void> = T | null | undefined | void;
6
+ type BindingStringOrRegex = string | RegExp;
7
+ interface CodegenOptions {
8
+ /**
9
+ * Remove whitespace.
10
+ *
11
+ * @default true
12
+ */
13
+ removeWhitespace?: boolean;
14
+ }
15
+ interface CompressOptions {
16
+ /**
17
+ * Set desired EcmaScript standard version for output.
18
+ *
19
+ * Set `esnext` to enable all target highering.
20
+ *
21
+ * Example:
22
+ *
23
+ * * `'es2015'`
24
+ * * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
25
+ *
26
+ * @default 'esnext'
27
+ *
28
+ * @see [esbuild#target](https://esbuild.github.io/api/#target)
29
+ */
30
+ target?: string | Array<string>;
31
+ /**
32
+ * Pass true to discard calls to `console.*`.
33
+ *
34
+ * @default false
35
+ */
36
+ dropConsole?: boolean;
37
+ /**
38
+ * Remove `debugger;` statements.
39
+ *
40
+ * @default true
41
+ */
42
+ dropDebugger?: boolean;
43
+ /**
44
+ * Pass `true` to drop unreferenced functions and variables.
45
+ *
46
+ * Simple direct variable assignments do not count as references unless set to `keep_assign`.
47
+ * @default true
48
+ */
49
+ unused?: boolean | 'keep_assign';
50
+ /** Keep function / class names. */
51
+ keepNames?: CompressOptionsKeepNames;
52
+ /**
53
+ * Join consecutive var, let and const statements.
54
+ *
55
+ * @default true
56
+ */
57
+ joinVars?: boolean;
58
+ /**
59
+ * Join consecutive simple statements using the comma operator.
60
+ *
61
+ * `a; b` -> `a, b`
62
+ *
63
+ * @default true
64
+ */
65
+ sequences?: boolean;
66
+ /**
67
+ * Set of label names to drop from the code.
68
+ *
69
+ * Labeled statements matching these names will be removed during minification.
70
+ *
71
+ * @default []
72
+ */
73
+ dropLabels?: Array<string>;
74
+ /** Limit the maximum number of iterations for debugging purpose. */
75
+ maxIterations?: number;
76
+ /** Treeshake options. */
77
+ treeshake?: TreeShakeOptions;
78
+ }
79
+ interface CompressOptionsKeepNames {
80
+ /**
81
+ * Keep function names so that `Function.prototype.name` is preserved.
82
+ *
83
+ * This does not guarantee that the `undefined` name is preserved.
84
+ *
85
+ * @default false
86
+ */
87
+ function: boolean;
88
+ /**
89
+ * Keep class names so that `Class.prototype.name` is preserved.
90
+ *
91
+ * This does not guarantee that the `undefined` name is preserved.
92
+ *
93
+ * @default false
94
+ */
95
+ class: boolean;
96
+ }
97
+ interface MangleOptions {
98
+ /**
99
+ * Pass `true` to mangle names declared in the top level scope.
100
+ *
101
+ * @default true for modules and commonjs, otherwise false
102
+ */
103
+ toplevel?: boolean;
104
+ /**
105
+ * Preserve `name` property for functions and classes.
106
+ *
107
+ * @default false
108
+ */
109
+ keepNames?: boolean | MangleOptionsKeepNames;
110
+ /** Debug mangled names. */
111
+ debug?: boolean;
112
+ }
113
+ interface MangleOptionsKeepNames {
114
+ /**
115
+ * Preserve `name` property for functions.
116
+ *
117
+ * @default false
118
+ */
119
+ function: boolean;
120
+ /**
121
+ * Preserve `name` property for classes.
122
+ *
123
+ * @default false
124
+ */
125
+ class: boolean;
126
+ }
127
+ interface MinifyOptions {
128
+ /** Use when minifying an ES module. */
129
+ module?: boolean;
130
+ compress?: boolean | CompressOptions;
131
+ mangle?: boolean | MangleOptions;
132
+ codegen?: boolean | CodegenOptions;
133
+ sourcemap?: boolean;
134
+ }
135
+ interface MinifyResult {
136
+ code: string;
137
+ map?: SourceMap;
138
+ errors: Array<OxcError>;
139
+ }
140
+ interface TreeShakeOptions {
141
+ /**
142
+ * Whether to respect the pure annotations.
143
+ *
144
+ * Pure annotations are comments that mark an expression as pure.
145
+ * For example: @__PURE__ or #__NO_SIDE_EFFECTS__.
146
+ *
147
+ * @default true
148
+ */
149
+ annotations?: boolean;
150
+ /**
151
+ * Whether to treat this function call as pure.
152
+ *
153
+ * This function is called for normal function calls, new calls, and
154
+ * tagged template calls.
155
+ */
156
+ manualPureFunctions?: Array<string>;
157
+ /**
158
+ * Whether property read accesses have side effects.
159
+ *
160
+ * @default 'always'
161
+ */
162
+ propertyReadSideEffects?: boolean | 'always';
163
+ /**
164
+ * Whether accessing a global variable has side effects.
165
+ *
166
+ * Accessing a non-existing global variable will throw an error.
167
+ * Global variable may be a getter that has side effects.
168
+ *
169
+ * @default true
170
+ */
171
+ unknownGlobalSideEffects?: boolean;
172
+ /**
173
+ * Whether invalid import statements have side effects.
174
+ *
175
+ * Accessing a non-existing import name will throw an error.
176
+ * Also import statements that cannot be resolved will throw an error.
177
+ *
178
+ * @default true
179
+ */
180
+ invalidImportSideEffects?: boolean;
181
+ }
182
+ interface Comment {
183
+ type: 'Line' | 'Block';
184
+ value: string;
185
+ start: number;
186
+ end: number;
187
+ }
188
+ interface ErrorLabel {
189
+ message: string | null;
190
+ start: number;
191
+ end: number;
192
+ }
193
+ interface OxcError {
194
+ severity: Severity;
195
+ message: string;
196
+ labels: Array<ErrorLabel>;
197
+ helpMessage: string | null;
198
+ codeframe: string | null;
199
+ }
200
+ type Severity = 'Error' | 'Warning' | 'Advice';
201
+ declare class ParseResult {
202
+ get program(): _oxc_project_types0.Program;
203
+ get module(): EcmaScriptModule;
204
+ get comments(): Array<Comment>;
205
+ get errors(): Array<OxcError>;
206
+ }
207
+ interface DynamicImport {
208
+ start: number;
209
+ end: number;
210
+ moduleRequest: Span;
211
+ }
212
+ interface EcmaScriptModule {
213
+ /**
214
+ * Has ESM syntax.
215
+ *
216
+ * i.e. `import` and `export` statements, and `import.meta`.
217
+ *
218
+ * Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files.
219
+ */
220
+ hasModuleSyntax: boolean;
221
+ /** Import statements. */
222
+ staticImports: Array<StaticImport>;
223
+ /** Export statements. */
224
+ staticExports: Array<StaticExport>;
225
+ /** Dynamic import expressions. */
226
+ dynamicImports: Array<DynamicImport>;
227
+ /** Span positions` of `import.meta` */
228
+ importMetas: Array<Span>;
229
+ }
230
+ interface ExportExportName {
231
+ kind: ExportExportNameKind;
232
+ name: string | null;
233
+ start: number | null;
234
+ end: number | null;
235
+ }
236
+ type ExportExportNameKind = /** `export { name } */'Name' | /** `export default expression` */'Default' | /** `export * from "mod" */'None';
237
+ interface ExportImportName {
238
+ kind: ExportImportNameKind;
239
+ name: string | null;
240
+ start: number | null;
241
+ end: number | null;
242
+ }
243
+ type ExportImportNameKind = /** `export { name } */'Name' | /** `export * as ns from "mod"` */'All' | /** `export * from "mod"` */'AllButDefault' | /** Does not have a specifier. */'None';
244
+ interface ExportLocalName {
245
+ kind: ExportLocalNameKind;
246
+ name: string | null;
247
+ start: number | null;
248
+ end: number | null;
249
+ }
250
+ type ExportLocalNameKind = /** `export { name } */'Name' | /** `export default expression` */'Default' |
251
+ /**
252
+ * If the exported value is not locally accessible from within the module.
253
+ * `export default function () {}`
254
+ */
255
+ 'None';
256
+ interface ImportName {
257
+ kind: ImportNameKind;
258
+ name: string | null;
259
+ start: number | null;
260
+ end: number | null;
261
+ }
262
+ type ImportNameKind = /** `import { x } from "mod"` */'Name' | /** `import * as ns from "mod"` */'NamespaceObject' | /** `import defaultExport from "mod"` */'Default';
263
+ interface ParserOptions {
264
+ /** Treat the source text as `js`, `jsx`, `ts`, `tsx` or `dts`. */
265
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts';
266
+ /** Treat the source text as `script` or `module` code. */
267
+ sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous' | undefined;
268
+ /**
269
+ * Return an AST which includes TypeScript-related properties, or excludes them.
270
+ *
271
+ * `'js'` is default for JS / JSX files.
272
+ * `'ts'` is default for TS / TSX files.
273
+ * The type of the file is determined from `lang` option, or extension of provided `filename`.
274
+ */
275
+ astType?: 'js' | 'ts';
276
+ /**
277
+ * Controls whether the `range` property is included on AST nodes.
278
+ * The `range` property is a `[number, number]` which indicates the start/end offsets
279
+ * of the node in the file contents.
280
+ *
281
+ * @default false
282
+ */
283
+ range?: boolean;
284
+ /**
285
+ * Emit `ParenthesizedExpression` and `TSParenthesizedType` in AST.
286
+ *
287
+ * If this option is true, parenthesized expressions are represented by
288
+ * (non-standard) `ParenthesizedExpression` and `TSParenthesizedType` nodes that
289
+ * have a single `expression` property containing the expression inside parentheses.
290
+ *
291
+ * @default true
292
+ */
293
+ preserveParens?: boolean;
294
+ /**
295
+ * Produce semantic errors with an additional AST pass.
296
+ * Semantic errors depend on symbols and scopes, where the parser does not construct.
297
+ * This adds a small performance overhead.
298
+ *
299
+ * @default false
300
+ */
301
+ showSemanticErrors?: boolean;
302
+ }
303
+ interface Span {
304
+ start: number;
305
+ end: number;
306
+ }
307
+ interface StaticExport {
308
+ start: number;
309
+ end: number;
310
+ entries: Array<StaticExportEntry>;
311
+ }
312
+ interface StaticExportEntry {
313
+ start: number;
314
+ end: number;
315
+ moduleRequest: ValueSpan | null;
316
+ /** The name under which the desired binding is exported by the module`. */
317
+ importName: ExportImportName;
318
+ /** The name used to export this binding by this module. */
319
+ exportName: ExportExportName;
320
+ /** The name that is used to locally access the exported value from within the importing module. */
321
+ localName: ExportLocalName;
322
+ /**
323
+ * Whether the export is a TypeScript `export type`.
324
+ *
325
+ * Examples:
326
+ *
327
+ * ```ts
328
+ * export type * from 'mod';
329
+ * export type * as ns from 'mod';
330
+ * export type { foo };
331
+ * export { type foo }:
332
+ * export type { foo } from 'mod';
333
+ * ```
334
+ */
335
+ isType: boolean;
336
+ }
337
+ interface StaticImport {
338
+ /** Start of import statement. */
339
+ start: number;
340
+ /** End of import statement. */
341
+ end: number;
342
+ /**
343
+ * Import source.
344
+ *
345
+ * ```js
346
+ * import { foo } from "mod";
347
+ * // ^^^
348
+ * ```
349
+ */
350
+ moduleRequest: ValueSpan;
351
+ /**
352
+ * Import specifiers.
353
+ *
354
+ * Empty for `import "mod"`.
355
+ */
356
+ entries: Array<StaticImportEntry>;
357
+ }
358
+ interface StaticImportEntry {
359
+ /**
360
+ * The name under which the desired binding is exported by the module.
361
+ *
362
+ * ```js
363
+ * import { foo } from "mod";
364
+ * // ^^^
365
+ * import { foo as bar } from "mod";
366
+ * // ^^^
367
+ * ```
368
+ */
369
+ importName: ImportName;
370
+ /**
371
+ * The name that is used to locally access the imported value from within the importing module.
372
+ * ```js
373
+ * import { foo } from "mod";
374
+ * // ^^^
375
+ * import { foo as bar } from "mod";
376
+ * // ^^^
377
+ * ```
378
+ */
379
+ localName: ValueSpan;
380
+ /**
381
+ * Whether this binding is for a TypeScript type-only import.
382
+ *
383
+ * `true` for the following imports:
384
+ * ```ts
385
+ * import type { foo } from "mod";
386
+ * import { type foo } from "mod";
387
+ * ```
388
+ */
389
+ isType: boolean;
390
+ }
391
+ interface ValueSpan {
392
+ value: string;
393
+ start: number;
394
+ end: number;
395
+ }
396
+ declare class ResolverFactory {
397
+ constructor(options?: NapiResolveOptions | undefined | null);
398
+ static default(): ResolverFactory;
399
+ /** Clone the resolver using the same underlying cache. */
400
+ cloneWithOptions(options: NapiResolveOptions): ResolverFactory;
401
+ /**
402
+ * Clear the underlying cache.
403
+ *
404
+ * Warning: The caller must ensure that there're no ongoing resolution operations when calling this method. Otherwise, it may cause those operations to return an incorrect result.
405
+ */
406
+ clearCache(): void;
407
+ /** Synchronously resolve `specifier` at an absolute path to a `directory`. */
408
+ sync(directory: string, request: string): ResolveResult;
409
+ /** Asynchronously resolve `specifier` at an absolute path to a `directory`. */
410
+ async(directory: string, request: string): Promise<ResolveResult>;
411
+ /**
412
+ * Synchronously resolve `specifier` at an absolute path to a `file`.
413
+ *
414
+ * This method automatically discovers tsconfig.json by traversing parent directories.
415
+ */
416
+ resolveFileSync(file: string, request: string): ResolveResult;
417
+ /**
418
+ * Asynchronously resolve `specifier` at an absolute path to a `file`.
419
+ *
420
+ * This method automatically discovers tsconfig.json by traversing parent directories.
421
+ */
422
+ resolveFileAsync(file: string, request: string): Promise<ResolveResult>;
423
+ /**
424
+ * Synchronously resolve `specifier` for TypeScript declaration files.
425
+ *
426
+ * `file` is the absolute path to the containing file.
427
+ * Uses TypeScript's `moduleResolution: "bundler"` algorithm.
428
+ */
429
+ resolveDtsSync(file: string, request: string): ResolveResult;
430
+ /**
431
+ * Asynchronously resolve `specifier` for TypeScript declaration files.
432
+ *
433
+ * `file` is the absolute path to the containing file.
434
+ * Uses TypeScript's `moduleResolution: "bundler"` algorithm.
435
+ */
436
+ resolveDtsAsync(file: string, request: string): Promise<ResolveResult>;
437
+ }
438
+ /** Node.js builtin module when `Options::builtin_modules` is enabled. */
439
+ interface Builtin {
440
+ /**
441
+ * Resolved module.
442
+ *
443
+ * Always prefixed with "node:" in compliance with the ESM specification.
444
+ */
445
+ resolved: string;
446
+ /**
447
+ * Whether the request was prefixed with `node:` or not.
448
+ * `fs` -> `false`.
449
+ * `node:fs` returns `true`.
450
+ */
451
+ isRuntimeModule: boolean;
452
+ }
453
+ declare enum EnforceExtension {
454
+ Auto = 0,
455
+ Enabled = 1,
456
+ Disabled = 2
457
+ }
458
+ type ModuleType = 'module' | 'commonjs' | 'json' | 'wasm' | 'addon';
459
+ /**
460
+ * Module Resolution Options
461
+ *
462
+ * Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options).
463
+ *
464
+ * See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples
465
+ */
466
+ interface NapiResolveOptions {
467
+ /**
468
+ * Discover tsconfig automatically or use the specified tsconfig.json path.
469
+ *
470
+ * Default `None`
471
+ */
472
+ tsconfig?: 'auto' | TsconfigOptions;
473
+ /**
474
+ * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback].
475
+ *
476
+ * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) ->
477
+ * AliasValue::Path(String)`
478
+ * Create aliases to import or require certain modules more easily.
479
+ * A trailing $ can also be added to the given object's keys to signify an exact match.
480
+ * Default `{}`
481
+ */
482
+ alias?: Record<string, Array<string | undefined | null>>;
483
+ /**
484
+ * A list of alias fields in description files.
485
+ * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec).
486
+ * Can be a path to json object such as `["path", "to", "exports"]`.
487
+ *
488
+ * Default `[]`
489
+ */
490
+ aliasFields?: (string | string[])[];
491
+ /**
492
+ * Condition names for exports field which defines entry points of a package.
493
+ * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries.
494
+ *
495
+ * Default `[]`
496
+ */
497
+ conditionNames?: Array<string>;
498
+ /**
499
+ * If true, it will not allow extension-less files.
500
+ * So by default `require('./foo')` works if `./foo` has a `.js` extension,
501
+ * but with this enabled only `require('./foo.js')` will work.
502
+ *
503
+ * Default to `true` when [ResolveOptions::extensions] contains an empty string.
504
+ * Use `Some(false)` to disable the behavior.
505
+ * See <https://github.com/webpack/enhanced-resolve/pull/285>
506
+ *
507
+ * Default None, which is the same as `Some(false)` when the above empty rule is not applied.
508
+ */
509
+ enforceExtension?: EnforceExtension;
510
+ /**
511
+ * A list of exports fields in description files.
512
+ * Can be a path to json object such as `["path", "to", "exports"]`.
513
+ *
514
+ * Default `[["exports"]]`.
515
+ */
516
+ exportsFields?: (string | string[])[];
517
+ /**
518
+ * Fields from `package.json` which are used to provide the internal requests of a package
519
+ * (requests starting with # are considered internal).
520
+ *
521
+ * Can be a path to a JSON object such as `["path", "to", "imports"]`.
522
+ *
523
+ * Default `[["imports"]]`.
524
+ */
525
+ importsFields?: (string | string[])[];
526
+ /**
527
+ * An object which maps extension to extension aliases.
528
+ *
529
+ * Default `{}`
530
+ */
531
+ extensionAlias?: Record<string, Array<string>>;
532
+ /**
533
+ * Attempt to resolve these extensions in order.
534
+ * If multiple files share the same name but have different extensions,
535
+ * will resolve the one with the extension listed first in the array and skip the rest.
536
+ *
537
+ * Default `[".js", ".json", ".node"]`
538
+ */
539
+ extensions?: Array<string>;
540
+ /**
541
+ * Redirect module requests when normal resolving fails.
542
+ *
543
+ * Default `{}`
544
+ */
545
+ fallback?: Record<string, Array<string | undefined | null>>;
546
+ /**
547
+ * Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests).
548
+ *
549
+ * See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified)
550
+ *
551
+ * Default `false`
552
+ */
553
+ fullySpecified?: boolean;
554
+ /**
555
+ * A list of main fields in description files
556
+ *
557
+ * Default `["main"]`.
558
+ */
559
+ mainFields?: string | string[];
560
+ /**
561
+ * The filename to be used while resolving directories.
562
+ *
563
+ * Default `["index"]`
564
+ */
565
+ mainFiles?: Array<string>;
566
+ /**
567
+ * A list of directories to resolve modules from, can be absolute path or folder name.
568
+ *
569
+ * Default `["node_modules"]`
570
+ */
571
+ modules?: string | string[];
572
+ /**
573
+ * Resolve to a context instead of a file.
574
+ *
575
+ * Default `false`
576
+ */
577
+ resolveToContext?: boolean;
578
+ /**
579
+ * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories.
580
+ *
581
+ * Default `false`
582
+ */
583
+ preferRelative?: boolean;
584
+ /**
585
+ * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots.
586
+ *
587
+ * Default `false`
588
+ */
589
+ preferAbsolute?: boolean;
590
+ /**
591
+ * A list of resolve restrictions to restrict the paths that a request can be resolved on.
592
+ *
593
+ * Default `[]`
594
+ */
595
+ restrictions?: Array<Restriction>;
596
+ /**
597
+ * A list of directories where requests of server-relative URLs (starting with '/') are resolved.
598
+ * On non-Windows systems these requests are resolved as an absolute path first.
599
+ *
600
+ * Default `[]`
601
+ */
602
+ roots?: Array<string>;
603
+ /**
604
+ * Whether to resolve symlinks to their symlinked location.
605
+ * When enabled, symlinked resources are resolved to their real path, not their symlinked location.
606
+ * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link).
607
+ *
608
+ * Default `true`
609
+ */
610
+ symlinks?: boolean;
611
+ /**
612
+ * Whether to read the `NODE_PATH` environment variable and append its entries to `modules`.
613
+ *
614
+ * `NODE_PATH` is a deprecated Node.js feature that is not part of ESM resolution.
615
+ * Set this to `false` to disable the behavior.
616
+ *
617
+ * Default `true`
618
+ */
619
+ nodePath?: boolean;
620
+ /**
621
+ * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not.
622
+ * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true.
623
+ *
624
+ * Default `false`
625
+ */
626
+ builtinModules?: boolean;
627
+ /**
628
+ * Resolve [ResolveResult::moduleType].
629
+ *
630
+ * Default `false`
631
+ */
632
+ moduleType?: boolean;
633
+ /**
634
+ * Allow `exports` field in `require('../directory')`.
635
+ *
636
+ * This is not part of the spec but some vite projects rely on this behavior.
637
+ * See
638
+ * * <https://github.com/vitejs/vite/pull/20252>
639
+ * * <https://github.com/nodejs/node/issues/58827>
640
+ *
641
+ * Default: `false`
642
+ */
643
+ allowPackageExportsInDirectoryResolve?: boolean;
644
+ }
645
+ interface ResolveResult {
646
+ path?: string;
647
+ error?: string;
648
+ builtin?: Builtin;
649
+ /**
650
+ * Module type for this path.
651
+ *
652
+ * Enable with `ResolveOptions#moduleType`.
653
+ *
654
+ * The module type is computed `ESM_FILE_FORMAT` from the [ESM resolution algorithm specification](https://nodejs.org/docs/latest/api/esm.html#resolution-algorithm-specification).
655
+ *
656
+ * The algorithm uses the file extension or finds the closest `package.json` with the `type` field.
657
+ */
658
+ moduleType?: ModuleType;
659
+ /** `package.json` path for the given module. */
660
+ packageJsonPath?: string;
661
+ }
662
+ /**
663
+ * Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback].
664
+ * Use struct because napi don't support structured union now
665
+ */
666
+ interface Restriction {
667
+ path?: string;
668
+ regex?: string;
669
+ }
670
+ /**
671
+ * Tsconfig Options
672
+ *
673
+ * Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options)
674
+ */
675
+ interface TsconfigOptions {
676
+ /**
677
+ * Allows you to specify where to find the TypeScript configuration file.
678
+ * You may provide
679
+ * * a relative path to the configuration file. It will be resolved relative to cwd.
680
+ * * an absolute path to the configuration file.
681
+ */
682
+ configFile: string;
683
+ /**
684
+ * Support for Typescript Project References.
685
+ *
686
+ * * `'auto'`: use the `references` field from tsconfig of `config_file`.
687
+ */
688
+ references?: 'auto';
689
+ }
690
+ interface SourceMap {
691
+ file?: string;
692
+ mappings: string;
693
+ names: Array<string>;
694
+ sourceRoot?: string;
695
+ sources: Array<string>;
696
+ sourcesContent?: Array<string>;
697
+ version: number;
698
+ x_google_ignoreList?: Array<number>;
699
+ }
700
+ interface CompilerAssumptions {
701
+ ignoreFunctionLength?: boolean;
702
+ noDocumentAll?: boolean;
703
+ objectRestNoSymbols?: boolean;
704
+ pureGetters?: boolean;
705
+ /**
706
+ * When using public class fields, assume that they don't shadow any getter in the current class,
707
+ * in its subclasses or in its superclass. Thus, it's safe to assign them rather than using
708
+ * `Object.defineProperty`.
709
+ *
710
+ * For example:
711
+ *
712
+ * Input:
713
+ * ```js
714
+ * class Test {
715
+ * field = 2;
716
+ *
717
+ * static staticField = 3;
718
+ * }
719
+ * ```
720
+ *
721
+ * When `set_public_class_fields` is `true`, the output will be:
722
+ * ```js
723
+ * class Test {
724
+ * constructor() {
725
+ * this.field = 2;
726
+ * }
727
+ * }
728
+ * Test.staticField = 3;
729
+ * ```
730
+ *
731
+ * Otherwise, the output will be:
732
+ * ```js
733
+ * import _defineProperty from "@oxc-project/runtime/helpers/defineProperty";
734
+ * class Test {
735
+ * constructor() {
736
+ * _defineProperty(this, "field", 2);
737
+ * }
738
+ * }
739
+ * _defineProperty(Test, "staticField", 3);
740
+ * ```
741
+ *
742
+ * NOTE: For TypeScript, if you wanted behavior is equivalent to `useDefineForClassFields: false`, you should
743
+ * set both `set_public_class_fields` and [`crate::TypeScriptOptions::remove_class_fields_without_initializer`]
744
+ * to `true`.
745
+ */
746
+ setPublicClassFields?: boolean;
747
+ }
748
+ interface DecoratorOptions {
749
+ /**
750
+ * Enables experimental support for decorators, which is a version of decorators that predates the TC39 standardization process.
751
+ *
752
+ * Decorators are a language feature which hasn’t yet been fully ratified into the JavaScript specification.
753
+ * This means that the implementation version in TypeScript may differ from the implementation in JavaScript when it it decided by TC39.
754
+ *
755
+ * @see https://www.typescriptlang.org/tsconfig/#experimentalDecorators
756
+ * @default false
757
+ */
758
+ legacy?: boolean;
759
+ /**
760
+ * Enables emitting decorator metadata.
761
+ *
762
+ * This option the same as [emitDecoratorMetadata](https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata)
763
+ * in TypeScript, and it only works when `legacy` is true.
764
+ *
765
+ * @see https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata
766
+ * @default false
767
+ */
768
+ emitDecoratorMetadata?: boolean;
769
+ }
770
+ type HelperMode =
771
+ /**
772
+ * Runtime mode (default): Helper functions are imported from a runtime package.
773
+ *
774
+ * Example:
775
+ *
776
+ * ```js
777
+ * import helperName from "@oxc-project/runtime/helpers/helperName";
778
+ * helperName(...arguments);
779
+ * ```
780
+ */
781
+ 'Runtime' |
782
+ /**
783
+ * External mode: Helper functions are accessed from a global `babelHelpers` object.
784
+ *
785
+ * Example:
786
+ *
787
+ * ```js
788
+ * babelHelpers.helperName(...arguments);
789
+ * ```
790
+ */
791
+ 'External';
792
+ interface Helpers {
793
+ mode?: HelperMode;
794
+ }
795
+ /**
796
+ * TypeScript Isolated Declarations for Standalone DTS Emit (async)
797
+ *
798
+ * Note: This function can be slower than `isolatedDeclarationSync` due to the overhead of spawning a thread.
799
+ */
800
+ declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): Promise<IsolatedDeclarationsResult>;
801
+ interface IsolatedDeclarationsOptions {
802
+ /**
803
+ * Do not emit declarations for code that has an @internal annotation in its JSDoc comment.
804
+ * This is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid.
805
+ *
806
+ * Default: `false`
807
+ *
808
+ * See <https://www.typescriptlang.org/tsconfig/#stripInternal>
809
+ */
810
+ stripInternal?: boolean;
811
+ sourcemap?: boolean;
812
+ }
813
+ interface IsolatedDeclarationsResult {
814
+ code: string;
815
+ map?: SourceMap;
816
+ errors: Array<OxcError>;
817
+ }
818
+ /** TypeScript Isolated Declarations for Standalone DTS Emit */
819
+ declare function isolatedDeclarationSync(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult;
820
+ /**
821
+ * Configure how TSX and JSX are transformed.
822
+ *
823
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
824
+ */
825
+ interface JsxOptions {
826
+ /**
827
+ * Decides which runtime to use.
828
+ *
829
+ * - 'automatic' - auto-import the correct JSX factories
830
+ * - 'classic' - no auto-import
831
+ *
832
+ * @default 'automatic'
833
+ */
834
+ runtime?: 'classic' | 'automatic';
835
+ /**
836
+ * Emit development-specific information, such as `__source` and `__self`.
837
+ *
838
+ * @default false
839
+ */
840
+ development?: boolean;
841
+ /**
842
+ * Toggles whether or not to throw an error if an XML namespaced tag name
843
+ * is used.
844
+ *
845
+ * Though the JSX spec allows this, it is disabled by default since React's
846
+ * JSX does not currently have support for it.
847
+ *
848
+ * @default true
849
+ */
850
+ throwIfNamespace?: boolean;
851
+ /**
852
+ * Mark JSX elements and top-level React method calls as pure for tree shaking.
853
+ *
854
+ * @default true
855
+ */
856
+ pure?: boolean;
857
+ /**
858
+ * Replaces the import source when importing functions.
859
+ *
860
+ * @default 'react'
861
+ */
862
+ importSource?: string;
863
+ /**
864
+ * Replace the function used when compiling JSX expressions. It should be a
865
+ * qualified name (e.g. `React.createElement`) or an identifier (e.g.
866
+ * `createElement`).
867
+ *
868
+ * Only used for `classic` {@link runtime}.
869
+ *
870
+ * @default 'React.createElement'
871
+ */
872
+ pragma?: string;
873
+ /**
874
+ * Replace the component used when compiling JSX fragments. It should be a
875
+ * valid JSX tag name.
876
+ *
877
+ * Only used for `classic` {@link runtime}.
878
+ *
879
+ * @default 'React.Fragment'
880
+ */
881
+ pragmaFrag?: string;
882
+ /**
883
+ * Enable React Fast Refresh .
884
+ *
885
+ * Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh}
886
+ *
887
+ * @default false
888
+ */
889
+ refresh?: boolean | ReactRefreshOptions;
890
+ }
891
+ /**
892
+ * Transform JavaScript code to a Vite Node runnable module.
893
+ *
894
+ * @param filename The name of the file being transformed.
895
+ * @param sourceText the source code itself
896
+ * @param options The options for the transformation. See {@link
897
+ * ModuleRunnerTransformOptions} for more information.
898
+ *
899
+ * @returns an object containing the transformed code, source maps, and any
900
+ * errors that occurred during parsing or transformation.
901
+ *
902
+ * Note: This function can be slower than `moduleRunnerTransformSync` due to the overhead of spawning a thread.
903
+ *
904
+ * @deprecated Only works for Vite.
905
+ */
906
+ declare function moduleRunnerTransform(filename: string, sourceText: string, options?: ModuleRunnerTransformOptions | undefined | null): Promise<ModuleRunnerTransformResult>;
907
+ interface ModuleRunnerTransformOptions {
908
+ /**
909
+ * Enable source map generation.
910
+ *
911
+ * When `true`, the `sourceMap` field of transform result objects will be populated.
912
+ *
913
+ * @default false
914
+ *
915
+ * @see {@link SourceMap}
916
+ */
917
+ sourcemap?: boolean;
918
+ }
919
+ interface ModuleRunnerTransformResult {
920
+ /**
921
+ * The transformed code.
922
+ *
923
+ * If parsing failed, this will be an empty string.
924
+ */
925
+ code: string;
926
+ /**
927
+ * The source map for the transformed code.
928
+ *
929
+ * This will be set if {@link TransformOptions#sourcemap} is `true`.
930
+ */
931
+ map?: SourceMap;
932
+ deps: Array<string>;
933
+ dynamicDeps: Array<string>;
934
+ /**
935
+ * Parse and transformation errors.
936
+ *
937
+ * Oxc's parser recovers from common syntax errors, meaning that
938
+ * transformed code may still be available even if there are errors in this
939
+ * list.
940
+ */
941
+ errors: Array<OxcError>;
942
+ }
943
+ interface PluginsOptions {
944
+ styledComponents?: StyledComponentsOptions;
945
+ taggedTemplateEscape?: boolean;
946
+ }
947
+ interface ReactRefreshOptions {
948
+ /**
949
+ * Specify the identifier of the refresh registration variable.
950
+ *
951
+ * @default `$RefreshReg$`.
952
+ */
953
+ refreshReg?: string;
954
+ /**
955
+ * Specify the identifier of the refresh signature variable.
956
+ *
957
+ * @default `$RefreshSig$`.
958
+ */
959
+ refreshSig?: string;
960
+ emitFullSignatures?: boolean;
961
+ }
962
+ /**
963
+ * Configure how styled-components are transformed.
964
+ *
965
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins#styled-components}
966
+ */
967
+ interface StyledComponentsOptions {
968
+ /**
969
+ * Enhances the attached CSS class name on each component with richer output to help
970
+ * identify your components in the DOM without React DevTools.
971
+ *
972
+ * @default true
973
+ */
974
+ displayName?: boolean;
975
+ /**
976
+ * Controls whether the `displayName` of a component will be prefixed with the filename
977
+ * to make the component name as unique as possible.
978
+ *
979
+ * @default true
980
+ */
981
+ fileName?: boolean;
982
+ /**
983
+ * Adds a unique identifier to every styled component to avoid checksum mismatches
984
+ * due to different class generation on the client and server during server-side rendering.
985
+ *
986
+ * @default true
987
+ */
988
+ ssr?: boolean;
989
+ /**
990
+ * Transpiles styled-components tagged template literals to a smaller representation
991
+ * than what Babel normally creates, helping to reduce bundle size.
992
+ *
993
+ * @default true
994
+ */
995
+ transpileTemplateLiterals?: boolean;
996
+ /**
997
+ * Minifies CSS content by removing all whitespace and comments from your CSS,
998
+ * keeping valuable bytes out of your bundles.
999
+ *
1000
+ * @default true
1001
+ */
1002
+ minify?: boolean;
1003
+ /**
1004
+ * Enables transformation of JSX `css` prop when using styled-components.
1005
+ *
1006
+ * **Note: This feature is not yet implemented in oxc.**
1007
+ *
1008
+ * @default true
1009
+ */
1010
+ cssProp?: boolean;
1011
+ /**
1012
+ * Enables "pure annotation" to aid dead code elimination by bundlers.
1013
+ *
1014
+ * @default false
1015
+ */
1016
+ pure?: boolean;
1017
+ /**
1018
+ * Adds a namespace prefix to component identifiers to ensure class names are unique.
1019
+ *
1020
+ * Example: With `namespace: "my-app"`, generates `componentId: "my-app__sc-3rfj0a-1"`
1021
+ */
1022
+ namespace?: string;
1023
+ /**
1024
+ * List of file names that are considered meaningless for component naming purposes.
1025
+ *
1026
+ * When the `fileName` option is enabled and a component is in a file with a name
1027
+ * from this list, the directory name will be used instead of the file name for
1028
+ * the component's display name.
1029
+ *
1030
+ * @default `["index"]`
1031
+ */
1032
+ meaninglessFileNames?: Array<string>;
1033
+ /**
1034
+ * Import paths to be considered as styled-components imports at the top level.
1035
+ *
1036
+ * **Note: This feature is not yet implemented in oxc.**
1037
+ */
1038
+ topLevelImportPaths?: Array<string>;
1039
+ }
1040
+ /**
1041
+ * Options for transforming a JavaScript or TypeScript file.
1042
+ *
1043
+ * @see {@link transform}
1044
+ */
1045
+ interface TransformOptions {
1046
+ /** Treat the source text as `js`, `jsx`, `ts`, `tsx`, or `dts`. */
1047
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts';
1048
+ /** Treat the source text as `script` or `module` code. */
1049
+ sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous' | undefined;
1050
+ /**
1051
+ * The current working directory. Used to resolve relative paths in other
1052
+ * options.
1053
+ */
1054
+ cwd?: string;
1055
+ /**
1056
+ * Enable source map generation.
1057
+ *
1058
+ * When `true`, the `sourceMap` field of transform result objects will be populated.
1059
+ *
1060
+ * @default false
1061
+ *
1062
+ * @see {@link SourceMap}
1063
+ */
1064
+ sourcemap?: boolean;
1065
+ /** Set assumptions in order to produce smaller output. */
1066
+ assumptions?: CompilerAssumptions;
1067
+ /**
1068
+ * Configure how TypeScript is transformed.
1069
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/typescript}
1070
+ */
1071
+ typescript?: TypeScriptOptions;
1072
+ /**
1073
+ * Configure how TSX and JSX are transformed.
1074
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
1075
+ */
1076
+ jsx?: 'preserve' | JsxOptions;
1077
+ /**
1078
+ * Sets the target environment for the generated JavaScript.
1079
+ *
1080
+ * The lowest target is `es2015`.
1081
+ *
1082
+ * Example:
1083
+ *
1084
+ * * `'es2015'`
1085
+ * * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
1086
+ *
1087
+ * @default `esnext` (No transformation)
1088
+ *
1089
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/lowering#target}
1090
+ */
1091
+ target?: string | Array<string>;
1092
+ /** Behaviour for runtime helpers. */
1093
+ helpers?: Helpers;
1094
+ /**
1095
+ * Define Plugin
1096
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#define}
1097
+ */
1098
+ define?: Record<string, string>;
1099
+ /**
1100
+ * Inject Plugin
1101
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#inject}
1102
+ */
1103
+ inject?: Record<string, string | [string, string]>;
1104
+ /** Decorator plugin */
1105
+ decorator?: DecoratorOptions;
1106
+ /**
1107
+ * Third-party plugins to use.
1108
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
1109
+ */
1110
+ plugins?: PluginsOptions;
1111
+ }
1112
+ interface TypeScriptOptions {
1113
+ jsxPragma?: string;
1114
+ jsxPragmaFrag?: string;
1115
+ onlyRemoveTypeImports?: boolean;
1116
+ allowNamespaces?: boolean;
1117
+ /**
1118
+ * When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
1119
+ *
1120
+ * @deprecated
1121
+ *
1122
+ * Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
1123
+ * without initializer, you can use `remove_class_fields_without_initializer: true` instead.
1124
+ */
1125
+ allowDeclareFields?: boolean;
1126
+ /**
1127
+ * When enabled, class fields without initializers are removed.
1128
+ *
1129
+ * For example:
1130
+ * ```ts
1131
+ * class Foo {
1132
+ * x: number;
1133
+ * y: number = 0;
1134
+ * }
1135
+ * ```
1136
+ * // transform into
1137
+ * ```js
1138
+ * class Foo {
1139
+ * x: number;
1140
+ * }
1141
+ * ```
1142
+ *
1143
+ * The option is used to align with the behavior of TypeScript's `useDefineForClassFields: false` option.
1144
+ * When you want to enable this, you also need to set [`crate::CompilerAssumptions::set_public_class_fields`]
1145
+ * to `true`. The `set_public_class_fields: true` + `remove_class_fields_without_initializer: true` is
1146
+ * equivalent to `useDefineForClassFields: false` in TypeScript.
1147
+ *
1148
+ * When `set_public_class_fields` is true and class-properties plugin is enabled, the above example transforms into:
1149
+ *
1150
+ * ```js
1151
+ * class Foo {
1152
+ * constructor() {
1153
+ * this.y = 0;
1154
+ * }
1155
+ * }
1156
+ * ```
1157
+ *
1158
+ * Defaults to `false`.
1159
+ */
1160
+ removeClassFieldsWithoutInitializer?: boolean;
1161
+ /**
1162
+ * Also generate a `.d.ts` declaration file for TypeScript files.
1163
+ *
1164
+ * The source file must be compliant with all
1165
+ * [`isolatedDeclarations`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations)
1166
+ * requirements.
1167
+ *
1168
+ * @default false
1169
+ */
1170
+ declaration?: IsolatedDeclarationsOptions;
1171
+ /**
1172
+ * Rewrite or remove TypeScript import/export declaration extensions.
1173
+ *
1174
+ * - When set to `rewrite`, it will change `.ts`, `.mts`, `.cts` extensions to `.js`, `.mjs`, `.cjs` respectively.
1175
+ * - When set to `remove`, it will remove `.ts`/`.mts`/`.cts`/`.tsx` extension entirely.
1176
+ * - When set to `true`, it's equivalent to `rewrite`.
1177
+ * - When set to `false` or omitted, no changes will be made to the extensions.
1178
+ *
1179
+ * @default false
1180
+ */
1181
+ rewriteImportExtensions?: 'rewrite' | 'remove' | boolean;
1182
+ }
1183
+ /** A decoded source map with mappings as an array of arrays instead of VLQ-encoded string. */
1184
+ declare class BindingDecodedMap {
1185
+ /** The source map version (always 3). */
1186
+ get version(): number;
1187
+ /** The generated file name. */
1188
+ get file(): string | null;
1189
+ /** The list of original source files. */
1190
+ get sources(): Array<string>;
1191
+ /** The original source contents (if `includeContent` was true). */
1192
+ get sourcesContent(): Array<string | undefined | null>;
1193
+ /** The list of symbol names used in mappings. */
1194
+ get names(): Array<string>;
1195
+ /**
1196
+ * The decoded mappings as an array of line arrays.
1197
+ * Each line is an array of segments, where each segment is [generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex?].
1198
+ */
1199
+ get mappings(): Array<Array<Array<number>>>;
1200
+ /** The list of source indices that should be excluded from debugging. */
1201
+ get x_google_ignoreList(): Array<number> | null;
1202
+ }
1203
+ declare class BindingMagicString {
1204
+ constructor(source: string, options?: BindingMagicStringOptions | undefined | null);
1205
+ get original(): string;
1206
+ get filename(): string | null;
1207
+ get indentExclusionRanges(): Array<Array<number>> | Array<number> | null;
1208
+ get ignoreList(): boolean;
1209
+ get offset(): number;
1210
+ set offset(offset: number);
1211
+ replace(from: string, to: string): this;
1212
+ replaceAll(from: string, to: string): this;
1213
+ /**
1214
+ * Returns the UTF-16 offset past the last match, or -1 if no match was found.
1215
+ * The JS wrapper uses this to update `lastIndex` on the caller's RegExp.
1216
+ * Global/sticky behavior is derived from the regex's own flags.
1217
+ */
1218
+ replaceRegex(from: RegExp, to: string): number;
1219
+ prepend(content: string): this;
1220
+ append(content: string): this;
1221
+ prependLeft(index: number, content: string): this;
1222
+ prependRight(index: number, content: string): this;
1223
+ appendLeft(index: number, content: string): this;
1224
+ appendRight(index: number, content: string): this;
1225
+ overwrite(start: number, end: number, content: string): this;
1226
+ toString(): string;
1227
+ hasChanged(): boolean;
1228
+ length(): number;
1229
+ isEmpty(): boolean;
1230
+ remove(start: number, end: number): this;
1231
+ update(start: number, end: number, content: string): this;
1232
+ relocate(start: number, end: number, to: number): this;
1233
+ /**
1234
+ * Alias for `relocate` to match the original magic-string API.
1235
+ * Moves the characters from `start` to `end` to `index`.
1236
+ * Returns `this` for method chaining.
1237
+ */
1238
+ move(start: number, end: number, index: number): this;
1239
+ indent(indentor?: string | undefined | null, options?: BindingIndentOptions | undefined | null): this;
1240
+ /** Trims whitespace or specified characters from the start and end. */
1241
+ trim(charType?: string | undefined | null): this;
1242
+ /** Trims whitespace or specified characters from the start. */
1243
+ trimStart(charType?: string | undefined | null): this;
1244
+ /** Trims whitespace or specified characters from the end. */
1245
+ trimEnd(charType?: string | undefined | null): this;
1246
+ /** Trims newlines from the start and end. */
1247
+ trimLines(): this;
1248
+ /**
1249
+ * Deprecated method that throws an error directing users to use prependRight or appendLeft.
1250
+ * This matches the original magic-string API which deprecated this method.
1251
+ */
1252
+ insert(index: number, content: string): void;
1253
+ /** Returns a clone of the MagicString instance. */
1254
+ clone(): BindingMagicString;
1255
+ /** Returns the last character of the generated string, or an empty string if empty. */
1256
+ lastChar(): string;
1257
+ /** Returns the content after the last newline in the generated string. */
1258
+ lastLine(): string;
1259
+ /** Returns the guessed indentation string, or `\t` if none is found. */
1260
+ getIndentString(): string;
1261
+ /** Returns a clone with content outside the specified range removed. */
1262
+ snip(start: number, end: number): BindingMagicString;
1263
+ /**
1264
+ * Resets the portion of the string from `start` to `end` to its original content.
1265
+ * This undoes any modifications made to that range.
1266
+ * Supports negative indices (counting from the end).
1267
+ */
1268
+ reset(start: number, end: number): this;
1269
+ /**
1270
+ * Returns the content between the specified UTF-16 code unit positions (JS string indices).
1271
+ * Supports negative indices (counting from the end).
1272
+ *
1273
+ * When an index falls in the middle of a surrogate pair, the lone surrogate is
1274
+ * included in the result (matching the original magic-string / JS behavior).
1275
+ * This is done by returning a UTF-16 encoded JS string via `napi_create_string_utf16`.
1276
+ */
1277
+ slice(start?: number | undefined | null, end?: number | undefined | null): string;
1278
+ /**
1279
+ * Generates a source map for the transformations applied to this MagicString.
1280
+ * Returns a BindingSourceMap object with version, file, sources, sourcesContent, names, mappings.
1281
+ */
1282
+ generateMap(options?: BindingSourceMapOptions | undefined | null): BindingSourceMap;
1283
+ /**
1284
+ * Generates a decoded source map for the transformations applied to this MagicString.
1285
+ * Returns a BindingDecodedMap object with mappings as an array of arrays.
1286
+ */
1287
+ generateDecodedMap(options?: BindingSourceMapOptions | undefined | null): BindingDecodedMap;
1288
+ }
1289
+ declare class BindingNormalizedOptions {
1290
+ get input(): Array<string> | Record<string, string>;
1291
+ get cwd(): string;
1292
+ get platform(): 'node' | 'browser' | 'neutral';
1293
+ get shimMissingExports(): boolean;
1294
+ get name(): string | null;
1295
+ get entryFilenames(): string | undefined;
1296
+ get chunkFilenames(): string | undefined;
1297
+ get assetFilenames(): string | undefined;
1298
+ get dir(): string | null;
1299
+ get file(): string | null;
1300
+ get format(): 'es' | 'cjs' | 'iife' | 'umd';
1301
+ get exports(): 'default' | 'named' | 'none' | 'auto';
1302
+ get esModule(): boolean | 'if-default-prop';
1303
+ get codeSplitting(): boolean;
1304
+ get dynamicImportInCjs(): boolean;
1305
+ get sourcemap(): boolean | 'inline' | 'hidden';
1306
+ get sourcemapBaseUrl(): string | null;
1307
+ get banner(): string | undefined | null | undefined;
1308
+ get footer(): string | undefined | null | undefined;
1309
+ get intro(): string | undefined | null | undefined;
1310
+ get outro(): string | undefined | null | undefined;
1311
+ get postBanner(): string | undefined | null | undefined;
1312
+ get postFooter(): string | undefined | null | undefined;
1313
+ get externalLiveBindings(): boolean;
1314
+ get extend(): boolean;
1315
+ get globals(): Record<string, string> | undefined;
1316
+ get hashCharacters(): 'base64' | 'base36' | 'hex';
1317
+ get sourcemapDebugIds(): boolean;
1318
+ get sourcemapExcludeSources(): boolean;
1319
+ get polyfillRequire(): boolean;
1320
+ get minify(): false | 'dce-only' | MinifyOptions;
1321
+ get legalComments(): 'none' | 'inline';
1322
+ get comments(): BindingCommentsOptions;
1323
+ get preserveModules(): boolean;
1324
+ get preserveModulesRoot(): string | undefined;
1325
+ get virtualDirname(): string;
1326
+ get topLevelVar(): boolean;
1327
+ get minifyInternalExports(): boolean;
1328
+ get context(): string;
1329
+ }
1330
+ declare class BindingRenderedChunk {
1331
+ get name(): string;
1332
+ get isEntry(): boolean;
1333
+ get isDynamicEntry(): boolean;
1334
+ get facadeModuleId(): string | null;
1335
+ get moduleIds(): Array<string>;
1336
+ get exports(): Array<string>;
1337
+ get fileName(): string;
1338
+ get modules(): BindingModules;
1339
+ get imports(): Array<string>;
1340
+ get dynamicImports(): Array<string>;
1341
+ }
1342
+ declare class BindingRenderedModule {
1343
+ get code(): string | null;
1344
+ get renderedExports(): Array<string>;
1345
+ }
1346
+ /** A source map object with properties matching the SourceMap V3 specification. */
1347
+ declare class BindingSourceMap {
1348
+ /** The source map version (always 3). */
1349
+ get version(): number;
1350
+ /** The generated file name. */
1351
+ get file(): string | null;
1352
+ /** The list of original source files. */
1353
+ get sources(): Array<string>;
1354
+ /** The original source contents (if `includeContent` was true). */
1355
+ get sourcesContent(): Array<string | undefined | null>;
1356
+ /** The list of symbol names used in mappings. */
1357
+ get names(): Array<string>;
1358
+ /** The VLQ-encoded mappings string. */
1359
+ get mappings(): string;
1360
+ /** The list of source indices that should be excluded from debugging. */
1361
+ get x_google_ignoreList(): Array<number> | null;
1362
+ /** Returns the source map as a JSON string. */
1363
+ toString(): string;
1364
+ /** Returns the source map as a base64-encoded data URL. */
1365
+ toUrl(): string;
1366
+ }
1367
+ /**
1368
+ * Minimal wrapper around a `BundleHandle` for watcher events.
1369
+ * This is returned from watcher event data to allow calling `result.close()`.
1370
+ */
1371
+ declare class BindingWatcherBundler {
1372
+ close(): Promise<void>;
1373
+ }
1374
+ declare class TsconfigCache {
1375
+ /** Create a new transform cache with auto tsconfig discovery enabled. */
1376
+ constructor(yarnPnp: boolean);
1377
+ /**
1378
+ * Clear the cache.
1379
+ *
1380
+ * Call this when tsconfig files have changed to ensure fresh resolution.
1381
+ */
1382
+ clear(): void;
1383
+ /** Get the number of cached entries. */
1384
+ size(): number;
1385
+ }
1386
+ type BindingBuiltinPluginName = 'builtin:bundle-analyzer' | 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-build-import-analysis' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-web-worker-post' | 'builtin:oxc-runtime' | 'builtin:rollipop-react-refresh-wrapper' | 'builtin:rollipop-worklets' | 'builtin:rollipop-react-native';
1387
+ interface BindingBundleAnalyzerPluginConfig {
1388
+ /** Output filename for the bundle analysis data (default: "analyze-data.json") */
1389
+ fileName?: string;
1390
+ /** Output format: "json" (default) or "md" for LLM-friendly markdown */
1391
+ format?: 'json' | 'md';
1392
+ }
1393
+ interface BindingBundleState {
1394
+ lastFullBuildFailed: boolean;
1395
+ hasStaleOutput: boolean;
1396
+ }
1397
+ interface BindingClientHmrUpdate {
1398
+ clientId: string;
1399
+ update: BindingHmrUpdate;
1400
+ }
1401
+ interface BindingCommentsOptions {
1402
+ legal?: boolean;
1403
+ annotation?: boolean;
1404
+ jsdoc?: boolean;
1405
+ }
1406
+ interface BindingCompilerOptions {
1407
+ baseUrl?: string;
1408
+ paths?: Record<string, Array<string>>;
1409
+ experimentalDecorators?: boolean;
1410
+ emitDecoratorMetadata?: boolean;
1411
+ useDefineForClassFields?: boolean;
1412
+ rewriteRelativeImportExtensions?: boolean;
1413
+ jsx?: string;
1414
+ jsxFactory?: string;
1415
+ jsxFragmentFactory?: string;
1416
+ jsxImportSource?: string;
1417
+ verbatimModuleSyntax?: boolean;
1418
+ preserveValueImports?: boolean;
1419
+ importsNotUsedAsValues?: string;
1420
+ target?: string;
1421
+ module?: string;
1422
+ allowJs?: boolean;
1423
+ rootDirs?: Array<string>;
1424
+ }
1425
+ /** Enhanced transform options with tsconfig and inputMap support. */
1426
+ interface BindingEnhancedTransformOptions {
1427
+ /** Treat the source text as 'js', 'jsx', 'ts', 'tsx', or 'dts'. */
1428
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts';
1429
+ /** Treat the source text as 'script', 'module', 'commonjs', or 'unambiguous'. */
1430
+ sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous' | undefined;
1431
+ /**
1432
+ * The current working directory. Used to resolve relative paths in other
1433
+ * options.
1434
+ */
1435
+ cwd?: string;
1436
+ /**
1437
+ * Enable source map generation.
1438
+ *
1439
+ * When `true`, the `sourceMap` field of transform result objects will be populated.
1440
+ *
1441
+ * @default false
1442
+ */
1443
+ sourcemap?: boolean;
1444
+ /** Set assumptions in order to produce smaller output. */
1445
+ assumptions?: CompilerAssumptions;
1446
+ /**
1447
+ * Configure how TypeScript is transformed.
1448
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/typescript}
1449
+ */
1450
+ typescript?: TypeScriptOptions;
1451
+ /**
1452
+ * Configure how TSX and JSX are transformed.
1453
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
1454
+ */
1455
+ jsx?: 'preserve' | JsxOptions;
1456
+ /**
1457
+ * Sets the target environment for the generated JavaScript.
1458
+ *
1459
+ * The lowest target is `es2015`.
1460
+ *
1461
+ * Example:
1462
+ *
1463
+ * * `'es2015'`
1464
+ * * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
1465
+ *
1466
+ * @default `esnext` (No transformation)
1467
+ *
1468
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/lowering#target}
1469
+ */
1470
+ target?: string | Array<string>;
1471
+ /** Behaviour for runtime helpers. */
1472
+ helpers?: Helpers;
1473
+ /**
1474
+ * Define Plugin
1475
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#define}
1476
+ */
1477
+ define?: Record<string, string>;
1478
+ /**
1479
+ * Inject Plugin
1480
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#inject}
1481
+ */
1482
+ inject?: Record<string, string | [string, string]>;
1483
+ /** Decorator plugin */
1484
+ decorator?: DecoratorOptions;
1485
+ /**
1486
+ * Third-party plugins to use.
1487
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
1488
+ */
1489
+ plugins?: PluginsOptions;
1490
+ /**
1491
+ * Configure tsconfig handling.
1492
+ * - true: Auto-discover and load the nearest tsconfig.json
1493
+ * - TsconfigRawOptions: Use the provided inline tsconfig options
1494
+ */
1495
+ tsconfig?: boolean | BindingTsconfigRawOptions;
1496
+ /** An input source map to collapse with the output source map. */
1497
+ inputMap?: SourceMap;
1498
+ }
1499
+ /** Result of the enhanced transform API. */
1500
+ interface BindingEnhancedTransformResult {
1501
+ /**
1502
+ * The transformed code.
1503
+ *
1504
+ * If parsing failed, this will be an empty string.
1505
+ */
1506
+ code: string;
1507
+ /**
1508
+ * The source map for the transformed code.
1509
+ *
1510
+ * This will be set if {@link BindingEnhancedTransformOptions#sourcemap} is `true`.
1511
+ */
1512
+ map?: SourceMap;
1513
+ /**
1514
+ * The `.d.ts` declaration file for the transformed code. Declarations are
1515
+ * only generated if `declaration` is set to `true` and a TypeScript file
1516
+ * is provided.
1517
+ *
1518
+ * If parsing failed and `declaration` is set, this will be an empty string.
1519
+ *
1520
+ * @see {@link TypeScriptOptions#declaration}
1521
+ * @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration)
1522
+ */
1523
+ declaration?: string;
1524
+ /**
1525
+ * Declaration source map. Only generated if both
1526
+ * {@link TypeScriptOptions#declaration declaration} and
1527
+ * {@link BindingEnhancedTransformOptions#sourcemap sourcemap} are set to `true`.
1528
+ */
1529
+ declarationMap?: SourceMap;
1530
+ /**
1531
+ * Helpers used.
1532
+ *
1533
+ * @internal
1534
+ *
1535
+ * Example:
1536
+ *
1537
+ * ```text
1538
+ * { "_objectSpread": "@oxc-project/runtime/helpers/objectSpread2" }
1539
+ * ```
1540
+ */
1541
+ helpersUsed: Record<string, string>;
1542
+ /** Parse and transformation errors. */
1543
+ errors: Array<BindingError>;
1544
+ /** Parse and transformation warnings. */
1545
+ warnings: Array<BindingError>;
1546
+ /** Paths to tsconfig files that were loaded during transformation. */
1547
+ tsconfigFilePaths: Array<string>;
1548
+ }
1549
+ type BindingError = {
1550
+ type: 'JsError';
1551
+ field0: Error;
1552
+ } | {
1553
+ type: 'NativeError';
1554
+ field0: NativeError;
1555
+ };
1556
+ interface BindingEsmExternalRequirePluginConfig {
1557
+ external: Array<BindingStringOrRegex>;
1558
+ skipDuplicateCheck?: boolean;
1559
+ }
1560
+ interface BindingHmrBoundaryOutput {
1561
+ boundary: string;
1562
+ acceptedVia: string;
1563
+ }
1564
+ type BindingHmrUpdate = {
1565
+ type: 'Patch';
1566
+ code: string;
1567
+ filename: string;
1568
+ sourcemap?: string;
1569
+ sourcemapFilename?: string;
1570
+ hmrBoundaries: Array<BindingHmrBoundaryOutput>;
1571
+ } | {
1572
+ type: 'FullReload';
1573
+ reason?: string;
1574
+ } | {
1575
+ type: 'Noop';
1576
+ };
1577
+ interface BindingHookResolveIdExtraArgs {
1578
+ custom?: number;
1579
+ isEntry: boolean;
1580
+ /**
1581
+ * - `import-statement`: `import { foo } from './lib.js';`
1582
+ * - `dynamic-import`: `import('./lib.js')`
1583
+ * - `require-call`: `require('./lib.js')`
1584
+ * - `import-rule`: `@import 'bg-color.css'`
1585
+ * - `url-token`: `url('./icon.png')`
1586
+ * - `new-url`: `new URL('./worker.js', import.meta.url)`
1587
+ * - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
1588
+ */
1589
+ kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
1590
+ }
1591
+ interface BindingIndentOptions {
1592
+ exclude?: Array<Array<number>> | Array<number>;
1593
+ }
1594
+ interface BindingIsolatedDeclarationPluginConfig {
1595
+ stripInternal?: boolean;
1596
+ }
1597
+ interface BindingLogLocation {
1598
+ /** 1-based */
1599
+ line: number;
1600
+ /** 0-based position in the line in UTF-16 code units */
1601
+ column: number;
1602
+ file?: string;
1603
+ }
1604
+ interface BindingMagicStringOptions {
1605
+ filename?: string;
1606
+ offset?: number;
1607
+ indentExclusionRanges?: Array<Array<number>> | Array<number>;
1608
+ ignoreList?: boolean;
1609
+ }
1610
+ interface BindingModulePreloadOptions {
1611
+ polyfill: boolean;
1612
+ resolveDependencies?: (filename: string, deps: string[], context: {
1613
+ hostId: string;
1614
+ hostType: 'html' | 'js';
1615
+ }) => string[];
1616
+ }
1617
+ interface BindingModules {
1618
+ values: Array<BindingRenderedModule>;
1619
+ keys: Array<string>;
1620
+ }
1621
+ interface BindingPluginContextResolveOptions {
1622
+ /**
1623
+ * - `import-statement`: `import { foo } from './lib.js';`
1624
+ * - `dynamic-import`: `import('./lib.js')`
1625
+ * - `require-call`: `require('./lib.js')`
1626
+ * - `import-rule`: `@import 'bg-color.css'`
1627
+ * - `url-token`: `url('./icon.png')`
1628
+ * - `new-url`: `new URL('./worker.js', import.meta.url)`
1629
+ * - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
1630
+ */
1631
+ importKind?: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
1632
+ isEntry?: boolean;
1633
+ skipSelf?: boolean;
1634
+ custom?: number;
1635
+ vitePluginCustom?: BindingVitePluginCustom;
1636
+ }
1637
+ declare enum BindingRebuildStrategy {
1638
+ Always = 0,
1639
+ Auto = 1,
1640
+ Never = 2
1641
+ }
1642
+ interface BindingRenderBuiltUrlConfig {
1643
+ ssr: boolean;
1644
+ type: 'asset' | 'public';
1645
+ hostId: string;
1646
+ hostType: 'js' | 'css' | 'html';
1647
+ }
1648
+ interface BindingRenderBuiltUrlRet {
1649
+ relative?: boolean;
1650
+ runtime?: string;
1651
+ }
1652
+ interface BindingReplacePluginConfig {
1653
+ values: Record<string, string>;
1654
+ delimiters?: [string, string];
1655
+ preventAssignment?: boolean;
1656
+ objectGuards?: boolean;
1657
+ sourcemap?: boolean;
1658
+ }
1659
+ interface BindingRollipopReactRefreshWrapperPluginConfig {
1660
+ cwd: string;
1661
+ include?: Array<BindingStringOrRegex>;
1662
+ exclude?: Array<BindingStringOrRegex>;
1663
+ jsxImportSource?: string;
1664
+ }
1665
+ interface BindingRollipopWorkletsPluginConfig {
1666
+ root: string;
1667
+ pluginVersion: string;
1668
+ isRelease: boolean;
1669
+ }
1670
+ interface BindingSourceMapOptions {
1671
+ /** The filename for the generated file (goes into `map.file`) */
1672
+ file?: string;
1673
+ /** The filename of the original source (goes into `map.sources`) */
1674
+ source?: string;
1675
+ includeContent?: boolean;
1676
+ /**
1677
+ * Accepts boolean or string: true, false, "boundary"
1678
+ * - true: high-resolution sourcemaps (character-level)
1679
+ * - false: low-resolution sourcemaps (line-level) - default
1680
+ * - "boundary": high-resolution only at word boundaries
1681
+ */
1682
+ hires?: boolean | string;
1683
+ }
1684
+ interface BindingTransformHookExtraArgs {
1685
+ moduleType: string;
1686
+ }
1687
+ interface BindingTsconfig {
1688
+ files?: Array<string>;
1689
+ include?: Array<string>;
1690
+ exclude?: Array<string>;
1691
+ compilerOptions: BindingCompilerOptions;
1692
+ }
1693
+ /**
1694
+ * TypeScript compiler options for inline tsconfig configuration.
1695
+ *
1696
+ * @category Utilities
1697
+ */
1698
+ interface BindingTsconfigCompilerOptions {
1699
+ /** Specifies the JSX factory function to use. */
1700
+ jsx?: 'react' | 'react-jsx' | 'react-jsxdev' | 'preserve' | 'react-native';
1701
+ /** Specifies the JSX factory function. */
1702
+ jsxFactory?: string;
1703
+ /** Specifies the JSX fragment factory function. */
1704
+ jsxFragmentFactory?: string;
1705
+ /** Specifies the module specifier for JSX imports. */
1706
+ jsxImportSource?: string;
1707
+ /** Enables experimental decorators. */
1708
+ experimentalDecorators?: boolean;
1709
+ /** Enables decorator metadata emission. */
1710
+ emitDecoratorMetadata?: boolean;
1711
+ /** Preserves module structure of imports/exports. */
1712
+ verbatimModuleSyntax?: boolean;
1713
+ /** Configures how class fields are emitted. */
1714
+ useDefineForClassFields?: boolean;
1715
+ /** The ECMAScript target version. */
1716
+ target?: string;
1717
+ /** @deprecated Use verbatimModuleSyntax instead. */
1718
+ preserveValueImports?: boolean;
1719
+ /** @deprecated Use verbatimModuleSyntax instead. */
1720
+ importsNotUsedAsValues?: 'remove' | 'preserve' | 'error';
1721
+ }
1722
+ /**
1723
+ * Raw tsconfig options for inline configuration.
1724
+ *
1725
+ * @category Utilities
1726
+ */
1727
+ interface BindingTsconfigRawOptions {
1728
+ /** TypeScript compiler options. */
1729
+ compilerOptions?: BindingTsconfigCompilerOptions;
1730
+ }
1731
+ interface BindingTsconfigResult {
1732
+ tsconfig: BindingTsconfig;
1733
+ tsconfigFilePaths: Array<string>;
1734
+ }
1735
+ interface BindingViteBuildImportAnalysisPluginConfig {
1736
+ preloadCode: string;
1737
+ insertPreload: boolean;
1738
+ optimizeModulePreloadRelativePaths: boolean;
1739
+ renderBuiltUrl: boolean;
1740
+ isRelativeBase: boolean;
1741
+ v2?: BindingViteBuildImportAnalysisPluginV2Config;
1742
+ }
1743
+ interface BindingViteBuildImportAnalysisPluginV2Config {
1744
+ isSsr: boolean;
1745
+ urlBase: string;
1746
+ decodedBase: string;
1747
+ modulePreload: false | BindingModulePreloadOptions;
1748
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1749
+ }
1750
+ interface BindingViteDynamicImportVarsPluginConfig {
1751
+ sourcemap?: boolean;
1752
+ include?: Array<BindingStringOrRegex>;
1753
+ exclude?: Array<BindingStringOrRegex>;
1754
+ resolver?: (id: string, importer: string) => MaybePromise<string | undefined>;
1755
+ }
1756
+ interface BindingViteImportGlobPluginConfig {
1757
+ root?: string;
1758
+ sourcemap?: boolean;
1759
+ restoreQueryExtension?: boolean;
1760
+ }
1761
+ interface BindingViteJsonPluginConfig {
1762
+ minify?: boolean;
1763
+ namedExports?: boolean;
1764
+ stringify?: BindingViteJsonPluginStringify;
1765
+ }
1766
+ type BindingViteJsonPluginStringify = boolean | string;
1767
+ interface BindingViteManifestPluginConfig {
1768
+ root: string;
1769
+ outPath: string;
1770
+ isEnableV2?: boolean;
1771
+ isLegacy?: (args: BindingNormalizedOptions) => boolean;
1772
+ cssEntries: () => Record<string, string>;
1773
+ }
1774
+ interface BindingViteModulePreloadPolyfillPluginConfig {
1775
+ isServer?: boolean;
1776
+ }
1777
+ interface BindingVitePluginCustom {
1778
+ 'vite:import-glob'?: ViteImportGlobMeta;
1779
+ }
1780
+ interface BindingViteReactRefreshWrapperPluginConfig {
1781
+ cwd: string;
1782
+ include?: Array<BindingStringOrRegex>;
1783
+ exclude?: Array<BindingStringOrRegex>;
1784
+ jsxImportSource: string;
1785
+ reactRefreshHost: string;
1786
+ }
1787
+ interface BindingViteReporterPluginConfig {
1788
+ root: string;
1789
+ isTty: boolean;
1790
+ isLib: boolean;
1791
+ assetsDir: string;
1792
+ chunkLimit: number;
1793
+ warnLargeChunks: boolean;
1794
+ reportCompressedSize: boolean;
1795
+ logInfo?: (msg: string) => void;
1796
+ }
1797
+ interface BindingViteResolvePluginConfig {
1798
+ resolveOptions: BindingViteResolvePluginResolveOptions;
1799
+ environmentConsumer: string;
1800
+ environmentName: string;
1801
+ builtins: Array<BindingStringOrRegex>;
1802
+ external: true | string[];
1803
+ noExternal: true | Array<string | RegExp>;
1804
+ dedupe: Array<string>;
1805
+ disableCache?: boolean;
1806
+ legacyInconsistentCjsInterop?: boolean;
1807
+ finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
1808
+ finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
1809
+ resolveSubpathImports: (id: string, importer: string, isRequire: boolean, scan: boolean) => VoidNullable<string>;
1810
+ onWarn?: (message: string) => void;
1811
+ onDebug?: (message: string) => void;
1812
+ yarnPnp: boolean;
1813
+ }
1814
+ interface BindingViteResolvePluginResolveOptions {
1815
+ isBuild: boolean;
1816
+ isProduction: boolean;
1817
+ asSrc: boolean;
1818
+ preferRelative: boolean;
1819
+ isRequire?: boolean;
1820
+ root: string;
1821
+ scan: boolean;
1822
+ mainFields: Array<string>;
1823
+ conditions: Array<string>;
1824
+ externalConditions: Array<string>;
1825
+ extensions: Array<string>;
1826
+ tryIndex: boolean;
1827
+ tryPrefix?: string;
1828
+ preserveSymlinks: boolean;
1829
+ tsconfigPaths: boolean;
1830
+ }
1831
+ interface BindingViteTransformPluginConfig {
1832
+ root: string;
1833
+ include?: Array<BindingStringOrRegex>;
1834
+ exclude?: Array<BindingStringOrRegex>;
1835
+ jsxRefreshInclude?: Array<BindingStringOrRegex>;
1836
+ jsxRefreshExclude?: Array<BindingStringOrRegex>;
1837
+ isServerConsumer?: boolean;
1838
+ jsxInject?: string;
1839
+ transformOptions?: TransformOptions;
1840
+ yarnPnp?: boolean;
1841
+ }
1842
+ interface ExternalMemoryStatus {
1843
+ freed: boolean;
1844
+ reason?: string;
1845
+ }
1846
+ /** Error emitted from native side, it only contains kind and message, no stack trace. */
1847
+ interface NativeError {
1848
+ kind: string;
1849
+ message: string;
1850
+ /** The id of the file associated with the error */
1851
+ id?: string;
1852
+ /** The exporter associated with the error (for import/export errors) */
1853
+ exporter?: string;
1854
+ /** Location information (line, column, file) */
1855
+ loc?: BindingLogLocation;
1856
+ /** Position in the source file in UTF-16 code units */
1857
+ pos?: number;
1858
+ }
1859
+ interface PreRenderedChunk {
1860
+ /** The name of this chunk, which is used in naming patterns. */
1861
+ name: string;
1862
+ /** Whether this chunk is a static entry point. */
1863
+ isEntry: boolean;
1864
+ /** Whether this chunk is a dynamic entry point. */
1865
+ isDynamicEntry: boolean;
1866
+ /** The id of a module that this chunk corresponds to. */
1867
+ facadeModuleId?: string;
1868
+ /** The list of ids of modules included in this chunk. */
1869
+ moduleIds: Array<string>;
1870
+ /** Exported variable names from this chunk. */
1871
+ exports: Array<string>;
1872
+ }
1873
+ interface ViteImportGlobMeta {
1874
+ isSubImportsPattern?: boolean;
1875
+ }
1876
+ //#endregion
1877
+ export { BindingViteTransformPluginConfig as A, ParserOptions as B, BindingViteImportGlobPluginConfig as C, BindingViteReactRefreshWrapperPluginConfig as D, BindingViteModulePreloadPolyfillPluginConfig as E, JsxOptions as F, TransformOptions as G, ResolveResult as H, MinifyOptions as I, isolatedDeclarationSync as J, TsconfigCache as K, MinifyResult as L, ExternalMemoryStatus as M, IsolatedDeclarationsOptions as N, BindingViteReporterPluginConfig as O, IsolatedDeclarationsResult as P, NapiResolveOptions as R, BindingViteDynamicImportVarsPluginConfig as S, BindingViteManifestPluginConfig as T, ResolverFactory as U, PreRenderedChunk as V, SourceMap as W, moduleRunnerTransform as Y, BindingTransformHookExtraArgs as _, BindingEnhancedTransformOptions as a, BindingTsconfigResult as b, BindingHookResolveIdExtraArgs as c, BindingPluginContextResolveOptions as d, BindingRebuildStrategy as f, BindingRollipopWorkletsPluginConfig as g, BindingRollipopReactRefreshWrapperPluginConfig as h, BindingClientHmrUpdate as i, BindingWatcherBundler as j, BindingViteResolvePluginConfig as k, BindingIsolatedDeclarationPluginConfig as l, BindingReplacePluginConfig as m, BindingBundleAnalyzerPluginConfig as n, BindingEnhancedTransformResult as o, BindingRenderedChunk as p, isolatedDeclaration as q, BindingBundleState as r, BindingEsmExternalRequirePluginConfig as s, BindingBuiltinPluginName as t, BindingMagicString as u, BindingTsconfigCompilerOptions as v, BindingViteJsonPluginConfig as w, BindingViteBuildImportAnalysisPluginConfig as x, BindingTsconfigRawOptions as y, ParseResult as z };