oxc-transform
Advanced tools
Comparing version 0.25.0 to 0.26.0
@@ -21,6 +21,11 @@ /* auto-generated by NAPI-RS */ | ||
/** TypeScript Isolated Declarations for Standalone DTS Emit */ | ||
export declare function isolatedDeclaration(filename: string, sourceText: string): IsolatedDeclarationsResult | ||
export declare function isolatedDeclaration(filename: string, sourceText: string, options: IsolatedDeclarationsOptions): IsolatedDeclarationsResult | ||
export interface IsolatedDeclarationsOptions { | ||
sourcemap: boolean | ||
} | ||
export interface IsolatedDeclarationsResult { | ||
sourceText: string | ||
code: string | ||
map?: SourceMap | ||
errors: Array<string> | ||
@@ -179,3 +184,3 @@ } | ||
*/ | ||
sourceText: string | ||
code: string | ||
/** | ||
@@ -186,3 +191,3 @@ * The source map for the transformed code. | ||
*/ | ||
sourceMap?: SourceMap | ||
map?: SourceMap | ||
/** | ||
@@ -231,3 +236,14 @@ * The `.d.ts` declaration file for the transformed code. Declarations are | ||
declaration?: boolean | ||
/** | ||
* Rewrite or remove TypeScript import/export declaration extensions. | ||
* | ||
* - When set to `rewrite`, it will change `.ts`, `.mts`, `.cts` extensions to `.js`, `.mjs`, `.cjs` respectively. | ||
* - When set to `remove`, it will remove `.ts`/`.mts`/`.cts`/`.tsx` extension entirely. | ||
* - When set to `true`, it's equivalent to `rewrite`. | ||
* - When set to `false` or omitted, no changes will be made to the extensions. | ||
* | ||
* @default false | ||
*/ | ||
rewriteImportExtensions?: 'rewrite' | 'remove' | boolean | ||
} | ||
{ | ||
"name": "oxc-transform", | ||
"version": "0.25.0", | ||
"version": "0.26.0", | ||
"description": "Oxc transform Node API", | ||
@@ -26,11 +26,11 @@ "keywords": [ | ||
"optionalDependencies": { | ||
"@oxc-transform/binding-win32-x64-msvc": "0.25.0", | ||
"@oxc-transform/binding-win32-arm64-msvc": "0.25.0", | ||
"@oxc-transform/binding-linux-x64-gnu": "0.25.0", | ||
"@oxc-transform/binding-linux-arm64-gnu": "0.25.0", | ||
"@oxc-transform/binding-linux-x64-musl": "0.25.0", | ||
"@oxc-transform/binding-linux-arm64-musl": "0.25.0", | ||
"@oxc-transform/binding-darwin-x64": "0.25.0", | ||
"@oxc-transform/binding-darwin-arm64": "0.25.0" | ||
"@oxc-transform/binding-win32-x64-msvc": "0.26.0", | ||
"@oxc-transform/binding-win32-arm64-msvc": "0.26.0", | ||
"@oxc-transform/binding-linux-x64-gnu": "0.26.0", | ||
"@oxc-transform/binding-linux-arm64-gnu": "0.26.0", | ||
"@oxc-transform/binding-linux-x64-musl": "0.26.0", | ||
"@oxc-transform/binding-linux-arm64-musl": "0.26.0", | ||
"@oxc-transform/binding-darwin-x64": "0.26.0", | ||
"@oxc-transform/binding-darwin-arm64": "0.26.0" | ||
} | ||
} |
@@ -15,5 +15,11 @@ # Oxc Transform | ||
const { sourceText, errors } = oxc.isolatedDeclaration("test.ts", "class A {}"); | ||
const { sourceMap, sourceText, errors } = oxc.isolatedDeclaration("test.ts", "class A {}", { sourcemap: true }); | ||
assert.equal(sourceText, "declare class A {}\n"); | ||
assert.deepEqual(ret.sourceMap, { | ||
mappings: "AAAA,cAAM,EAAE,CAAE", | ||
names: [], | ||
sources: ["test.ts"], | ||
sourcesContent: ["class A {}"], | ||
}); | ||
assert(errors.length == 0); | ||
@@ -25,4 +31,8 @@ ``` | ||
```typescript | ||
export function isolatedDeclaration(filename: string, sourceText: string): IsolatedDeclarationsResult | ||
export function isolatedDeclaration(filename: string, sourceText: string, options: IsolatedDeclarationsOptions): IsolatedDeclarationsResult | ||
export interface IsolatedDeclarationsOptions { | ||
sourcemap: boolean | ||
} | ||
export interface IsolatedDeclarationsResult { | ||
@@ -29,0 +39,0 @@ sourceText: string |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18789
567
41