-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
374 lines (374 loc) · 20 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
declare module "node-id3" {
namespace NodeID3 {
export interface Tags {
/**
* The 'Album/Movie/Show title' frame is intended for the title of the recording(/source of sound) which the audio in the file is taken from.
*/
album?: string,
/**
* The 'BPM' frame contains the number of beats per minute in the mainpart of the audio. The BPM is an integer and represented as a numerical string.
*/
bpm?: string,
/**
* The 'Composer(s)' frame is intended for the name of the composer(s). They are seperated with the "/" character.
*/
composer?: string,
/**
* The 'Content type', which previously was stored as a one byte numeric value only, is now a numeric string. You may use one or several of the types as ID3v1.1 did or, since the category list would be impossible to maintain with accurate and up to date categories, define your own.
*
* References to the ID3v1 genres can be made by, as first byte, enter "(" followed by a number from the genres list (appendix A) and ended with a ")" character. This is optionally followed by a refinement, e.g. "(21)" or "(4)Eurodisco". Several references can be made in the same frame, e.g. "(51)(39)". If the refinement should begin with a "(" character it should be replaced with "((", e.g. "((I can figure out any genre)" or "(55)((I think...)"
*/
genre?: string,
/**
* The 'Copyright message' frame, which must begin with a year and a space character (making five characters), is intended for the copyright holder of the original sound, not the audio file itself. The absence of this frame means only that the copyright information is unavailable or has been removed, and must not be interpreted to mean that the sound is public domain. Every time this field is displayed the field must be preceded with "Copyright © ".
*/
copyright?: string,
/**
* The 'Date' frame is a numeric string in the DDMM format containing the date for the recording. This field is always four characters long.
*/
date?: string,
/**
* The 'Playlist delay' defines the numbers of milliseconds of silence between every song in a playlist. The player should use the "ETC" frame, if present, to skip initial silence and silence at the end of the audio to match the 'Playlist delay' time. The time is represented as a numeric string.
*/
playlistDelay?: string,
/**
* The 'Encoded by' frame contains the name of the person or organisation that encoded the audio file. This field may contain a copyright message, if the audio file also is copyrighted by the encoder.
*/
encodedBy?: string,
/**
* The 'Lyricist(s)/Text writer(s)' frame is intended for the writer(s) of the text or lyrics in the recording. They are seperated with the "/" character.
*/
textWriter?: string,
/**
* The 'File type' frame indicates which type of audio this tag defines. The following type and refinements are defined:
*
* MPG MPEG Audio
* /1 MPEG 1/2 layer I
* /2 MPEG 1/2 layer II
* /3 MPEG 1/2 layer III
* /2.5 MPEG 2.5
* /AAC Advanced audio compression
* VQF Transform-domain Weighted Interleave Vector Quantization
* PCM Pulse Code Modulated audio
*
* but other types may be used, not for these types though. This is used in a similar way to the predefined types in the "Media type" frame, but without parentheses. If this frame is not present audio type is assumed to be "MPG".
*/
fileType?: string,
/**
* The 'Time' frame is a numeric string in the HHMM format containing the time for the recording. This field is always four characters long.
*/
time?: string,
/**
* The 'Content group description' frame is used if the sound belongs to a larger category of sounds/music. For example, classical music is often sorted in different musical sections (e.g. "Piano Concerto", "Weather - Hurricane").
*/
contentGroup?: string,
/**
* The 'Title/Songname/Content description' frame is the actual name of the piece (e.g. "Adagio", "Hurricane Donna").
*/
title?: string,
/**
* The 'Subtitle/Description refinement' frame is used for information directly related to the contents title (e.g. "Op. 16" or "Performed live at Wembley").
*/
subtitle?: string,
/**
* The 'Initial key' frame contains the musical key in which the sound starts. It is represented as a string with a maximum length of three characters. The ground keys are represented with "A","B","C","D","E", "F" and "G" and halfkeys represented with "b" and "#". Minor is represented as "m". Example "Cbm". Off key is represented with an "o" only.
*/
initialKey?: string,
/**
* The 'Language(s)' frame should contain the languages of the text or lyrics spoken or sung in the audio. The language is represented with three characters according to ISO-639-2. If more than one language is used in the text their language codes should follow according to their usage.
*/
language?: string,
/**
* The 'Length' frame contains the length of the audiofile in milliseconds, represented as a numeric string.
*/
length?: string,
/**
* The 'Media type' frame describes from which media the sound originated. This may be a text string or a reference to the predefined media types found in the list below. References are made within "(" and ")" and are optionally followed by a text refinement, e.g. "(MC) with four channels". If a text refinement should begin with a "(" character it should be replaced with "((". Predefined refinements is appended after the media type, e.g. "(CD/A)" or "(VID/PAL/VHS)".
*
*DIG Other digital media
* /A Analog transfer from media
*
*ANA Other analog media
* /WAC Wax cylinder
* /8CA 8-track tape cassette
*
*CD CD
* /A Analog transfer from media
* /DD DDD
* /AD ADD
* /AA AAD
*
*LD Laserdisc
* /A Analog transfer from media
*
*TT Turntable records
* /33 33.33 rpm
* /45 45 rpm
* /71 71.29 rpm
* /76 76.59 rpm
* /78 78.26 rpm
* /80 80 rpm
*
*MD MiniDisc
* /A Analog transfer from media
*
*DAT DAT
* /A Analog transfer from media
* /1 standard, 48 kHz/16 bits, linear
* /2 mode 2, 32 kHz/16 bits, linear
* /3 mode 3, 32 kHz/12 bits, nonlinear, low speed
* /4 mode 4, 32 kHz/12 bits, 4 channels
* /5 mode 5, 44.1 kHz/16 bits, linear
* /6 mode 6, 44.1 kHz/16 bits, 'wide track' play
*
*DCC DCC
* /A Analog transfer from media
*
*DVD DVD
* /A Analog transfer from media
*
*TV Television
* /PAL PAL
* /NTSC NTSC
* /SECAM SECAM
*
*VID Video
* /PAL PAL
* /NTSC NTSC
* /SECAM SECAM
* /VHS VHS
* /SVHS S-VHS
* /BETA BETAMAX
*
*RAD Radio
* /FM FM
* /AM AM
* /LW LW
* /MW MW
*
*TEL Telephone
* /I ISDN
*
*MC MC (normal cassette)
* /4 4.75 cm/s (normal speed for a two sided cassette)
* /9 9.5 cm/s
* /I Type I cassette (ferric/normal)
* /II Type II cassette (chrome)
* /III Type III cassette (ferric chrome)
* /IV Type IV cassette (metal)
*
*REE Reel
* /9 9.5 cm/s
* /19 19 cm/s
* /38 38 cm/s
* /76 76 cm/s
* /I Type I cassette (ferric/normal)
* /II Type II cassette (chrome)
* /III Type III cassette (ferric chrome)
* /IV Type IV cassette (metal)
*/
mediaType?: string,
/**
* The 'Original album/movie/show title' frame is intended for the title of the original recording (or source of sound), if for example the music in the file should be a cover of a previously released song.
*/
originalTitle?: string,
/**
* The 'Original filename' frame contains the preferred filename for the file, since some media doesn't allow the desired length of the filename. The filename is case sensitive and includes its suffix.
*/
originalFilename?: string,
/**
* The 'Original lyricist(s)/text writer(s)' frame is intended for the text writer(s) of the original recording, if for example the music in the file should be a cover of a previously released song. The text writers are seperated with the "/" character.
*/
originalTextwriter?: string,
/**
* The 'Original artist(s)/performer(s)' frame is intended for the performer(s) of the original recording, if for example the music in the file should be a cover of a previously released song. The performers are seperated with the "/" character.
*/
originalArtist?: string,
/**
* The 'Original release year' frame is intended for the year when the original recording, if for example the music in the file should be a cover of a previously released song, was released. The field is formatted as in the "Year" frame.
*/
originalYear?: string,
/**
* The 'File owner/licensee' frame contains the name of the owner or licensee of the file and it's contents.
*/
fileOwner?: string,
/**
* The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is used for the main artist(s). They are seperated with the "/" character.
*/
artist?: string,
/**
* The 'Band/Orchestra/Accompaniment' frame is used for additional information about the performers in the recording.
*/
performerInfo?: string,
/**
* The 'Conductor' frame is used for the name of the conductor.
*/
conductor?: string,
/**
* The 'Interpreted, remixed, or otherwise modified by' frame contains more information about the people behind a remix and similar interpretations of another existing piece.
*/
remixArtist?: string,
/**
* The 'Part of a set' frame is a numeric string that describes which part of a set the audio came from. This frame is used if the source described in the "Album/Movie/Show title" frame is divided into several mediums, e.g. a double CD. The value may be extended with a "/" character and a numeric string containing the total number of parts in the set. E.g. "1/2".
*/
partOfSet?: string,
/**
* The 'Publisher' frame simply contains the name of the label or publisher.
*/
publisher?: string,
/**
* The 'Track number/Position in set' frame is a numeric string containing the order number of the audio-file on its original recording. This may be extended with a "/" character and a numeric string containing the total numer of tracks/elements on the original recording. E.g. "4/9".
*/
trackNumber?: string,
/**
* The 'Recording dates' frame is a intended to be used as complement to the "Year", "Date" and "Time" frames. E.g. "4th-7th June, 12th June" in combination with the "Year" frame.
*/
recordingDates?: string,
/**
* The 'Internet radio station name' frame contains the name of the internet radio station from which the audio is streamed.
*/
internetRadioName?: string,
/**
* The 'Internet radio station owner' frame contains the name of the owner of the internet radio station from which the audio is streamed.
*/
internetRadioOwner?: string,
/**
* The 'Size' frame contains the size of the audiofile in bytes, excluding the ID3v2 tag, represented as a numeric string.
*/
size?: string,
/**
* The 'ISRC' frame should contain the International Standard Recording Code (ISRC) (12 characters).
*/
ISRC?: string,
/**
* The 'Software/Hardware and settings used for encoding' frame includes the used audio encoder and its settings when the file was encoded. Hardware refers to hardware encoders, not the computer on which a program was run.
*/
encodingTechnology?: string,
/**
* The 'Year' frame is a numeric string with a year of the recording. This frames is always four characters long (until the year 10000).
*/
year?: string,
comment?: {
language: string,
text: string,
},
unsynchronisedLyrics?: {
language: string,
text: string
}
userDefinedText?: [{
description: string,
value: string
}]
image?: string | {
mime: string
/**
* See https://en.wikipedia.org/wiki/ID3#ID3v2_embedded_image_extension
*/
type: {
id: number,
name: string
},
description: string,
imageBuffer: Buffer,
},
popularimeter?: {
email: string,
/**
* 1-255
*/
rating: number,
counter: number,
},
private?: [{
ownerIdentifier: string,
data: string
}],
chapter?: Array<{
elementID: string,
endTimeMs: number,
startTimeMs: number,
tags?: {
image?: Tags["image"],
title?: string,
},
}>,
tableOfContents?: Array<{
elementID: string,
isOrdered?: boolean,
elements?: Array<string>
tags?: Tags
}>,
/**
* The 'Commercial information' frame is a URL pointing at a webpage with information such as where the album can be bought. There may be more than one "WCOM" frame in a tag, but not with the same content.
*/
commercialUrl?: Array<string>,
/**
* The 'Copyright/Legal information' frame is a URL pointing at a webpage where the terms of use and ownership of the file is described.
*/
copyrightUrl?: string,
/**
* The 'Official audio file webpage' frame is a URL pointing at a file specific webpage.
*/
fileUrl?: string,
/**
* The 'Official artist/performer webpage' frame is a URL pointing at the artists official webpage. There may be more than one "WOAR" frame in a tag if the audio contains more than one performer, but not with the same content.
*/
artistUrl?: Array<string>,
/**
* The 'Official audio source webpage' frame is a URL pointing at the official webpage for the source of the audio file, e.g. a movie.
*/
audioSourceUrl?: string,
/**
* The 'Official internet radio station homepage' contains a URL pointing at the homepage of the internet radio station.
*/
radioStationUrl?: string,
/**
* The 'Payment' frame is a URL pointing at a webpage that will handle the process of paying for this file.
*/
paymentUrl?: string,
/**
* The 'Publishers official webpage' frame is a URL pointing at the official wepage for the publisher.
*/
publisherUrl?: string,
/**
* The 'User-defined URL link' frame is intended for URL links concerning the audiofile in a similar way to the other "W"-frames. There may be more than one "WXXX" frame in each tag, but only one with the same description.
*/
userDefinedUrl?: Array<{
description: string,
url: string
}>,
raw?: Tags
}
export function write(tags: Tags, filebuffer: Buffer): Buffer
export function write(tags: Tags, filebuffer: Buffer, fun: (err: null, buffer: Buffer) => void): void
export function write(tags: Tags, filepath: string): true | Error
export function write(tags: Tags, filepath: string, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
export function create(tags: Tags): Buffer
export function create(tags: Tags, fn: (buffer: Buffer) => void): void
export function read(filebuffer: string | Buffer): Tags
export function read(filebuffer: string | Buffer, options: Object): Tags
export function read(filebuffer: string | Buffer, fn: (err: NodeJS.ErrnoException | null, tags: Tags | null) => void): void
export function read(filebuffer: string | Buffer, options: Object, fn: (err: NodeJS.ErrnoException | null, tags: Tags | null) => void): void
export function update(tags: Tags, filebuffer: Buffer, options?: Object): Buffer
export function update(tags: Tags, filepath: string, options?: Object): true | Error
export function update(tags: Tags, filepath: string, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
export function update(tags: Tags, filepath: string, options: Object, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
export function update(tags: Tags, filebuffer: Buffer, fn: (err: NodeJS.ErrnoException | null, buffer?: Buffer) => void): void
export function update(tags: Tags, filebuffer: Buffer, options: Object, fn: (err: NodeJS.ErrnoException | null, buffer?: Buffer) => void): void
export function removeTags(filepath: string): true | Error
export function removeTags(filepath: string, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
export const Promise: {
write(tags: Tags, filebuffer: Buffer): Promise<Buffer>,
write(tags: Tags, filepath: string): Promise<boolean>,
create(tags: Tags): Promise<Buffer>,
read(filebuffer: Buffer, options?: Object): Promise<Tags>,
read(filepath: string, options?: Object): Promise<Tags>,
update(tags: Tags, filebuffer: Buffer): Promise<Buffer>,
update(tags: Tags, filepath: string): Promise<boolean>,
removeTags(filepath: string): Promise<Buffer>,
removeTags(filebuffer: Buffer): Promise<Buffer>
}
}
export = NodeID3
}