diff options
Diffstat (limited to 'src/types')
| -rw-r--r-- | src/types/Date.d.ts | 10 | ||||
| -rw-r--r-- | src/types/Digit.d.ts | 3 | ||||
| -rw-r--r-- | src/types/Locale.ts | 2 | ||||
| -rw-r--r-- | src/types/Price.d.ts | 5 | ||||
| -rw-r--r-- | src/types/Scotsoun.d.ts | 20 | ||||
| -rw-r--r-- | src/types/TranslationsDictionary.d.ts | 6 |
6 files changed, 46 insertions, 0 deletions
diff --git a/src/types/Date.d.ts b/src/types/Date.d.ts new file mode 100644 index 0000000..5e1df66 --- /dev/null +++ b/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/src/types/Digit.d.ts b/src/types/Digit.d.ts new file mode 100644 index 0000000..0723a63 --- /dev/null +++ b/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/src/types/Locale.ts b/src/types/Locale.ts new file mode 100644 index 0000000..2964117 --- /dev/null +++ b/src/types/Locale.ts @@ -0,0 +1,2 @@ +type Locale = 'sco' | 'en-GB' +export default Locale
\ No newline at end of file diff --git a/src/types/Price.d.ts b/src/types/Price.d.ts new file mode 100644 index 0000000..e8d6157 --- /dev/null +++ b/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/src/types/Scotsoun.d.ts b/src/types/Scotsoun.d.ts new file mode 100644 index 0000000..f31a9b5 --- /dev/null +++ b/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 diff --git a/src/types/TranslationsDictionary.d.ts b/src/types/TranslationsDictionary.d.ts new file mode 100644 index 0000000..7ebb952 --- /dev/null +++ b/src/types/TranslationsDictionary.d.ts @@ -0,0 +1,6 @@ +import type { defaultLocale } from "../i18n/locales"; +import type Locale from "./Locale"; + +type TranslationsDictionary<Keys> = { + [key in Keys]: { [key in Locale]?: string } & { [key in typeof defaultLocale]: string } +};
\ No newline at end of file |
