@ts-rest/react-query
Version:
react-query client integration for @ts-rest
8 lines (7 loc) • 680 B
TypeScript
import { AppRoute, ClientInferResponses, ErrorHttpStatusCode, InferResponseUndefinedStatusCodes, exhaustiveGuard, isUnknownErrorResponse } from '@ts-rest/core';
type FetchError = Error;
type UnknownResponseError<T extends AppRoute> = ClientInferResponses<T, InferResponseUndefinedStatusCodes<T, ErrorHttpStatusCode>, 'ignore'>;
type NotKnownResponseError<T extends AppRoute> = FetchError | UnknownResponseError<T>;
export declare const isFetchError: (error: unknown) => error is Error;
export declare const isNotKnownResponseError: <T extends AppRoute>(error: unknown, contractEndpoint: T) => error is NotKnownResponseError<T>;
export { isUnknownErrorResponse, exhaustiveGuard };