Yahweasel / libav.js

This is a compilation of the libraries associated with handling audio and video in ffmpeg—libavformat, libavcodec, libavfilter, libavutil, libswresample, and libswscale—for emscripten, and thus the web.
288 stars 18 forks source link

Fix types for `ff_*_multi()` copyout overloads #41

Closed reinhrst closed 7 months ago

reinhrst commented 7 months ago

I ran into the issue that types.d.ts data is not correct for functions with copyout options. E.g. ff_read_multi() returns [number, Record<number, Packet[]>] in the default call, but [number, Record<number, Packet[]>]

I don't know if this PR fixes the issue in a direction you approve of; things become quite verbose, but I didn't see a quick and simple alternative.

Yahweasel commented 7 months ago

I didn't update the types here because I couldn't be bothered to write out exactly these monstrous union types. I don't mind if somebody else writes them for me tho X-D

reinhrst commented 7 months ago

I didn't update the types here because I couldn't be bothered to write out exactly these monstrous union types. I don't mind if somebody else writes them for me tho X-D

Fair enough :)