-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] TypeScript Conversion / Support #126
Comments
Thanks! Yes, that's a good addition. Feel free to open a PR, otherwise it's something I could get to in the next few weeks. |
Awesome! I'll likely have a PR up to make those updates in the next week or so :) Update - 7/7/22: Finished converting |
Draft PR is up, it's definitely a bit of a beast. It all functions as expected, but there are some eslint issues left to solve. Thanks for the patience, I've had some stuff come up and was busier than expected. |
rough sketch of the types declare module "node-webvtt" {
interface Opts {
meta?: boolean
strict?: boolean
}
export interface Cue {
identifier: string
start: number
end: number
text: string
styles: string
}
export interface VTT {
valid: boolean
strict: boolean
cues: Cue[]
errors: unknown[]
meta?: Partial<Record<string, string>>
}
export interface Segment {
duration: number
cues: ReadonlyArray<Cue>
}
export function parse(input: string, options?: Opts): VTT
export function compile(input: VTT): string
export namespace hls {
export function hlsSegment(
input: string,
segmentLength?: number,
startOffset?: number,
): ReadonlyArray<Segment>
export function hlsSegmentPlaylist(
input: string,
segmentLength?: number,
): ReadonlyArray<Segment>
}
} |
@meoyawn @samuel-greenberg what if we just added a typedef? would that be easier? I noticed the PR was closed |
any update on this? |
@cellulosa let me know if we can just add a typedef instead |
I mean that'd be an easy fix for the time being |
I like this parser and as a TypeScript user am interested in a typed version of this package. Wanted to start a discussion about that process if you are interested, and how I can help in the event it moves forward.
The text was updated successfully, but these errors were encountered: