UNPKG

@respeecher/respeecher-js

Version:

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Frespeecher%2Frespeecher-js) [![npm shield](

21 lines (20 loc) 534 B
import { RawResponse } from "./RawResponse.js"; /** * The response of an API call. * It is a successful response or a failed response. */ export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>; export interface SuccessfulResponse<T> { ok: true; body: T; /** * @deprecated Use `rawResponse` instead */ headers?: Record<string, any>; rawResponse: RawResponse; } export interface FailedResponse<T> { ok: false; error: T; rawResponse: RawResponse; }