-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
181 lines (180 loc) · 6.03 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
export declare class AvDuration {
constructor(timeserial: number);
toString(): string;
valueOf(): number;
readonly hours: number;
readonly minutes: number;
readonly seconds: number;
readonly microseconds: number;
}
export interface Disposition {
readonly 'default': boolean;
readonly dub: boolean;
readonly original: boolean;
readonly comment: boolean;
readonly lyrics: boolean;
readonly karaoke: boolean;
readonly forced: boolean;
readonly hearingImpaired: boolean;
readonly visualImpaired: boolean;
readonly cleanEffects: boolean;
readonly attachedPic: boolean;
readonly timedThumbnails: boolean;
readonly captions: boolean;
readonly descriptions: boolean;
readonly metadata: boolean;
readonly dependent: boolean;
readonly stillImage: boolean;
}
export interface Metadata {
[key: string]: string | string[];
}
export interface StreamBase {
readonly id: number | null;
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
}
export declare type AvRational = [number, number];
export declare class AvStreamVideo implements StreamBase {
private constructor();
readonly id: number | null;
readonly typeName: 'video';
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
readonly pixFmt: string | null;
readonly bpc: number | null;
readonly colorRange: string | null;
readonly colorSpace: string | null;
readonly colorPrimaries: string | null;
readonly colorTransferCharacteristic: string | null;
readonly chromaLocation: string | null;
readonly fieldOrder: number;
readonly width: number;
readonly height: number;
readonly sar: AvRational;
readonly dar: AvRational;
readonly fps: number | null;
readonly tbr: number | null;
readonly tbn: number | null;
}
export declare class AvStreamAudio implements StreamBase {
private constructor();
readonly id: number | null;
readonly typeName: 'audio';
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
readonly frameSize: number;
readonly sampleRate: number;
readonly channels: number;
readonly channelLayout: string;
readonly sampleFormatName: string | null;
readonly bitsPerRawSample: number | null;
readonly delay: number;
readonly padding: number;
}
export declare class AvStreamData implements StreamBase {
private constructor();
readonly id: number | null;
readonly typeName: 'data';
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
readonly tbn: AvRational | null;
}
export declare class AvStreamSubtitle implements StreamBase {
private constructor();
readonly id: number | null;
readonly typeName: 'subtitle';
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
readonly width: number;
readonly height: number;
}
export declare class AvStreamAttachment implements StreamBase {
private constructor();
readonly id: number | null;
readonly typeName: 'attachment';
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly codecTag: string | null;
readonly bitrate: number;
readonly profile: string | null;
readonly level: number | null;
readonly codecName: string;
readonly disposition: Disposition;
readonly metadata: Metadata;
}
export declare type Stream = AvStreamVideo | AvStreamAudio | AvStreamData | AvStreamSubtitle | AvStreamAttachment;
export declare class AvChapter {
constructor(id: number, start: number, end: number, metadata?: Metadata);
readonly id: number;
readonly start: number;
readonly end: number;
readonly metadata?: Metadata;
}
export declare class AvProgram {
constructor(programId: number, flags: number, discard: number, streams: Stream[], metadata?: Metadata, programNum?: number, pmtPid?: number, pcrPid?: number, pmtVersion?: number);
readonly id: number;
readonly flags: number;
readonly discard: number;
readonly streams: Stream[];
readonly metadata?: Metadata;
readonly programNum?: number;
readonly pmtPid?: number;
readonly pcrPid?: number;
readonly pmtVersion?: number;
}
export declare class AvFormatContext {
private constructor();
readonly name: string;
readonly url: string;
readonly bitrate: number;
readonly duration: AvDuration | null;
readonly startTime: AvDuration | null;
readonly flags: number;
readonly metadata: Metadata;
readonly streams: Stream[];
readonly chapters: AvChapter[];
readonly programs: AvProgram[];
}
export interface Versions {
readonly avformat: string;
readonly avcodec: string;
readonly avutil: string;
}
export declare const versions: Versions;
export declare function getFileInfo(filePath: string): Promise<AvFormatContext>;