Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: emit TypeScript type declarations #146

Closed
bates64 opened this issue Jun 6, 2023 · 1 comment
Closed

Suggestion: emit TypeScript type declarations #146

bates64 opened this issue Jun 6, 2023 · 1 comment

Comments

@bates64
Copy link
Contributor

bates64 commented Jun 6, 2023

Fairly large feature I expect but it'd be awesome if you could pass a flag to clang++ to generate TypeScript declarations for the module.

e.g.

clang++ -target cheerp-wasm file.c -o file.js -cheerp-make-types=file.d.ts

To emit a file.d.ts looking something like:

export type InstanciateOptions = {
    buffer: /* some typed array */,
} | {
    absPath: string | URL,
}

export default function instanciate(options: InstanciateOptions?): Promise<{}>

(And for [jsexport]'d things, export types for those funcs)

@DutChen18
Copy link
Member

Added in leaningtech/cheerp-compiler#162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants