wavesurfer.js icon indicating copy to clipboard operation
wavesurfer.js copied to clipboard

Type error in region "setOptions" function

Open jaredgei opened this issue 1 year ago • 1 comments

Bug description

The typescript type for region.setOptions requires "start" to be specified, even though there is specific code to handle "start" being undefined.

Minimal code snippet

region.setOptions({ color: getColor(word) }); doesn't work ^

region.setOptions({ color: getColor(word), start: region.start }); works ^

Obtained result

  Property 'start' is missing in type '{ color: string; }' but required in type 'Omit<RegionParams, "minLength" | "maxLength">'.ts(2345)```

jaredgei avatar Sep 19 '24 20:09 jaredgei

Thanks! We should probably add it to the omitted prop list.

katspaugh avatar Sep 20 '24 08:09 katspaugh