JSPM

  • Created
  • Published
  • Downloads 281909
  • Score
    100M100P100Q175405F
  • License MIT

Oxc transform Node API

Package Exports

  • oxc-transform
  • oxc-transform/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (oxc-transform) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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>
}