diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 78bc31d540..8ffcfd9d0a 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -186,7 +186,7 @@ EXEMPT_FILES = make_set( "web/src/resize_handler.js", "web/src/rows.ts", "web/src/scheduled_messages.ts", - "web/src/scheduled_messages_feed_ui.js", + "web/src/scheduled_messages_feed_ui.ts", "web/src/scheduled_messages_overlay_ui.js", "web/src/scheduled_messages_popover.js", "web/src/scheduled_messages_ui.js", diff --git a/web/src/scheduled_messages.ts b/web/src/scheduled_messages.ts index 809e7c14f8..8b180c007e 100644 --- a/web/src/scheduled_messages.ts +++ b/web/src/scheduled_messages.ts @@ -2,7 +2,7 @@ import * as channel from "./channel"; import {$t} from "./i18n"; import * as timerender from "./timerender"; -type ScheduledMessage = { +export type ScheduledMessage = { scheduled_message_id: number; content: string; rendered_content: string; diff --git a/web/src/scheduled_messages_feed_ui.js b/web/src/scheduled_messages_feed_ui.ts similarity index 93% rename from web/src/scheduled_messages_feed_ui.js rename to web/src/scheduled_messages_feed_ui.ts index d7e9a8fdb2..af8864f935 100644 --- a/web/src/scheduled_messages_feed_ui.js +++ b/web/src/scheduled_messages_feed_ui.ts @@ -4,9 +4,10 @@ import render_scheduled_messages_indicator from "../templates/scheduled_messages import * as narrow_state from "./narrow_state"; import * as scheduled_messages from "./scheduled_messages"; +import type {ScheduledMessage} from "./scheduled_messages"; import * as util from "./util"; -function get_scheduled_messages_matching_narrow() { +function get_scheduled_messages_matching_narrow(): ScheduledMessage[] { const scheduled_messages_list = [...scheduled_messages.scheduled_messages_data.values()]; const filter = narrow_state.filter(); const is_conversation_view = filter === undefined ? false : filter.is_conversation_view(); @@ -55,7 +56,7 @@ function get_scheduled_messages_matching_narrow() { return matching_scheduled_messages; } -export function update_schedule_message_indicator() { +export function update_schedule_message_indicator(): void { $("#scheduled_message_indicator").empty(); const matching_scheduled_messages = get_scheduled_messages_matching_narrow(); const scheduled_message_count = matching_scheduled_messages.length;