oxc-transform 0.39.0 → 0.40.0
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.
- package/index.d.ts +63 -2
- package/index.js +2 -0
- package/package.json +9 -9
package/index.d.ts
CHANGED
|
@@ -20,11 +20,52 @@ export interface CompilerAssumptions {
|
|
|
20
20
|
setPublicClassFields?: boolean
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface Error {
|
|
24
|
+
severity: Severity
|
|
25
|
+
message: string
|
|
26
|
+
labels: Array<ErrorLabel>
|
|
27
|
+
helpMessage?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ErrorLabel {
|
|
31
|
+
message?: string
|
|
32
|
+
start: number
|
|
33
|
+
end: number
|
|
34
|
+
}
|
|
35
|
+
|
|
23
36
|
export interface Es2015Options {
|
|
24
37
|
/** Transform arrow functions into function expressions. */
|
|
25
38
|
arrowFunction?: ArrowFunctionsOptions
|
|
26
39
|
}
|
|
27
40
|
|
|
41
|
+
export declare const enum HelperMode {
|
|
42
|
+
/**
|
|
43
|
+
* Runtime mode (default): Helper functions are imported from a runtime package.
|
|
44
|
+
*
|
|
45
|
+
* Example:
|
|
46
|
+
*
|
|
47
|
+
* ```js
|
|
48
|
+
* import helperName from "@babel/runtime/helpers/helperName";
|
|
49
|
+
* helperName(...arguments);
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
Runtime = 'Runtime',
|
|
53
|
+
/**
|
|
54
|
+
* External mode: Helper functions are accessed from a global `babelHelpers` object.
|
|
55
|
+
*
|
|
56
|
+
* Example:
|
|
57
|
+
*
|
|
58
|
+
* ```js
|
|
59
|
+
* babelHelpers.helperName(...arguments);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
External = 'External'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Helpers {
|
|
66
|
+
mode?: HelperMode
|
|
67
|
+
}
|
|
68
|
+
|
|
28
69
|
/** TypeScript Isolated Declarations for Standalone DTS Emit */
|
|
29
70
|
export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
|
|
30
71
|
|
|
@@ -44,7 +85,7 @@ export interface IsolatedDeclarationsOptions {
|
|
|
44
85
|
export interface IsolatedDeclarationsResult {
|
|
45
86
|
code: string
|
|
46
87
|
map?: SourceMap
|
|
47
|
-
errors: Array<
|
|
88
|
+
errors: Array<Error>
|
|
48
89
|
}
|
|
49
90
|
|
|
50
91
|
/**
|
|
@@ -158,6 +199,12 @@ export interface ReactRefreshOptions {
|
|
|
158
199
|
emitFullSignatures?: boolean
|
|
159
200
|
}
|
|
160
201
|
|
|
202
|
+
export declare const enum Severity {
|
|
203
|
+
Error = 'Error',
|
|
204
|
+
Warning = 'Warning',
|
|
205
|
+
Advice = 'Advice'
|
|
206
|
+
}
|
|
207
|
+
|
|
161
208
|
export interface SourceMap {
|
|
162
209
|
file?: string
|
|
163
210
|
mappings: string
|
|
@@ -228,6 +275,8 @@ export interface TransformOptions {
|
|
|
228
275
|
* @see [esbuild#target](https://esbuild.github.io/api/#target)
|
|
229
276
|
*/
|
|
230
277
|
target?: string | Array<string>
|
|
278
|
+
/** Behaviour for runtime helpers. */
|
|
279
|
+
helpers?: Helpers
|
|
231
280
|
/** Define Plugin */
|
|
232
281
|
define?: Record<string, string>
|
|
233
282
|
/** Inject Plugin */
|
|
@@ -264,6 +313,18 @@ export interface TransformResult {
|
|
|
264
313
|
* {@link TransformOptions#sourcemap sourcemap} are set to `true`.
|
|
265
314
|
*/
|
|
266
315
|
declarationMap?: SourceMap
|
|
316
|
+
/**
|
|
317
|
+
* Helpers used.
|
|
318
|
+
*
|
|
319
|
+
* @internal
|
|
320
|
+
*
|
|
321
|
+
* Example:
|
|
322
|
+
*
|
|
323
|
+
* ```text
|
|
324
|
+
* { "_objectSpread": "@babel/runtime/helpers/objectSpread2" }
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
helpersUsed: Record<string, string>
|
|
267
328
|
/**
|
|
268
329
|
* Parse and transformation errors.
|
|
269
330
|
*
|
|
@@ -271,7 +332,7 @@ export interface TransformResult {
|
|
|
271
332
|
* transformed code may still be available even if there are errors in this
|
|
272
333
|
* list.
|
|
273
334
|
*/
|
|
274
|
-
errors: Array<
|
|
335
|
+
errors: Array<Error>
|
|
275
336
|
}
|
|
276
337
|
|
|
277
338
|
export interface TypeScriptOptions {
|
package/index.js
CHANGED
|
@@ -361,5 +361,7 @@ if (!nativeBinding) {
|
|
|
361
361
|
throw new Error(`Failed to load native binding`)
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
module.exports.HelperMode = nativeBinding.HelperMode
|
|
364
365
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration
|
|
366
|
+
module.exports.Severity = nativeBinding.Severity
|
|
365
367
|
module.exports.transform = nativeBinding.transform
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-transform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Oxc transform Node API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"transform"
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"index.js"
|
|
24
24
|
],
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@oxc-transform/binding-win32-x64-msvc": "0.
|
|
27
|
-
"@oxc-transform/binding-win32-arm64-msvc": "0.
|
|
28
|
-
"@oxc-transform/binding-linux-x64-gnu": "0.
|
|
29
|
-
"@oxc-transform/binding-linux-arm64-gnu": "0.
|
|
30
|
-
"@oxc-transform/binding-linux-x64-musl": "0.
|
|
31
|
-
"@oxc-transform/binding-linux-arm64-musl": "0.
|
|
32
|
-
"@oxc-transform/binding-darwin-x64": "0.
|
|
33
|
-
"@oxc-transform/binding-darwin-arm64": "0.
|
|
26
|
+
"@oxc-transform/binding-win32-x64-msvc": "0.40.0",
|
|
27
|
+
"@oxc-transform/binding-win32-arm64-msvc": "0.40.0",
|
|
28
|
+
"@oxc-transform/binding-linux-x64-gnu": "0.40.0",
|
|
29
|
+
"@oxc-transform/binding-linux-arm64-gnu": "0.40.0",
|
|
30
|
+
"@oxc-transform/binding-linux-x64-musl": "0.40.0",
|
|
31
|
+
"@oxc-transform/binding-linux-arm64-musl": "0.40.0",
|
|
32
|
+
"@oxc-transform/binding-darwin-x64": "0.40.0",
|
|
33
|
+
"@oxc-transform/binding-darwin-arm64": "0.40.0"
|
|
34
34
|
}
|
|
35
35
|
}
|