1 |
|
2 | import { PassThrough } from 'stream';
|
3 | import miniget from 'miniget';
|
4 | declare namespace m3u8stream {
|
5 | interface Options {
|
6 | begin?: number | string;
|
7 | liveBuffer?: number;
|
8 | chunkReadahead?: number;
|
9 | highWaterMark?: number;
|
10 | requestOptions?: miniget.Options;
|
11 | parser?: 'm3u8' | 'dash-mpd';
|
12 | id?: string;
|
13 | }
|
14 | interface Progress {
|
15 | num: number;
|
16 | size: number;
|
17 | duration: number;
|
18 | url: string;
|
19 | }
|
20 | interface Stream extends PassThrough {
|
21 | end: () => this;
|
22 | on(event: 'progress', listener: (progress: Progress, totalSegments: number, downloadedBytes: number) => void): this;
|
23 | on(event: string | symbol, listener: (...args: any) => void): this;
|
24 | }
|
25 | interface m3u8streamFunc {
|
26 | (playlistURL: string, options?: m3u8stream.Options): Stream;
|
27 | parseTimestamp(time: number | string): number;
|
28 | }
|
29 | }
|
30 | declare let m3u8stream: m3u8stream.m3u8streamFunc;
|
31 | export = m3u8stream;
|