dialog_widget: Refactor AjaxRequest type and moved it to types.ts.

Changes `AjaxRequest` name to more clear one `AjaxRequestHandler`,
also moved this type to `types.ts` with a comment to move it into
`channel.js` once it migrates to typescript.
This commit is contained in:
Lalit
2023-04-06 21:56:31 +05:30
committed by Tim Abbott
parent cfa92aa60b
commit ccbba1acb0
3 changed files with 18 additions and 25 deletions

View File

@@ -69,3 +69,12 @@ export type UpdateMessageEvent = {
// TODO/typescript: Move the User and Stream placeholder
// types to their appropriate modules.
export type User = Record<string, never>;
// TODO/typescript: Move this to channel
export type AjaxRequestHandler = (args: {
url: string;
data?: Record<string, unknown> | string | unknown[];
ignoreReload?: boolean;
success?(response_data: unknown, textStatus: string, jqXHR: JQuery.jqXHR): void;
error?(xhr: JQuery.jqXHR, error_type: string, xhn: string): void;
}) => void;