Skip to main content
Version: 3.x.x

FetchPayloadType


import { FetchPayloadType } from "@hyper-fetch/core"

Description

If the request data is not filled it will throw an error

Defined in request/request.types.ts:241

Preview

type FetchPayloadType<Payload,HasData> = Payload extends NegativeTypes ? { data?: NegativeTypes } : HasData extends true ? { data?: NegativeTypes } : { data: NonNullable<Payload> };

Structure

Payload extends NegativeTypes ? {
data: NegativeTypes;
} : (HasData extends true ? {
data: NegativeTypes;
} : {
data: NonNullable<Payload>;
})