Skip to content

Type Alias: ValifetchOptions<TPath, TResponseSchema, TBodySchema, TParamsSchema, TSearchSchema> ​

ValifetchOptions<TPath, TResponseSchema, TBodySchema, TParamsSchema, TSearchSchema> = ValifetchBaseOptions & object

Defined in: src/types/options.ts:328

Schema-aware options with full type inference

Type Parameters ​

TPath ​

TPath extends string = string

TResponseSchema ​

TResponseSchema extends GenericSchema | undefined = undefined

TBodySchema ​

TBodySchema extends GenericSchema | undefined = undefined

TParamsSchema ​

TParamsSchema extends GenericSchema | undefined = undefined

TSearchSchema ​

TSearchSchema extends GenericSchema | undefined = undefined

Type Declaration ​

body? ​

optional body?: RawBody

Raw body sent exactly as given (string, Blob, ArrayBuffer, typed array, or ReadableStream). Set Content-Type yourself — valifetch never infers one (the Request constructor's own default still applies to string and Blob bodies). Mutually exclusive with json and form, and accepted per request only (never at instance level). ReadableStream bodies get duplex: 'half' automatically.

bodySchema? ​

optional bodySchema?: TBodySchema

Schema to validate request body

form? ​

optional form?: FormData | URLSearchParams | Record<string, string>

Form body — FormData sends multipart/form-data; URLSearchParams or a plain object sends application/x-www-form-urlencoded. Mutually exclusive with json, and accepted per request only (never at instance level).

json? ​

optional json?: TBodySchema extends GenericSchema ? InferInput<TBodySchema> : unknown

JSON body - validated against bodySchema if provided

params? ​

optional params?: TParamsSchema extends GenericSchema ? InferInput<TParamsSchema> : ExtractPathParams<TPath> extends never ? undefined : PathParamsRecord<TPath>

URL path parameters

paramsSchema? ​

optional paramsSchema?: TParamsSchema

Schema to validate URL path params

responseSchema? ​

optional responseSchema?: TResponseSchema

Schema to validate response body

searchSchema? ​

optional searchSchema?: TSearchSchema

Schema to validate search/query params

Released under the MIT License. Built with Claude Code.