CrystalComputerCorp / smpte-timecode

JavaScript library for operations with SMPTE timecodes
MIT License
68 stars 24 forks source link

Support needed for more fractional frame rates #41

Closed Boring-App closed 7 months ago

Boring-App commented 7 months ago

Hi - referencing this issue, as I believe it is not yet resolved. https://github.com/CrystalComputerCorp/smpte-timecode/issues/40

The issue is that we are using typescript, and we cannot simply add the framerate as a Number[].

If we try:

var test = new stc(900, [240000, 1001], true);

We get the error below.

test_timecode.ts:59:40 - error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'FRAMERATE | undefined'.

59 var nineHundredFrames = new stc(900, [240000, 1001], true);

m1tk4 commented 7 months ago

This looks like a typescript parameter typing level error not the lib error. stc() is not a constructor / type defined by the library.

SamuelCBlum commented 7 months ago

https://github.com/DefinitelyTyped/DefinitelyTyped/commit/f5f0186a59949fbc5caecd32e1ca85465f6838c0

This is the commit that fixes the issue.

@m1tk4

m1tk4 commented 6 months ago

Thanks @SamuelCBlum , good to know. Typedef seems a bit restrictive - in reality smpte-timecode would take numbers like 240 and 120, but [240,1] would be workarounds.