import { useTransition } from 'react'; export interface ActionState { data: T | null; error: string | null; isPending: boolean; } export type ActionResult = T | { ok: false; error: string; }; /** * Same shape as Next.js `defineAction` — just a passthrough that carries * the `'use server'` semantics through TypeScript. Server-Actions plugin * handles the actual code split. */ export declare function defineAction Promise>(fn: T): T; /** * Manually invoke an action without a Form. */ export declare function callAction(action: (...args: any[]) => Promise, ...args: any[]): Promise; /** * React 19-flavoured hook. * * ```tsx * const [state, run, isPending] = useAction(myAction, { data: null, error: null }) * ``` */ export declare function useAction(action: (prevState: ActionState, formData: FormData) => Promise>, initial: ActionState): [state: ActionState, dispatch: (payload: FormData) => void, isPending: boolean]; export { useTransition }; //# sourceMappingURL=actions.d.ts.map