Open timmywil opened 1 year ago
@timmywil 's types look like a good start. It looks like Cue#tree.children
has the type Child[]
, where Child
is defined like this:
type Child = {
type: 'text'
value: string
} | {
type: 'object'
name: 'v' | 'lang'
classes: string[]
children: Child[]
value: string
} | {
type: 'object'
name: 'c' | 'i' | 'b' | 'u' | 'ruby' | 'rt'
classes: string[]
children: Child[]
}
Also WebVTTParser
's constructor takes entities?: Record<string, string>
as a parameter.
any plans to implement this?
I manually added types to my repo, but it's not comprehensive and only covers what I use. It would be great if this repo maintained its own types. Switching to TypeScript is not required. Only need to add a
.d.ts
file to the repo and set thetypes
field in package.json.Here's what I've gotten started, but I'm sure it's not completely accurate.
Thanks for considering.