todo_widget: Convert module to TypeScript.

This commit is contained in:
Varun Singh
2024-08-11 19:51:08 +05:30
committed by Tim Abbott
parent 9cd41e1c5b
commit 2cf09602df
3 changed files with 225 additions and 133 deletions

View File

@@ -5,6 +5,7 @@ import * as channel from "./channel";
import type {MessageList} from "./message_lists";
import * as message_store from "./message_store";
import type {Message} from "./message_store";
import {todo_widget_extra_data_schema} from "./todo_widget";
import * as widgetize from "./widgetize";
export type Submessage = {
@@ -37,13 +38,6 @@ const poll_widget_extra_data_schema = z
})
.nullable();
export const todo_widget_extra_data_schema = z
.object({
task_list_title: z.string().optional(),
tasks: z.array(z.object({task: z.string(), desc: z.string()})).optional(),
})
.nullable();
const widget_data_event_schema = z.object({
sender_id: z.number(),
data: z.discriminatedUnion("widget_type", [