mirror of
https://github.com/NaitLee/Cat-Printer.git
synced 2025-05-16 07:10:30 -07:00
33 lines
929 B
TypeScript
33 lines
929 B
TypeScript
|
|
type DictOf<T> = { [key: string]: T };
|
|
type Conditions = DictOf<string>;
|
|
type ConditionsOf<K extends Languages> = AllConditions[K];
|
|
type LanguageData = DictOf<Conditions | string>;
|
|
type Things = { [index: number | string]: number | string } | Array<number | string>;
|
|
type Extension = (things: Things, conditions: Conditions) => string;
|
|
type ExtensionOf<K extends Languages> = (things: Things, conditions: ConditionsOf<K>) => string;
|
|
type Languages = keyof AllConditions;
|
|
|
|
/**
|
|
* All known possible condition keys, per language
|
|
*/
|
|
type AllConditions = {
|
|
'en-US': {
|
|
'single': string,
|
|
'multiple': string,
|
|
'1st': string,
|
|
'2nd': string,
|
|
'3rd': string,
|
|
'nth': string
|
|
},
|
|
'de-DE': {
|
|
'single': string,
|
|
'multiple': string
|
|
},
|
|
'zh-CN': {}
|
|
};
|
|
|
|
interface I18nCallable extends I18n {
|
|
(text: string, things: Things, can_change_things: boolean): string;
|
|
}
|