Skip to content

Commit 67d4127

Browse files
authored
Merge pull request #201 from element-hq/t3chguy-patch-2
Specify ThisType on i18nApi
2 parents 37352ba + 7d24c0e commit 67d4127

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packages/element-web-module-api/element-web-module-api.api.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ export interface ExtrasApi {
174174

175175
// @public
176176
export interface I18nApi {
177-
humanizeTime(timeMillis: number): string;
177+
humanizeTime(this: void, timeMillis: number): string;
178178
get language(): string;
179-
register(translations: Partial<Translations>): void;
180-
translate(key: keyof Translations, variables?: Variables): string;
179+
register(this: void, translations: Partial<Translations>): void;
180+
translate(this: void, key: keyof Translations, variables?: Variables): string;
181181
}
182182

183183
// @alpha @deprecated (undocumented)
@@ -445,3 +445,4 @@ export interface WidgetVariablesCustomisations {
445445
// (No @packageDocumentation comment for this package)
446446

447447
```
448+

packages/element-web-module-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@element-hq/element-web-module-api",
33
"type": "module",
4-
"version": "1.9.0",
4+
"version": "1.9.1",
55
"description": "Module API surface for element-web",
66
"repository": {
77
"type": "git",

packages/element-web-module-api/src/api/i18n.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ export interface I18nApi {
4141
/**
4242
* Register translations for the module, may override app's existing translations
4343
*/
44-
register(translations: Partial<Translations>): void;
44+
register(this: void, translations: Partial<Translations>): void;
4545

4646
/**
4747
* Perform a translation, with optional variables
4848
* @param key - The key to translate
4949
* @param variables - Optional variables to interpolate into the translation
5050
*/
51-
translate(key: keyof Translations, variables?: Variables): string;
51+
translate(this: void, key: keyof Translations, variables?: Variables): string;
5252

5353
/**
5454
* Convert a timestamp into a translated, human-readable time,
5555
* using the current system time as a reference, eg. "5 minutes ago".
5656
* @param timeMillis - The time in milliseconds since epoch
5757
*/
58-
humanizeTime(timeMillis: number): string;
58+
humanizeTime(this: void, timeMillis: number): string;
5959
}

0 commit comments

Comments
 (0)