1
0
mirror of https://github.com/flarum/core.git synced 2025-05-31 03:29:40 +02:00
php-flarum/js/dist-typings/common/utils/RequestError.d.ts
flarum-bot ec5214f714 Bundled output for commit bac0e594eed0a8e7282c4772864075cac487d280
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-11-11 19:21:56 +00:00

22 lines
745 B
TypeScript

import type Mithril from 'mithril';
export declare type InternalFlarumRequestOptions<ResponseType> = Mithril.RequestOptions<ResponseType> & {
errorHandler: (error: RequestError) => void;
url: string;
};
export default class RequestError<ResponseType = string> {
status: number;
options: InternalFlarumRequestOptions<ResponseType>;
xhr: XMLHttpRequest;
responseText: string | null;
response: {
[key: string]: unknown;
errors?: {
detail?: string;
code?: string;
[key: string]: unknown;
}[];
} | null;
alert: any;
constructor(status: number, responseText: string | null, options: InternalFlarumRequestOptions<ResponseType>, xhr: XMLHttpRequest);
}