Specify ThisType on i18nApi

This commit is contained in:
Michael Telatynski
2026-02-20 09:32:58 +00:00
committed by GitHub
parent 174c35b874
commit d51eb5dfd3
@@ -41,19 +41,19 @@ export interface I18nApi {
/** /**
* Register translations for the module, may override app's existing translations * Register translations for the module, may override app's existing translations
*/ */
register(translations: Partial<Translations>): void; register(this: void, translations: Partial<Translations>): void;
/** /**
* Perform a translation, with optional variables * Perform a translation, with optional variables
* @param key - The key to translate * @param key - The key to translate
* @param variables - Optional variables to interpolate into the translation * @param variables - Optional variables to interpolate into the translation
*/ */
translate(key: keyof Translations, variables?: Variables): string; translate(this: void, key: keyof Translations, variables?: Variables): string;
/** /**
* Convert a timestamp into a translated, human-readable time, * Convert a timestamp into a translated, human-readable time,
* using the current system time as a reference, eg. "5 minutes ago". * using the current system time as a reference, eg. "5 minutes ago".
* @param timeMillis - The time in milliseconds since epoch * @param timeMillis - The time in milliseconds since epoch
*/ */
humanizeTime(timeMillis: number): string; humanizeTime(this: void, timeMillis: number): string;
} }