UNPKG

@contentgrid/problem-details

Version:

RFC9547 Problem Details types and helpers

14 lines (13 loc) 511 B
export interface ProblemDetail { readonly type?: string; readonly status: number; readonly title: string; readonly detail?: string; readonly instance?: string; } export declare function fromResponse<T extends ProblemDetail>(response: Response): Promise<T | null>; export declare class ProblemDetailError<T extends ProblemDetail> extends Error { readonly problemDetail: T; constructor(problemDetail: T); } export declare function checkResponse(response: Response): Promise<Response>;