import { z } from 'zod'; import { type ActionAPIContext, type ErrorInferenceObject, type MaybePromise } from '../utils.js'; import { type SafeResult } from './shared.js'; export * from './shared.js'; export type ActionAccept = 'form' | 'json'; export type ActionHandler = TInputSchema extends z.ZodType ? (input: z.infer, context: ActionAPIContext) => MaybePromise : (input: any, context: ActionAPIContext) => MaybePromise; export type ActionReturnType> = Awaited>; export type ActionClient = TInputSchema extends z.ZodType ? ((input: TAccept extends 'form' ? FormData : z.input) => Promise extends ErrorInferenceObject ? z.input : ErrorInferenceObject, Awaited>>) & { queryString: string; orThrow: (input: TAccept extends 'form' ? FormData : z.input) => Promise>; } : ((input?: any) => Promise>>) & { orThrow: (input?: any) => Promise>; }; export declare function defineAction : undefined>({ accept, input: inputSchema, handler, }: { input?: TInputSchema; accept?: TAccept; handler: ActionHandler; }): ActionClient & string; /** Transform form data to an object based on a Zod schema. */ export declare function formDataToObject(formData: FormData, schema: T): Record;