ResponseType
The normalized response shape returned by every adapter after a request completes.
Import
import { ResponseType } from "@hyper-fetch/core"
Source
Package
Preview
type ResponseType<GenericDataType,GenericErrorType,Adapter> = {
data: GenericDataType | null;
error: GenericErrorType | null;
extra: ExtractAdapterExtraType<Adapter> | null;
requestTimestamp: number;
responseTimestamp: number;
status: ExtractAdapterStatusType<Adapter> | null;
success: boolean;
}
Structure
ResponseType
| Name | Type | Description |
|---|---|---|
| data | | Response data when successful, null on error |
| error | | Error payload when the request fails, null on success |
| extra | | Adapter-specific metadata (e.g., response headers) |
| requestTimestamp | | Timestamp (ms) when the request was sent |
| responseTimestamp | | Timestamp (ms) when the response was received |
| status | | HTTP status code or adapter-specific status indicator |
| success | | Whether the request completed successfully |
