diff options
| author | Joe Carstairs <118172583+jcarstairs-scottlogic@users.noreply.github.com> | 2024-01-25 16:59:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-25 16:59:42 +0000 |
| commit | 1a6eb7e2ff0bf551e1560c67170e90fa8ec2a8ea (patch) | |
| tree | 53f73dcca5693e656d50fac965955560a513a233 /src/types/TranslationsDictionary.d.ts | |
| parent | 83c3460191a2089b56b091a7f4e09f39ac636e1e (diff) | |
33 / Pay annual subscription by PayPal (#68)
* Refactors paypal-buttons -> paypal-product-buttons WebComponent
* Pulls out address to data file
* Defines annual subscription prices data hash
* Styles paypal-product-buttons
* Styles <address>
* Details have cursor:pointer on the summary
* Moves Jyne section to separate page
* Rewrites payment options using details components
* Reworks translation typing
* Defines MembershipType enum
* Adds translations for MembershipType enum
* Can pay annual subs by PayPal
* Styles tables better
Diffstat (limited to 'src/types/TranslationsDictionary.d.ts')
| -rw-r--r-- | src/types/TranslationsDictionary.d.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/types/TranslationsDictionary.d.ts b/src/types/TranslationsDictionary.d.ts index 5033ecd..47ee7f4 100644 --- a/src/types/TranslationsDictionary.d.ts +++ b/src/types/TranslationsDictionary.d.ts @@ -1,12 +1,15 @@ import type { defaultLocale } from '$i18n/locales'; import type Locale from './Locale'; -export type Translation<Params> = (params: { [key in keyof Params]: string }) => string; +export type Translation<ParamsHash extends object> = (params: ParamsHash) => string; +export type LocalesTranslationHash<ParamsHash extends object> = { + [locale in Locale]?: Translation<ParamsHash>; +} & { + [locale in typeof defaultLocale]: Translation<ParamsHash>; +}; export type TranslationsDictionary<Raw> = { - readonly [key in keyof Raw]: { - [locale in Locale]?: Translation<Parameters<Raw[key][typeof defaultLocale]>[0]>; - } & { - [locale in typeof defaultLocale]: Translation<Parameters<Raw[key][typeof defaultLocale]>[0]>; - }; + readonly [key in keyof Raw]: LocalesTranslationHash< + Parameters<Raw[key][typeof defaultLocale]>[0] + >; }; |
