From 97147d56d93c7949fdccf22abe569b1b9d7a22ab Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 5 Aug 2023 10:43:30 +0100 Subject: Adds Scotsoun data --- frontend/src/types/Date.d.ts | 10 ++++++++++ frontend/src/types/Digit.d.ts | 3 +++ frontend/src/types/Price.d.ts | 5 +++++ frontend/src/types/Scotsoun.d.ts | 20 ++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 frontend/src/types/Date.d.ts create mode 100644 frontend/src/types/Digit.d.ts create mode 100644 frontend/src/types/Price.d.ts create mode 100644 frontend/src/types/Scotsoun.d.ts (limited to 'frontend/src/types') 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 -- cgit v1.2.3