diff options
Diffstat (limited to 'frontend/src/types')
| -rw-r--r-- | frontend/src/types/Date.d.ts | 10 | ||||
| -rw-r--r-- | frontend/src/types/Digit.d.ts | 3 | ||||
| -rw-r--r-- | frontend/src/types/Price.d.ts | 5 | ||||
| -rw-r--r-- | frontend/src/types/Scotsoun.d.ts | 20 |
4 files changed, 38 insertions, 0 deletions
diff --git a/frontend/src/types/Date.d.ts b/frontend/src/types/Date.d.ts new file mode 100644 index 0000000..5e1df66 --- /dev/null +++ b/frontend/src/types/Date.d.ts @@ -0,0 +1,10 @@ +type Year = `${19 | 20}${Digit}${Digit}`; +type Month = '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12'; +type Day = + '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | + '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | + '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | + '30' | '31'; +type Date = `${Year}-${Month}-${Day}`; + +export default Date;
\ No newline at end of file diff --git a/frontend/src/types/Digit.d.ts b/frontend/src/types/Digit.d.ts new file mode 100644 index 0000000..0723a63 --- /dev/null +++ b/frontend/src/types/Digit.d.ts @@ -0,0 +1,3 @@ +type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + +export default Digit;
\ No newline at end of file diff --git a/frontend/src/types/Price.d.ts b/frontend/src/types/Price.d.ts new file mode 100644 index 0000000..e8d6157 --- /dev/null +++ b/frontend/src/types/Price.d.ts @@ -0,0 +1,5 @@ +import type Digit from "./Digit"; + +type Price = `${bigint | ''}.${Digit}${Digit}`; + +export default Price;
\ No newline at end of file diff --git a/frontend/src/types/Scotsoun.d.ts b/frontend/src/types/Scotsoun.d.ts new file mode 100644 index 0000000..f31a9b5 --- /dev/null +++ b/frontend/src/types/Scotsoun.d.ts @@ -0,0 +1,20 @@ +import type { defaultLocale } from '../i18n/locales'; +import type Date from './Date'; +import type Locale from './Locale'; +import type Price from './Price'; + +type Scotsoun = { + 'title': string, + 'subtitle'?: string, + 'long-name': string, + 'author'?: string, + 'cd-count': number, + 'price': Price, + 'scotsoun-id': string, + 'description'?: { [key in Locale]?: string } & { [key in typeof defaultLocale]: string }, + 'cover-artist'?: string, + 'track-list'?: string[], + 'release-date'?: Date, +}; + +export default Scotsoun;
\ No newline at end of file |
