---
url: https://haihv.github.io/valifetch/api/index/type-aliases/ValifetchOptions.md
---

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

> **ValifetchOptions**<`TPath`, `TResponseSchema`, `TBodySchema`, `TParamsSchema`, `TSearchSchema`> = [`ValifetchBaseOptions`](ValifetchBaseOptions.md) & `object`

Defined in: [src/types/options.ts:328](https://github.com/haihv/valifetch/blob/285835d38a6676b98d2ee1a93e23166c6c834cb2/src/types/options.ts#L328)

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`](RawBody.md)

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`](ExtractPathParams.md)<`TPath`> *extends* `never` ? `undefined` : [`PathParamsRecord`](PathParamsRecord.md)<`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
