Files
2018-10-30 12:24:33 +08:00

19 lines
739 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 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;