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?
optionalbody?: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?
optionalbodySchema?:TBodySchema
Schema to validate request body
form?
optionalform?: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?
optionaljson?:TBodySchemaextendsGenericSchema?InferInput<TBodySchema> :unknown
JSON body - validated against bodySchema if provided
params?
optionalparams?:TParamsSchemaextendsGenericSchema?InferInput<TParamsSchema> :ExtractPathParams<TPath> extendsnever?undefined:PathParamsRecord<TPath>
URL path parameters
paramsSchema?
optionalparamsSchema?:TParamsSchema
Schema to validate URL path params
responseSchema?
optionalresponseSchema?:TResponseSchema
Schema to validate response body
searchSchema?
optionalsearchSchema?:TSearchSchema
Schema to validate search/query params