-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
C-bugCategory - BugCategory - Bug
Description
version used: oxc-transform@0.16.0
For example:
// my-function.ts
function MyFunction() {
return 'here is my function'
}
export { MyFunction }
declare global {
interface Window {
MyFunction: typeof MyFunction
}
}
window.MyFunction = MyFunction// dts-builder.js
import { readFile, writeFile } from 'node:fs/promises'
import oxc from 'oxc-transform'
const file = 'my-function.ts'
const text = await readFile(file, 'utf8')
const code = oxc.isolatedDeclaration(file, text)
await writeFile('my-function.d.ts', code.sourceText)Result of node dts-builder.js:
declare function MyFunction(): string;
export { MyFunction };For comparison, this is the result of npx tsc my-function.ts --declaration --emitDeclarationOnly --isolatedDeclarations:
declare function MyFunction(): string;
export { MyFunction };
declare global {
interface Window {
MyFunction: typeof MyFunction;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory - BugCategory - Bug
Type
Fields
Give feedbackPriority
None yet