diff --git a/tools/test-js-with-node b/tools/test-js-with-node index b90c97e169..07ec06f471 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -153,7 +153,7 @@ EXEMPT_FILES = make_set( "web/src/message_viewport.ts", "web/src/messages_overlay_ui.ts", "web/src/modals.ts", - "web/src/muted_users_ui.js", + "web/src/muted_users_ui.ts", "web/src/narrow.js", "web/src/narrow_history.ts", "web/src/narrow_title.ts", diff --git a/web/src/muted_users.ts b/web/src/muted_users.ts index 5ad89d52bf..669e23923b 100644 --- a/web/src/muted_users.ts +++ b/web/src/muted_users.ts @@ -2,7 +2,7 @@ import * as channel from "./channel"; import * as timerender from "./timerender"; import {get_time_from_date_muted} from "./util"; -type RawMutedUser = { +export type RawMutedUser = { id: number; timestamp: number; }; diff --git a/web/src/muted_users_ui.js b/web/src/muted_users_ui.ts similarity index 87% rename from web/src/muted_users_ui.js rename to web/src/muted_users_ui.ts index 9aa71ffa2a..42b3bbd320 100644 --- a/web/src/muted_users_ui.js +++ b/web/src/muted_users_ui.ts @@ -1,13 +1,14 @@ import * as activity_ui from "./activity_ui"; import * as message_lists from "./message_lists"; import * as muted_users from "./muted_users"; +import type {RawMutedUser} from "./muted_users"; import * as overlays from "./overlays"; import * as pm_list from "./pm_list"; import * as popovers from "./popovers"; import * as recent_view_ui from "./recent_view_ui"; import * as settings_muted_users from "./settings_muted_users"; -export function rerender_for_muted_user() { +export function rerender_for_muted_user(): void { for (const msg_list of message_lists.all_rendered_message_lists()) { msg_list.update_muting_and_rerender(); } @@ -28,7 +29,7 @@ export function rerender_for_muted_user() { // mechanism. } -export function handle_user_updates(muted_user_ids) { +export function handle_user_updates(muted_user_ids: RawMutedUser[]): void { popovers.hide_all(); muted_users.set_muted_users(muted_user_ids); rerender_for_muted_user();