@nubjs/nub-win32-arm64 0.0.1 → 0.0.2

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.
@@ -0,0 +1,658 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+ export interface Comment {
4
+ type: 'Line' | 'Block'
5
+ value: string
6
+ start: number
7
+ end: number
8
+ }
9
+
10
+ export interface ErrorLabel {
11
+ message: string | null
12
+ start: number
13
+ end: number
14
+ }
15
+
16
+ export interface OxcError {
17
+ severity: Severity
18
+ message: string
19
+ labels: Array<ErrorLabel>
20
+ helpMessage: string | null
21
+ codeframe: string | null
22
+ }
23
+
24
+ export declare const enum Severity {
25
+ Error = 'Error',
26
+ Warning = 'Warning',
27
+ Advice = 'Advice'
28
+ }
29
+ export interface SourceMap {
30
+ file?: string
31
+ mappings: string
32
+ names: Array<string>
33
+ sourceRoot?: string
34
+ sources: Array<string>
35
+ sourcesContent?: Array<string>
36
+ version: number
37
+ x_google_ignoreList?: Array<number>
38
+ }
39
+ export interface ArrowFunctionsOptions {
40
+ /**
41
+ * This option enables the following:
42
+ * * Wrap the generated function in .bind(this) and keeps uses of this inside the function as-is, instead of using a renamed this.
43
+ * * Add a runtime check to ensure the functions are not instantiated.
44
+ * * Add names to arrow functions.
45
+ *
46
+ * @default false
47
+ */
48
+ spec?: boolean
49
+ }
50
+
51
+ export interface CompilerAssumptions {
52
+ ignoreFunctionLength?: boolean
53
+ noDocumentAll?: boolean
54
+ objectRestNoSymbols?: boolean
55
+ pureGetters?: boolean
56
+ /**
57
+ * When using public class fields, assume that they don't shadow any getter in the current class,
58
+ * in its subclasses or in its superclass. Thus, it's safe to assign them rather than using
59
+ * `Object.defineProperty`.
60
+ *
61
+ * For example:
62
+ *
63
+ * Input:
64
+ * ```js
65
+ * class Test {
66
+ * field = 2;
67
+ *
68
+ * static staticField = 3;
69
+ * }
70
+ * ```
71
+ *
72
+ * When `set_public_class_fields` is `true`, the output will be:
73
+ * ```js
74
+ * class Test {
75
+ * constructor() {
76
+ * this.field = 2;
77
+ * }
78
+ * }
79
+ * Test.staticField = 3;
80
+ * ```
81
+ *
82
+ * Otherwise, the output will be:
83
+ * ```js
84
+ * import _defineProperty from "@oxc-project/runtime/helpers/defineProperty";
85
+ * class Test {
86
+ * constructor() {
87
+ * _defineProperty(this, "field", 2);
88
+ * }
89
+ * }
90
+ * _defineProperty(Test, "staticField", 3);
91
+ * ```
92
+ *
93
+ * NOTE: For TypeScript, if you wanted behavior is equivalent to `useDefineForClassFields: false`, you should
94
+ * set both `set_public_class_fields` and [`crate::TypeScriptOptions::remove_class_fields_without_initializer`]
95
+ * to `true`.
96
+ */
97
+ setPublicClassFields?: boolean
98
+ }
99
+
100
+ export interface DecoratorOptions {
101
+ /**
102
+ * Enables experimental support for decorators, which is a version of decorators that predates the TC39 standardization process.
103
+ *
104
+ * Decorators are a language feature which hasn’t yet been fully ratified into the JavaScript specification.
105
+ * This means that the implementation version in TypeScript may differ from the implementation in JavaScript when it it decided by TC39.
106
+ *
107
+ * @see https://www.typescriptlang.org/tsconfig/#experimentalDecorators
108
+ * @default false
109
+ */
110
+ legacy?: boolean
111
+ /**
112
+ * Enables emitting decorator metadata.
113
+ *
114
+ * This option the same as [emitDecoratorMetadata](https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata)
115
+ * in TypeScript, and it only works when `legacy` is true.
116
+ *
117
+ * @see https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata
118
+ * @default false
119
+ */
120
+ emitDecoratorMetadata?: boolean
121
+ }
122
+
123
+ export interface Es2015Options {
124
+ /** Transform arrow functions into function expressions. */
125
+ arrowFunction?: ArrowFunctionsOptions
126
+ }
127
+
128
+ export declare const enum HelperMode {
129
+ /**
130
+ * Runtime mode (default): Helper functions are imported from a runtime package.
131
+ *
132
+ * Example:
133
+ *
134
+ * ```js
135
+ * import helperName from "@oxc-project/runtime/helpers/helperName";
136
+ * helperName(...arguments);
137
+ * ```
138
+ */
139
+ Runtime = 'Runtime',
140
+ /**
141
+ * External mode: Helper functions are accessed from a global `babelHelpers` object.
142
+ *
143
+ * Example:
144
+ *
145
+ * ```js
146
+ * babelHelpers.helperName(...arguments);
147
+ * ```
148
+ */
149
+ External = 'External'
150
+ }
151
+
152
+ export interface Helpers {
153
+ mode?: HelperMode
154
+ }
155
+
156
+ /**
157
+ * TypeScript Isolated Declarations for Standalone DTS Emit (async)
158
+ *
159
+ * Note: This function can be slower than `isolatedDeclarationSync` due to the overhead of spawning a thread.
160
+ */
161
+ export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): Promise<IsolatedDeclarationsResult>
162
+
163
+ export interface IsolatedDeclarationsOptions {
164
+ /**
165
+ * Do not emit declarations for code that has an @internal annotation in its JSDoc comment.
166
+ * This is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid.
167
+ *
168
+ * Default: `false`
169
+ *
170
+ * See <https://www.typescriptlang.org/tsconfig/#stripInternal>
171
+ */
172
+ stripInternal?: boolean
173
+ sourcemap?: boolean
174
+ }
175
+
176
+ export interface IsolatedDeclarationsResult {
177
+ code: string
178
+ map?: SourceMap
179
+ errors: Array<OxcError>
180
+ }
181
+
182
+ /** TypeScript Isolated Declarations for Standalone DTS Emit */
183
+ export declare function isolatedDeclarationSync(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
184
+
185
+ /**
186
+ * Configure how TSX and JSX are transformed.
187
+ *
188
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
189
+ */
190
+ export interface JsxOptions {
191
+ /**
192
+ * Decides which runtime to use.
193
+ *
194
+ * - 'automatic' - auto-import the correct JSX factories
195
+ * - 'classic' - no auto-import
196
+ *
197
+ * @default 'automatic'
198
+ */
199
+ runtime?: 'classic' | 'automatic'
200
+ /**
201
+ * Emit development-specific information, such as `__source` and `__self`.
202
+ *
203
+ * @default false
204
+ */
205
+ development?: boolean
206
+ /**
207
+ * Toggles whether or not to throw an error if an XML namespaced tag name
208
+ * is used.
209
+ *
210
+ * Though the JSX spec allows this, it is disabled by default since React's
211
+ * JSX does not currently have support for it.
212
+ *
213
+ * @default true
214
+ */
215
+ throwIfNamespace?: boolean
216
+ /**
217
+ * Mark JSX elements and top-level React method calls as pure for tree shaking.
218
+ *
219
+ * @default true
220
+ */
221
+ pure?: boolean
222
+ /**
223
+ * Replaces the import source when importing functions.
224
+ *
225
+ * @default 'react'
226
+ */
227
+ importSource?: string
228
+ /**
229
+ * Replace the function used when compiling JSX expressions. It should be a
230
+ * qualified name (e.g. `React.createElement`) or an identifier (e.g.
231
+ * `createElement`).
232
+ *
233
+ * Only used for `classic` {@link runtime}.
234
+ *
235
+ * @default 'React.createElement'
236
+ */
237
+ pragma?: string
238
+ /**
239
+ * Replace the component used when compiling JSX fragments. It should be a
240
+ * valid JSX tag name.
241
+ *
242
+ * Only used for `classic` {@link runtime}.
243
+ *
244
+ * @default 'React.Fragment'
245
+ */
246
+ pragmaFrag?: string
247
+ /**
248
+ * Enable React Fast Refresh .
249
+ *
250
+ * Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh}
251
+ *
252
+ * @default false
253
+ */
254
+ refresh?: boolean | ReactRefreshOptions
255
+ }
256
+
257
+ /**
258
+ * Transform JavaScript code to a Vite Node runnable module.
259
+ *
260
+ * @param filename The name of the file being transformed.
261
+ * @param sourceText the source code itself
262
+ * @param options The options for the transformation. See {@link
263
+ * ModuleRunnerTransformOptions} for more information.
264
+ *
265
+ * @returns an object containing the transformed code, source maps, and any
266
+ * errors that occurred during parsing or transformation.
267
+ *
268
+ * Note: This function can be slower than `moduleRunnerTransformSync` due to the overhead of spawning a thread.
269
+ *
270
+ * @deprecated Only works for Vite.
271
+ */
272
+ export declare function moduleRunnerTransform(filename: string, sourceText: string, options?: ModuleRunnerTransformOptions | undefined | null): Promise<ModuleRunnerTransformResult>
273
+
274
+ export interface ModuleRunnerTransformOptions {
275
+ /**
276
+ * Enable source map generation.
277
+ *
278
+ * When `true`, the `sourceMap` field of transform result objects will be populated.
279
+ *
280
+ * @default false
281
+ *
282
+ * @see {@link SourceMap}
283
+ */
284
+ sourcemap?: boolean
285
+ }
286
+
287
+ export interface ModuleRunnerTransformResult {
288
+ /**
289
+ * The transformed code.
290
+ *
291
+ * If parsing failed, this will be an empty string.
292
+ */
293
+ code: string
294
+ /**
295
+ * The source map for the transformed code.
296
+ *
297
+ * This will be set if {@link TransformOptions#sourcemap} is `true`.
298
+ */
299
+ map?: SourceMap
300
+ deps: Array<string>
301
+ dynamicDeps: Array<string>
302
+ /**
303
+ * Parse and transformation errors.
304
+ *
305
+ * Oxc's parser recovers from common syntax errors, meaning that
306
+ * transformed code may still be available even if there are errors in this
307
+ * list.
308
+ */
309
+ errors: Array<OxcError>
310
+ }
311
+
312
+ /** @deprecated Only works for Vite. */
313
+ export declare function moduleRunnerTransformSync(filename: string, sourceText: string, options?: ModuleRunnerTransformOptions | undefined | null): ModuleRunnerTransformResult
314
+
315
+ export interface PluginsOptions {
316
+ styledComponents?: StyledComponentsOptions
317
+ taggedTemplateEscape?: boolean
318
+ }
319
+
320
+ export interface ReactRefreshOptions {
321
+ /**
322
+ * Specify the identifier of the refresh registration variable.
323
+ *
324
+ * @default `$RefreshReg$`.
325
+ */
326
+ refreshReg?: string
327
+ /**
328
+ * Specify the identifier of the refresh signature variable.
329
+ *
330
+ * @default `$RefreshSig$`.
331
+ */
332
+ refreshSig?: string
333
+ emitFullSignatures?: boolean
334
+ }
335
+
336
+ /**
337
+ * Configure how styled-components are transformed.
338
+ *
339
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins#styled-components}
340
+ */
341
+ export interface StyledComponentsOptions {
342
+ /**
343
+ * Enhances the attached CSS class name on each component with richer output to help
344
+ * identify your components in the DOM without React DevTools.
345
+ *
346
+ * @default true
347
+ */
348
+ displayName?: boolean
349
+ /**
350
+ * Controls whether the `displayName` of a component will be prefixed with the filename
351
+ * to make the component name as unique as possible.
352
+ *
353
+ * @default true
354
+ */
355
+ fileName?: boolean
356
+ /**
357
+ * Adds a unique identifier to every styled component to avoid checksum mismatches
358
+ * due to different class generation on the client and server during server-side rendering.
359
+ *
360
+ * @default true
361
+ */
362
+ ssr?: boolean
363
+ /**
364
+ * Transpiles styled-components tagged template literals to a smaller representation
365
+ * than what Babel normally creates, helping to reduce bundle size.
366
+ *
367
+ * @default true
368
+ */
369
+ transpileTemplateLiterals?: boolean
370
+ /**
371
+ * Minifies CSS content by removing all whitespace and comments from your CSS,
372
+ * keeping valuable bytes out of your bundles.
373
+ *
374
+ * @default true
375
+ */
376
+ minify?: boolean
377
+ /**
378
+ * Enables transformation of JSX `css` prop when using styled-components.
379
+ *
380
+ * **Note: This feature is not yet implemented in oxc.**
381
+ *
382
+ * @default true
383
+ */
384
+ cssProp?: boolean
385
+ /**
386
+ * Enables "pure annotation" to aid dead code elimination by bundlers.
387
+ *
388
+ * @default false
389
+ */
390
+ pure?: boolean
391
+ /**
392
+ * Adds a namespace prefix to component identifiers to ensure class names are unique.
393
+ *
394
+ * Example: With `namespace: "my-app"`, generates `componentId: "my-app__sc-3rfj0a-1"`
395
+ */
396
+ namespace?: string
397
+ /**
398
+ * List of file names that are considered meaningless for component naming purposes.
399
+ *
400
+ * When the `fileName` option is enabled and a component is in a file with a name
401
+ * from this list, the directory name will be used instead of the file name for
402
+ * the component's display name.
403
+ *
404
+ * @default `["index"]`
405
+ */
406
+ meaninglessFileNames?: Array<string>
407
+ /**
408
+ * Import paths to be considered as styled-components imports at the top level.
409
+ *
410
+ * **Note: This feature is not yet implemented in oxc.**
411
+ */
412
+ topLevelImportPaths?: Array<string>
413
+ }
414
+
415
+ /**
416
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
417
+ *
418
+ * Note: This function can be slower than `transform` due to the overhead of spawning a thread.
419
+ *
420
+ * @param filename The name of the file being transformed. If this is a
421
+ * relative path, consider setting the {@link TransformOptions#cwd} option.
422
+ * @param sourceText the source code itself
423
+ * @param options The options for the transformation. See {@link
424
+ * TransformOptions} for more information.
425
+ *
426
+ * @returns a promise that resolves to an object containing the transformed code,
427
+ * source maps, and any errors that occurred during parsing or transformation.
428
+ */
429
+ export declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): Promise<TransformResult>
430
+
431
+ /**
432
+ * Options for transforming a JavaScript or TypeScript file.
433
+ *
434
+ * @see {@link transform}
435
+ */
436
+ export interface TransformOptions {
437
+ /** Treat the source text as `js`, `jsx`, `ts`, `tsx`, or `dts`. */
438
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts'
439
+ /** Treat the source text as `script` or `module` code. */
440
+ sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous' | undefined
441
+ /**
442
+ * The current working directory. Used to resolve relative paths in other
443
+ * options.
444
+ */
445
+ cwd?: string
446
+ /**
447
+ * Enable source map generation.
448
+ *
449
+ * When `true`, the `sourceMap` field of transform result objects will be populated.
450
+ *
451
+ * @default false
452
+ *
453
+ * @see {@link SourceMap}
454
+ */
455
+ sourcemap?: boolean
456
+ /** Set assumptions in order to produce smaller output. */
457
+ assumptions?: CompilerAssumptions
458
+ /**
459
+ * Configure how TypeScript is transformed.
460
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/typescript}
461
+ */
462
+ typescript?: TypeScriptOptions
463
+ /**
464
+ * Configure how TSX and JSX are transformed.
465
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/jsx}
466
+ */
467
+ jsx?: 'preserve' | JsxOptions
468
+ /**
469
+ * Sets the target environment for the generated JavaScript.
470
+ *
471
+ * The lowest target is `es2015`.
472
+ *
473
+ * Example:
474
+ *
475
+ * * `'es2015'`
476
+ * * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
477
+ *
478
+ * @default `esnext` (No transformation)
479
+ *
480
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/lowering#target}
481
+ */
482
+ target?: string | Array<string>
483
+ /** Behaviour for runtime helpers. */
484
+ helpers?: Helpers
485
+ /**
486
+ * Define Plugin
487
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#define}
488
+ */
489
+ define?: Record<string, string>
490
+ /**
491
+ * Inject Plugin
492
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/global-variable-replacement#inject}
493
+ */
494
+ inject?: Record<string, string | [string, string]>
495
+ /** Decorator plugin */
496
+ decorator?: DecoratorOptions
497
+ /**
498
+ * Third-party plugins to use.
499
+ * @see {@link https://oxc.rs/docs/guide/usage/transformer/plugins}
500
+ */
501
+ plugins?: PluginsOptions
502
+ }
503
+
504
+ export interface TransformResult {
505
+ /**
506
+ * The transformed code.
507
+ *
508
+ * If parsing failed, this will be an empty string.
509
+ */
510
+ code: string
511
+ /**
512
+ * The source map for the transformed code.
513
+ *
514
+ * This will be set if {@link TransformOptions#sourcemap} is `true`.
515
+ */
516
+ map?: SourceMap
517
+ /**
518
+ * The `.d.ts` declaration file for the transformed code. Declarations are
519
+ * only generated if `declaration` is set to `true` and a TypeScript file
520
+ * is provided.
521
+ *
522
+ * If parsing failed and `declaration` is set, this will be an empty string.
523
+ *
524
+ * @see {@link TypeScriptOptions#declaration}
525
+ * @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration)
526
+ */
527
+ declaration?: string
528
+ /**
529
+ * Declaration source map. Only generated if both
530
+ * {@link TypeScriptOptions#declaration declaration} and
531
+ * {@link TransformOptions#sourcemap sourcemap} are set to `true`.
532
+ */
533
+ declarationMap?: SourceMap
534
+ /**
535
+ * Helpers used.
536
+ *
537
+ * @internal
538
+ *
539
+ * Example:
540
+ *
541
+ * ```text
542
+ * { "_objectSpread": "@oxc-project/runtime/helpers/objectSpread2" }
543
+ * ```
544
+ */
545
+ helpersUsed: Record<string, string>
546
+ /**
547
+ * Parse and transformation errors.
548
+ *
549
+ * Oxc's parser recovers from common syntax errors, meaning that
550
+ * transformed code may still be available even if there are errors in this
551
+ * list.
552
+ */
553
+ errors: Array<OxcError>
554
+ }
555
+
556
+ /**
557
+ * Transpile a JavaScript or TypeScript into a target ECMAScript version.
558
+ *
559
+ * @param filename The name of the file being transformed. If this is a
560
+ * relative path, consider setting the {@link TransformOptions#cwd} option..
561
+ * @param sourceText the source code itself
562
+ * @param options The options for the transformation. See {@link
563
+ * TransformOptions} for more information.
564
+ *
565
+ * @returns an object containing the transformed code, source maps, and any
566
+ * errors that occurred during parsing or transformation.
567
+ */
568
+ export declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult
569
+
570
+ export interface TypeScriptOptions {
571
+ jsxPragma?: string
572
+ jsxPragmaFrag?: string
573
+ onlyRemoveTypeImports?: boolean
574
+ allowNamespaces?: boolean
575
+ /**
576
+ * When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
577
+ *
578
+ * @deprecated
579
+ *
580
+ * Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
581
+ * without initializer, you can use `remove_class_fields_without_initializer: true` instead.
582
+ */
583
+ allowDeclareFields?: boolean
584
+ /**
585
+ * When enabled, class fields without initializers are removed.
586
+ *
587
+ * For example:
588
+ * ```ts
589
+ * class Foo {
590
+ * x: number;
591
+ * y: number = 0;
592
+ * }
593
+ * ```
594
+ * // transform into
595
+ * ```js
596
+ * class Foo {
597
+ * x: number;
598
+ * }
599
+ * ```
600
+ *
601
+ * The option is used to align with the behavior of TypeScript's `useDefineForClassFields: false` option.
602
+ * When you want to enable this, you also need to set [`crate::CompilerAssumptions::set_public_class_fields`]
603
+ * to `true`. The `set_public_class_fields: true` + `remove_class_fields_without_initializer: true` is
604
+ * equivalent to `useDefineForClassFields: false` in TypeScript.
605
+ *
606
+ * When `set_public_class_fields` is true and class-properties plugin is enabled, the above example transforms into:
607
+ *
608
+ * ```js
609
+ * class Foo {
610
+ * constructor() {
611
+ * this.y = 0;
612
+ * }
613
+ * }
614
+ * ```
615
+ *
616
+ * Defaults to `false`.
617
+ */
618
+ removeClassFieldsWithoutInitializer?: boolean
619
+ /**
620
+ * When true, optimize const enums by inlining their values at usage sites
621
+ * and removing the enum declaration.
622
+ *
623
+ * @default false
624
+ */
625
+ optimizeConstEnums?: boolean
626
+ /**
627
+ * When true, optimize regular (non-const) enums by inlining their member
628
+ * accesses at usage sites when the member value is statically known.
629
+ *
630
+ * Non-exported enum declarations are also removed when all members are
631
+ * evaluable and no references to the enum as a runtime value exist
632
+ * (e.g., `console.log(Foo)`, `typeof Foo`, or passing the enum as an argument).
633
+ *
634
+ * @default false
635
+ */
636
+ optimizeEnums?: boolean
637
+ /**
638
+ * Also generate a `.d.ts` declaration file for TypeScript files.
639
+ *
640
+ * The source file must be compliant with all
641
+ * [`isolatedDeclarations`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations)
642
+ * requirements.
643
+ *
644
+ * @default false
645
+ */
646
+ declaration?: IsolatedDeclarationsOptions
647
+ /**
648
+ * Rewrite or remove TypeScript import/export declaration extensions.
649
+ *
650
+ * - When set to `rewrite`, it will change `.ts`, `.mts`, `.cts` extensions to `.js`, `.mjs`, `.cjs` respectively.
651
+ * - When set to `remove`, it will remove `.ts`/`.mts`/`.cts`/`.tsx` extension entirely.
652
+ * - When set to `true`, it's equivalent to `rewrite`.
653
+ * - When set to `false` or omitted, no changes will be made to the extensions.
654
+ *
655
+ * @default false
656
+ */
657
+ rewriteImportExtensions?: 'rewrite' | 'remove' | boolean
658
+ }