Improve typing

This commit is contained in:
Pieter Vander Vennet 2022-06-24 16:47:00 +02:00
parent 09b230b5be
commit 978df7253c
3 changed files with 29 additions and 11 deletions

View file

@ -7,10 +7,10 @@ export class Translation extends BaseUIElement {
public static forcedLanguage = undefined;
public readonly translations: object
public readonly translations: Record<string, string>
context?: string;
constructor(translations: object, context?: string) {
constructor(translations: Record<string, string>, context?: string) {
super()
if (translations === undefined) {
console.error("Translation without content at "+context)
@ -264,7 +264,7 @@ export class Translation extends BaseUIElement {
}
export class TypedTranslation<T> extends Translation {
constructor(translations: object, context?: string) {
constructor(translations: Record<string, string>, context?: string) {
super(translations, context);
}