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.

poll_widget: Amalgamate 'outbound_data' types for poll-widgets.

Varun Singh9cd41e1c5b8a
diff --git a/web/src/poll_widget.ts b/web/src/poll_widget.ts
index 6533e5f795a..aea575536da 100644
--- a/web/src/poll_widget.ts
+++ b/web/src/poll_widget.ts
@@ -23,6 +23,11 @@ export type PollWidgetExtraData = {
options?: string[] | undefined;
};
+export type PollWidgetOutboundData =
+ | NewOptionOutboundData
+ | QuestionOutboundData
+ | VoteOutboundData;
+
export function activate({
$elem,
callback,
@@ -30,9 +35,7 @@ export function activate({
message,
}: {
$elem: JQuery;
- callback: (
- data: NewOptionOutboundData | QuestionOutboundData | VoteOutboundData | undefined,
- ) => void;
+ callback: (data: PollWidgetOutboundData | undefined) => void;
extra_data: PollWidgetExtraData;
message: Message;
}): (events: Event[]) => void {