Closed bates64 closed 6 months ago
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.
clang++
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:
file.d.ts
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)
[jsexport]
Added in https://github.com/leaningtech/cheerp-compiler/pull/162
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.
To emit a
file.d.ts
looking something like:(And for
[jsexport]
'd things, export types for those funcs)