mirror of https://github.com/zulip/zulip.git
widgetize: Refactor type for 'extra_data'.
This commit is contained in:
parent
894756addc
commit
c29fbeca94
|
@ -12,9 +12,11 @@ type ZFormExtraData = {
|
||||||
choices: {type: string; reply: string; long_name: string; short_name: string}[];
|
choices: {type: string; reply: string; long_name: string; short_name: string}[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type WidgetExtraData = PollWidgetExtraData | ZFormExtraData | null;
|
||||||
|
|
||||||
type WidgetOptions = {
|
type WidgetOptions = {
|
||||||
widget_type: string;
|
widget_type: string;
|
||||||
extra_data: PollWidgetExtraData | ZFormExtraData | null;
|
extra_data: WidgetExtraData;
|
||||||
events: Event[];
|
events: Event[];
|
||||||
$row: JQuery;
|
$row: JQuery;
|
||||||
message: Message;
|
message: Message;
|
||||||
|
@ -26,7 +28,7 @@ type WidgetValue = Record<string, unknown> & {
|
||||||
$elem: JQuery;
|
$elem: JQuery;
|
||||||
callback: (data: string) => void;
|
callback: (data: string) => void;
|
||||||
message: Message;
|
message: Message;
|
||||||
extra_data: WidgetOptions["extra_data"];
|
extra_data: WidgetExtraData;
|
||||||
}) => void;
|
}) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue