diff --git a/src/client/client.ts b/src/client/client.ts index aa329265..a5c29602 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -1,5 +1,5 @@ import type { Hono } from '../hono' -import type { ValidationTargets } from '../types' +import type { FormValue, ValidationTargets } from '../types' import { serialize } from '../utils/cookie' import type { UnionToIntersection } from '../utils/types' import type { Callback, Client, ClientRequestOptions } from './types' @@ -42,7 +42,7 @@ class ClientRequestImpl { this.method = method } fetch = async ( - args?: ValidationTargets & { + args?: ValidationTargets & { param?: Record }, opt?: ClientRequestOptions diff --git a/src/types.ts b/src/types.ts index 3a539911..e6f3cdeb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1927,11 +1927,12 @@ type MergeTypedResponse = T extends Promise ////// ///// //////////////////////////////////////// -export type FormValue = string | File +export type FormValue = string | Blob +export type ParsedFormValue = string | File -export type ValidationTargets = { +export type ValidationTargets = { json: any - form: Record + form: Record query: Record param: Record | Record header: Record diff --git a/src/validator/validator.test.ts b/src/validator/validator.test.ts index 2044a489..b6bf19fc 100644 --- a/src/validator/validator.test.ts +++ b/src/validator/validator.test.ts @@ -8,6 +8,7 @@ import type { ExtractSchema, FormValue, MiddlewareHandler, + ParsedFormValue, ValidationTargets, } from '../types' import type { StatusCode } from '../utils/http-status' @@ -749,7 +750,7 @@ it('With path parameters', () => { $put: { input: { form: { - title: FormValue | FormValue[] + title: ParsedFormValue | ParsedFormValue[] } } & { param: { @@ -795,7 +796,7 @@ it('`on`', () => { $purge: { input: { form: { - tag: FormValue | FormValue[] + tag: ParsedFormValue | ParsedFormValue[] } } & { query: {