@frui.ts/apiclient
Advanced tools
Comparing version 0.16.0-beta.10 to 0.16.0-beta.11
import { IApiConnector } from "./types"; | ||
declare type Middleware = (response: Response) => Response | PromiseLike<Response>; | ||
declare type FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
declare type JsonSerializer = (value: any) => string; | ||
export declare type Middleware = (response: Response) => Response | PromiseLike<Response>; | ||
export declare type FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>; | ||
export declare type JsonSerializer = (value: any) => string; | ||
export declare function appendJsonHeader(params?: RequestInit): RequestInit; | ||
@@ -26,2 +26,1 @@ export declare function handleErrorStatusMiddleware(response: Response): Promise<Response>; | ||
} | ||
export {}; |
@@ -1,5 +0,6 @@ | ||
export default class FetchError extends Error { | ||
export default class FetchError<TContent = any> extends Error { | ||
response: Response; | ||
content?: any; | ||
constructor(response: Response, content?: any); | ||
content?: TContent | undefined; | ||
handled: boolean; | ||
constructor(response: Response, content?: TContent | undefined); | ||
} |
@@ -19,5 +19,6 @@ "use strict"; | ||
function FetchError(response, content) { | ||
var _this = _super.call(this) || this; | ||
var _this = _super.call(this, response.statusText) || this; | ||
_this.response = response; | ||
_this.content = content; | ||
_this.handled = false; | ||
return _this; | ||
@@ -24,0 +25,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.16.0-beta.10", | ||
"version": "0.16.0-beta.11", | ||
"description": "Frui.ts helpers for HTTP communication", | ||
@@ -36,6 +36,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@frui.ts/helpers": "^0.16.0-beta.10", | ||
"@frui.ts/helpers": "^0.16.0-beta.11", | ||
"query-string": "^6.9.0" | ||
}, | ||
"gitHead": "023a34d5b422cfdc7a1ec24ed82060d6f5153990" | ||
"gitHead": "3df688ee37323219bd805c54f9fcb9195d42e6fa" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38167
365