-
Notifications
You must be signed in to change notification settings - Fork 1
/
common_types.ts
48 lines (41 loc) · 1.17 KB
/
common_types.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
/**
* Common type definitions for MusicBrainz.
*
* These types are not API specific but also used in other contexts, for example
* for entity editor seeding.
*
* @module
*/
/** Date with optional year, month and day. */
export interface PartialDate {
day?: number;
month?: number;
year?: number;
}
/** ISO 8601 `YYYY-MM-DD` date, can be partial (`YYYY-MM` or `YYYY`). */
export type IsoDate =
| `${number}-${number}-${number}`
| `${number}-${number}`
| `${number}`;
/** ISO 3166-1 (two letter), 3166-2 or 3166-3 (three letter) code of a country. */
export type IsoCountryCode = string;
/**
* [ISO 639-3] (three letter) code of a language.
*
* [ISO 639-3]: https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes
*/
export type IsoLanguageCode = string;
/**
* [ISO 15924] (four letter) code of a script.
*
* [ISO 15924]: https://en.wikipedia.org/wiki/ISO_15924
*/
export type IsoScriptCode = string;
/**
* Language and optional territory and/or variant, separated by underscores:
* - ISO 639 (two or three letters) language code
* - ISO 3166-1 country code
*/
export type Locale = string;
/** MusicBrainz ID, a UUID (usually v4). */
export type MBID = string;