UNPKG

next-form-action

Version:

A TypeScript library for handling server actions in Next.js with type-safe error handling and callbacks

16 lines 487 B
export type ActionErrorState = { success: false; message?: string; redirect?: string; refresh?: boolean; }; export type ActionSuccessState = { success: true; message?: string; redirect?: string; refresh?: boolean; }; export type ActionState = ActionErrorState | ActionSuccessState; export type Action<T = unknown> = (data: T) => Promise<ActionState>; export type ActionParams = Omit<ActionState, "message" | "success">; //# sourceMappingURL=index.d.ts.map