message_store: Rewrite RawMessage type using Zod.

This commit rework RawMessage and it's related type to use
Zod for parsing the data received from the server.
This commit is contained in:
afeefuddin
2024-06-15 15:27:13 +05:30
committed by Tim Abbott
parent f148a7a3ed
commit 17e2d46760
4 changed files with 101 additions and 77 deletions

View File

@@ -10,13 +10,7 @@ import {todo_widget_extra_data_schema} from "./todo_widget";
import type {TodoWidgetOutboundData} from "./todo_widget";
import * as widgetize from "./widgetize";
export type Submessage = {
id: number;
sender_id: number;
message_id: number;
content: string;
msg_type: string;
};
export type Submessage = z.infer<typeof message_store.submessage_schema>;
export const zform_widget_extra_data_schema = z
.object({