Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

widgetize: Refactor type for 'extra_data'.

Varun Singhc29fbeca9414
diff --git a/web/src/widgetize.ts b/web/src/widgetize.ts
index 58f8c54a30a..e90a106f657 100644
--- a/web/src/widgetize.ts
+++ b/web/src/widgetize.ts
@@ -12,9 +12,11 @@ type ZFormExtraData = {
choices: {type: string; reply: string; long_name: string; short_name: string}[];
};
+type WidgetExtraData = PollWidgetExtraData | ZFormExtraData | null;
+
type WidgetOptions = {
widget_type: string;
- extra_data: PollWidgetExtraData | ZFormExtraData | null;
+ extra_data: WidgetExtraData;
events: Event[];
$row: JQuery;
message: Message;
@@ -26,7 +28,7 @@ type WidgetValue = Record<string, unknown> & {
$elem: JQuery;
callback: (data: string) => void;
message: Message;
- extra_data: WidgetOptions["extra_data"];
+ extra_data: WidgetExtraData;
}) => void;
};