Conforms to TypeScript compiler's --isolatedDeclarations.d.ts emit.
Usage
import assert from "node:assert";import { isolatedDeclarationSync } from "oxc-transform";const { map, code, errors } = isolatedDeclarationSync("test.ts", "class A {}");// or `await isolatedDeclaration(filename, code, options)`assert.equal(code, "declare class A {}\n");assert(errors.length == 0);
Use the Sync versions for synchronous operations. Use async versions for asynchronous operations, which can be beneficial in I/O-bound or concurrent scenarios, though they add async overhead.