ted537 / tsembind

Generate typescript bindings for Embind projects
23 stars 3 forks source link

Support different build patterns #2

Closed ted537 closed 3 years ago

ted537 commented 3 years ago

Sometimes require(user-lib.js) returns a factory , sometimes it returns a module, sometimes it returns an object containing a module as a property.

ted537 commented 3 years ago

For example, opencv-wasm returns an object that looks like {cv:Module}

ted537 commented 3 years ago

-s EXPORT_NAME is part of EMbind and therefore we should detect objects with a single property and treat that property as the module

ted537 commented 3 years ago

Nevermind, the opencv-wasm package applies some --post-js trickery