You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Type supported web standard component, @thorvg/lottie-player should support the explicit type defination.
lottie-player.ts
There is no module type, the TvgModule is just any type. We have no benefit to take TvgModule.
As we can see in the comment, WASM Glue code didn't have type here. In fact, the Emscripten is able to provide type defination.
// @ts-ignore: WASM Glue code doesn't have type & Only available on build progressimportModulefrom'../dist/thorvg-wasm';// ...typeTvgModule=any;
The emscripten::val is too ambiguous for TypeScript dev. Although the val is flexible and easier to bind, the compiler would map this to TypeScript's any type by default.
TypeScript developer could struggle without type, and emscripten::register_type surely helps this point.
val duration()
{
if (!canvas || !animation) returnval(0);
returnval(animation->duration()); // Actually no-type here
}
As a Type supported web standard component,
@thorvg/lottie-player
should support the explicit type defination.lottie-player.ts
There is no module type, the
TvgModule
is justany
type. We have no benefit to takeTvgModule
.As we can see in the comment, WASM Glue code didn't have type here. In fact, the Emscripten is able to provide type defination.
see: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#typescript-definitions
tvgWasmLottieAnimation
The
emscripten::val
is too ambiguous for TypeScript dev. Although theval
is flexible and easier to bind, the compiler would map this to TypeScript'sany
type by default.TypeScript developer could struggle without type, and
emscripten::register_type
surely helps this point.see: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#custom-val-definitions
The text was updated successfully, but these errors were encountered: