DefinitelyTyped/types/subtitle/index.d.ts
Mathieu Tanguay e585019e4f fixed toMS instead of toMs (#37473)
* subtitle: added function stringifyVtt

* Fixed toMS typo error
2019-08-09 07:19:59 -07:00

20 lines
816 B
TypeScript

// Type definitions for subtitle 2.0
// Project: https://github.com/gsantiago/subtitle.js#readme
// Definitions by: Low Jeng Lam <https://github.com/jenglamlow>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface subTitleType {
start: number | string;
end: number | string;
text: string;
setting?: string;
}
export function parse(srtOrVtt: string): subTitleType[];
export function stringify(captions: ReadonlyArray<subTitleType>): string;
export function stringifyVtt(captions: ReadonlyArray<subTitleType>): string;
export function resync(captions: ReadonlyArray<subTitleType>, time: number): subTitleType[];
export function toMS(timestamp: string): number;
export function toSrtTime(timestamp: number): string;
export function toVttTime(timestamp: number): string;