import React from 'react'; import { Form as InertiaForm } from '@inertiajs/react'; import type { RouteParams, Routes } from '../common.ts'; /** * Parameters required for route navigation with proper type safety. */ export type FormParams = RouteParams; /** * Props for the Form component when using route-based navigation */ export type FormRouteProps = Omit, 'action' | 'method'> & FormParams & { action?: never; }; /** * Props for the Form component when using direct action */ export type FormActionProps = Omit, 'route'> & { route?: never; }; /** * Union type for Form component props - either route-based or direct action */ export type FormProps = FormRouteProps | FormActionProps; /** * Internal Form component implementation with forward ref support. * Resolves route parameters and generates the appropriate URL and HTTP method * for Inertia form submission when using route-based navigation. * Falls back to standard InertiaForm when action is provided directly. */ declare function FormInner(props: FormProps, ref?: React.ForwardedRef>): import("react/jsx-runtime").JSX.Element; /** * Type-safe Form component for Inertia.js form submissions. * * Provides compile-time route validation and automatic parameter type checking * based on your application's route definitions. Automatically resolves the * correct URL and HTTP method for each route. Alternatively, you can use * the standard action prop for direct form submission. * * @example * ```tsx * // Form to a route without parameters *
* {({ processing }) => ( * <> * * * * )} *
* * // Form to a route with required parameters *
* {({ errors }) => ( * <> * * {errors.name &&
{errors.name}
} * * * )} *
* * // Form with direct action *
* {({ processing }) => ( * <> * * * * )} *
* ``` */ export declare const Form: (props: FormProps & { ref?: React.Ref>; }) => ReturnType; export {};