UNPKG

19.2 kBTypeScriptView Raw
1declare module "node-id3" {
2 namespace NodeID3 {
3 export interface Tags {
4 /**
5 * 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.
6 */
7 album?: string,
8 /**
9 * 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.
10 */
11 bpm?: string,
12 /**
13 * The 'Composer(s)' frame is intended for the name of the composer(s). They are seperated with the "/" character.
14 */
15 composer?: string,
16 /**
17 * 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.
18 *
19 * 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...)"
20 */
21 genre?: string,
22 /**
23 * 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 © ".
24 */
25 copyright?: string,
26 /**
27 * The 'Date' frame is a numeric string in the DDMM format containing the date for the recording. This field is always four characters long.
28 */
29 date?: string,
30 /**
31 * 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.
32 */
33 playlistDelay?: string,
34 /**
35 * 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.
36 */
37 encodedBy?: string,
38 /**
39 * 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.
40 */
41 textWriter?: string,
42 /**
43 * The 'File type' frame indicates which type of audio this tag defines. The following type and refinements are defined:
44 *
45 * MPG MPEG Audio
46 * /1 MPEG 1/2 layer I
47 * /2 MPEG 1/2 layer II
48 * /3 MPEG 1/2 layer III
49 * /2.5 MPEG 2.5
50 * /AAC Advanced audio compression
51 * VQF Transform-domain Weighted Interleave Vector Quantization
52 * PCM Pulse Code Modulated audio
53 *
54 * 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".
55 */
56 fileType?: string,
57 /**
58 * The 'Time' frame is a numeric string in the HHMM format containing the time for the recording. This field is always four characters long.
59 */
60 time?: string,
61 /**
62 * 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").
63 */
64 contentGroup?: string,
65 /**
66 * The 'Title/Songname/Content description' frame is the actual name of the piece (e.g. "Adagio", "Hurricane Donna").
67 */
68 title?: string,
69 /**
70 * The 'Subtitle/Description refinement' frame is used for information directly related to the contents title (e.g. "Op. 16" or "Performed live at Wembley").
71 */
72 subtitle?: string,
73 /**
74 * 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.
75 */
76 initialKey?: string,
77 /**
78 * 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.
79 */
80 language?: string,
81 /**
82 * The 'Length' frame contains the length of the audiofile in milliseconds, represented as a numeric string.
83 */
84 length?: string,
85 /**
86 * 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)".
87 *
88 *DIG Other digital media
89 * /A Analog transfer from media
90 *
91 *ANA Other analog media
92 * /WAC Wax cylinder
93 * /8CA 8-track tape cassette
94 *
95 *CD CD
96 * /A Analog transfer from media
97 * /DD DDD
98 * /AD ADD
99 * /AA AAD
100 *
101 *LD Laserdisc
102 * /A Analog transfer from media
103 *
104 *TT Turntable records
105 * /33 33.33 rpm
106 * /45 45 rpm
107 * /71 71.29 rpm
108 * /76 76.59 rpm
109 * /78 78.26 rpm
110 * /80 80 rpm
111 *
112 *MD MiniDisc
113 * /A Analog transfer from media
114 *
115 *DAT DAT
116 * /A Analog transfer from media
117 * /1 standard, 48 kHz/16 bits, linear
118 * /2 mode 2, 32 kHz/16 bits, linear
119 * /3 mode 3, 32 kHz/12 bits, nonlinear, low speed
120 * /4 mode 4, 32 kHz/12 bits, 4 channels
121 * /5 mode 5, 44.1 kHz/16 bits, linear
122 * /6 mode 6, 44.1 kHz/16 bits, 'wide track' play
123 *
124 *DCC DCC
125 * /A Analog transfer from media
126 *
127 *DVD DVD
128 * /A Analog transfer from media
129 *
130 *TV Television
131 * /PAL PAL
132 * /NTSC NTSC
133 * /SECAM SECAM
134 *
135 *VID Video
136 * /PAL PAL
137 * /NTSC NTSC
138 * /SECAM SECAM
139 * /VHS VHS
140 * /SVHS S-VHS
141 * /BETA BETAMAX
142 *
143 *RAD Radio
144 * /FM FM
145 * /AM AM
146 * /LW LW
147 * /MW MW
148 *
149 *TEL Telephone
150 * /I ISDN
151 *
152 *MC MC (normal cassette)
153 * /4 4.75 cm/s (normal speed for a two sided cassette)
154 * /9 9.5 cm/s
155 * /I Type I cassette (ferric/normal)
156 * /II Type II cassette (chrome)
157 * /III Type III cassette (ferric chrome)
158 * /IV Type IV cassette (metal)
159 *
160 *REE Reel
161 * /9 9.5 cm/s
162 * /19 19 cm/s
163 * /38 38 cm/s
164 * /76 76 cm/s
165 * /I Type I cassette (ferric/normal)
166 * /II Type II cassette (chrome)
167 * /III Type III cassette (ferric chrome)
168 * /IV Type IV cassette (metal)
169 */
170 mediaType?: string,
171 /**
172 * 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.
173 */
174 originalTitle?: string,
175 /**
176 * 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.
177 */
178 originalFilename?: string,
179 /**
180 * 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.
181 */
182 originalTextwriter?: string,
183 /**
184 * 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.
185 */
186 originalArtist?: string,
187 /**
188 * 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.
189 */
190 originalYear?: string,
191 /**
192 * The 'File owner/licensee' frame contains the name of the owner or licensee of the file and it's contents.
193 */
194 fileOwner?: string,
195 /**
196 * The 'Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group' is used for the main artist(s). They are seperated with the "/" character.
197 */
198 artist?: string,
199 /**
200 * The 'Band/Orchestra/Accompaniment' frame is used for additional information about the performers in the recording.
201 */
202 performerInfo?: string,
203 /**
204 * The 'Conductor' frame is used for the name of the conductor.
205 */
206 conductor?: string,
207 /**
208 * The 'Interpreted, remixed, or otherwise modified by' frame contains more information about the people behind a remix and similar interpretations of another existing piece.
209 */
210 remixArtist?: string,
211 /**
212 * 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".
213 */
214 partOfSet?: string,
215 /**
216 * The 'Publisher' frame simply contains the name of the label or publisher.
217 */
218 publisher?: string,
219 /**
220 * 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".
221 */
222 trackNumber?: string,
223 /**
224 * 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.
225 */
226 recordingDates?: string,
227 /**
228 * The 'Internet radio station name' frame contains the name of the internet radio station from which the audio is streamed.
229 */
230 internetRadioName?: string,
231 /**
232 * The 'Internet radio station owner' frame contains the name of the owner of the internet radio station from which the audio is streamed.
233 */
234 internetRadioOwner?: string,
235 /**
236 * The 'Size' frame contains the size of the audiofile in bytes, excluding the ID3v2 tag, represented as a numeric string.
237 */
238 size?: string,
239 /**
240 * The 'ISRC' frame should contain the International Standard Recording Code (ISRC) (12 characters).
241 */
242 ISRC?: string,
243 /**
244 * 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.
245 */
246 encodingTechnology?: string,
247 /**
248 * The 'Year' frame is a numeric string with a year of the recording. This frames is always four characters long (until the year 10000).
249 */
250 year?: string,
251 comment?: {
252 language: string,
253 text: string,
254 },
255 unsynchronisedLyrics?: {
256 language: string,
257 text: string
258 }
259 userDefinedText?: [{
260 description: string,
261 value: string
262 }]
263 image?: string | {
264 mime: string
265 /**
266 * See https://en.wikipedia.org/wiki/ID3#ID3v2_embedded_image_extension
267 */
268 type: {
269 id: number,
270 name: string
271 },
272 description: string,
273 imageBuffer: Buffer,
274 },
275 popularimeter?: {
276 email: string,
277 /**
278 * 1-255
279 */
280 rating: number,
281 counter: number,
282 },
283 private?: [{
284 ownerIdentifier: string,
285 data: string
286 }],
287 chapter?: Array<{
288 elementID: string,
289 endTimeMs: number,
290 startTimeMs: number,
291 tags?: Tags
292 }>,
293 tableOfContents?: Array<{
294 elementID: string,
295 isOrdered?: boolean,
296 elements?: Array<string>
297 tags?: Tags
298 }>,
299 /**
300 * 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.
301 */
302 commercialUrl?: Array<string>,
303 /**
304 * The 'Copyright/Legal information' frame is a URL pointing at a webpage where the terms of use and ownership of the file is described.
305 */
306 copyrightUrl?: string,
307 /**
308 * The 'Official audio file webpage' frame is a URL pointing at a file specific webpage.
309 */
310 fileUrl?: string,
311 /**
312 * 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.
313 */
314 artistUrl?: Array<string>,
315 /**
316 * 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.
317 */
318 audioSourceUrl?: string,
319 /**
320 * The 'Official internet radio station homepage' contains a URL pointing at the homepage of the internet radio station.
321 */
322 radioStationUrl?: string,
323 /**
324 * The 'Payment' frame is a URL pointing at a webpage that will handle the process of paying for this file.
325 */
326 paymentUrl?: string,
327 /**
328 * The 'Publishers official webpage' frame is a URL pointing at the official wepage for the publisher.
329 */
330 publisherUrl?: string,
331 /**
332 * 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.
333 */
334 userDefinedUrl?: Array<{
335 description: string,
336 url: string
337 }>
338 }
339 export function write(tags: Tags, filebuffer: Buffer): Buffer
340 export function write(tags: Tags, filebuffer: Buffer, fun: (err: null, buffer: Buffer) => void): void
341 export function write(tags: Tags, filepath: string): true | Error
342 export function write(tags: Tags, filepath: string, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
343 export function create(tags: Tags): Buffer
344 export function create(tags: Tags, fn: (buffer: Buffer) => void): void
345 export function read(filebuffer: string | Buffer): Tags
346 export function read(filebuffer: string | Buffer, options: Object): Tags
347 export function read(filebuffer: string | Buffer, fn: (err: NodeJS.ErrnoException | null, tags: Tags | null) => void): void
348 export function read(filebuffer: string | Buffer, options: Object, fn: (err: NodeJS.ErrnoException | null, tags: Tags | null) => void): void
349 export function update(tags: Tags, filebuffer: Buffer): Buffer
350 export function update(tags: Tags, filepath: string): true | Error
351 export function update(tags: Tags, filepath: string, fn: (err: NodeJS.ErrnoException | Error | null) => void): void
352 export function update(tags: Tags, filebuffer: Buffer, fn: (err: NodeJS.ErrnoException | null, buffer?: Buffer) => void): void
353 export const Promise: {
354 write(tags: Tags, filebuffer: Buffer) : Promise<Buffer>,
355 write(tags: Tags, filepath: string) : Promise<boolean>,
356 create(tags: Tags) : Promise<Buffer>,
357 read(filebuffer: Buffer, options?: Object) : Promise<Tags>,
358 read(filepath: string, options?: Object) : Promise<Tags>,
359 update(tags: Tags, filebuffer: Buffer) : Promise<Buffer>,
360 update(tags: Tags, filepath: string) : Promise<boolean>,
361 removeTags(filepath: string) : Promise<Buffer>,
362 removeTags(filebuffer: Buffer) : Promise<Buffer>
363 }
364 }
365 export = NodeID3
366}
367
\No newline at end of file