I18nDict TS type

pull/8491/head
Thibault Duplessis 2021-03-27 14:04:28 +01:00
parent 7ef234c885
commit d0a566fc03
13 changed files with 15 additions and 13 deletions

View File

@ -33,7 +33,7 @@ interface Lichess {
studyTour(study: Study): void;
studyTourChapter(study: Study): void;
trans(i18n: { [key: string]: string | undefined }): Trans;
trans(i18n: I18nDict): Trans;
quantity(n: number): 'zero' | 'one' | 'few' | 'many' | 'other';
socket: any;
@ -81,6 +81,8 @@ interface Lichess {
keyboardMove?: any;
}
type I18nDict = { [key: string]: string };
type RedirectTo = string | { url: string; cookie: Cookie };
type UserComplete = (opts: UserCompleteOpts) => void;

View File

@ -115,7 +115,7 @@ export interface AnalyseOpts {
relay?: RelayData;
$side?: Cash;
$underboard?: Cash;
i18n: any;
i18n: I18nDict;
chat: {
parseMoves: boolean;
instance?: Promise<ChatCtrl>;

View File

@ -12,7 +12,7 @@ export interface ChatOpts {
public: boolean;
permissions: Permissions;
timeoutReasons?: ModerationReason[];
i18n: { [key: string]: string | undefined };
i18n: I18nDict;
preset?: string;
noteId?: string;
noteText?: string;

View File

@ -19,7 +19,7 @@ export interface DasherData {
piece: PieceData;
coach: boolean;
streamer: boolean;
i18n: any;
i18n: I18nDict;
}
export type Mode = 'links' | 'langs' | 'sound' | 'background' | 'board' | 'theme' | 'piece';

View File

@ -25,7 +25,7 @@ export interface EditorConfig {
};
embed: boolean;
positions?: OpeningPosition[];
i18n: any;
i18n: I18nDict;
}
export interface EditorOptions {

View File

@ -1,6 +1,6 @@
export interface MsgOpts {
data: MsgData;
i18n: any;
i18n: I18nDict;
}
export interface MsgData {
me: Me;

View File

@ -13,7 +13,7 @@ export interface NotifyOpts {
export interface NotifyData {
pager: Paginator<Notification>;
unread: number;
i18n: any;
i18n: I18nDict;
}
interface NotificationUser {

View File

@ -94,7 +94,7 @@ export interface Vm {
export interface PuzzleOpts {
pref: PuzzlePrefs;
data: PuzzleData;
i18n: { [key: string]: string | undefined };
i18n: I18nDict;
difficulty?: PuzzleDifficulty;
themes?: {
dynamic: string;

View File

@ -8,7 +8,7 @@ export type WithGround = <A>(f: (g: CgApi) => A) => A | false;
export interface RacerOpts {
data: RacerData;
pref: RacerPrefs;
i18n: any;
i18n: I18nDict;
}
export interface RacerPrefs extends PuzPrefs {}

View File

@ -89,7 +89,7 @@ export interface RoundOpts {
onChange(d: RoundData): void;
element: HTMLElement;
crosstableEl: HTMLElement;
i18n: any;
i18n: I18nDict;
chat?: ChatOpts;
}

View File

@ -11,7 +11,7 @@ export interface SimulOpts {
$side: Cash;
socketVersion: number;
chat: any;
i18n: any;
i18n: I18nDict;
socketSend: SocketSend;
}

View File

@ -4,7 +4,7 @@ import { Config, PuzPrefs, Puzzle } from 'puz/interfaces';
export interface StormOpts {
data: StormData;
pref: StormPrefs;
i18n: any;
i18n: I18nDict;
}
export interface StormPrefs extends PuzPrefs {}

View File

@ -12,7 +12,7 @@ export interface SwissOpts {
$side: Cash;
socketSend: SocketSend;
chat: any;
i18n: any;
i18n: I18nDict;
classes: string | null;
}