zulip/web/shared/src/poll_data.js.flow
Sayam Samal a7772f86a2 docs: Update CZO links from stream to channel in docs and comments.
Updates all the https://chat.zulip.org/#narrow/stream/ links in the
docs and comments to use the new /channel/ path. All these links are
for documentation/reference purposes only and thus, can be bulk-updated.

This commit is a part of the effort to rename stream to channel.
2024-06-11 10:44:31 -07:00

47 lines
1.2 KiB
Plaintext

// @flow strict
/**
* The data encoded in a submessage that acts on a poll widget.
*
* In reality these are more specific than this type. But they're currently
* completely undocumented in the API:
* https://chat.zulip.org/#narrow/channel/412-api-documentation/topic/.60.2Esubmessages.60.20on.20message.20objects/near/1358493
* so we don't attempt to go any further here.
*/
type PollEvent = {...};
declare export class PollData {
constructor({
message_sender_id: number,
current_user_id: number,
is_my_poll: boolean,
question: string,
options: interface {entries(): Iterable<[number, string]>},
comma_separated_names: (user_ids: number[]) => string,
report_error_function: (msg: string) => void,
}): void;
set_question(question: string): void;
get_question(): string;
set_input_mode(): void;
clear_input_mode(): void;
get_input_mode(): boolean;
get_widget_data(): {
question: string,
options: Array<{
option: string,
names: string,
count: number,
key: string,
current_user_vote: boolean,
}>,
};
handle_event(sender_id: number, data: PollEvent): void;
}