kleisauke / wasm-vips

libvips for the browser and Node.js, compiled to WebAssembly with Emscripten.
https://kleisauke.github.io/wasm-vips/
MIT License
492 stars 25 forks source link

Typescript typedef fix #14

Closed Sparkenstein closed 2 years ago

Sparkenstein commented 2 years ago

Was just looking at this library, to be used in my react app with typescript. turns out the type definition that comes with library are like

declare namespace vips { ... }

i.e. they are not exported. you need to export them so that the lib is usable in other TS projects.

export namespace vips

otherwise we get following error:

File 'x/node_modules/wasm-vips/lib/vips.d.ts' is not a module.ts(2306)
kleisauke commented 2 years ago

Ah, you're right. I only tested these type definitions within the wasm-vips playground, which somehow didn't require this. This has been fixed with commit https://github.com/kleisauke/wasm-vips/commit/372e5e345cf0c57b4866b44fad5568eac2823eef.

kleisauke commented 2 years ago

v0.0.3 is now available.