oxc/npm/oxc-transform
2024-06-20 23:41:31 +08:00
..
scripts feat(npm/oxc-transform): setup npm/oxc-transform and publish 2024-06-18 22:12:47 +08:00
CHANGELOG.md Release crates v0.15.0 (#3743) 2024-06-19 01:15:55 +08:00
package.json Release npm/oxc-transform v0.15.1 2024-06-20 23:41:31 +08:00
README.md chore(oxc-transform): update README 2024-06-19 14:30:15 +08:00

Oxc Transform

Isolated Declarations for Standalone DTS Emit

Based on Oxc and conforms to TypeScript Compiler's --isolated-declaration .d.ts emit.

This is still in alpha and may yield incorrect results, feel free to submit a bug report.

Usage

import assert from 'assert';
import oxc from 'oxc-transform';

const { sourceText, errors } = oxc.isolatedDeclaration("test.ts", "class A {}");

assert.equal(sourceText, "declare class A {}\n");
assert(errors.length == 0);

API

export function isolatedDeclaration(filename: string, sourceText: string): IsolatedDeclarationsResult

export interface IsolatedDeclarationsResult {
  sourceText: string
  errors: Array<string>
}