Installation
npm install --save @types/subtitle
Summary
This package contains type definitions for subtitle (https://github.com/gsantiago/subtitle.js#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subtitle.
index.d.ts
export interface subTitleType {
start: number | string;
end: number | string;
text: string;
setting?: string | undefined;
}
export function parse(srtOrVtt: string): subTitleType[];
export function stringify(captions: readonly subTitleType[]): string;
export function stringifyVtt(captions: readonly subTitleType[]): string;
export function resync(captions: readonly subTitleType[], time: number): subTitleType[];
export function toMS(timestamp: string): number;
export function toSrtTime(timestamp: number): string;
export function toVttTime(timestamp: number): string;
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: none
Credits
These definitions were written by Low Jeng Lam.