UNPKG

safe-actions-state

Version:

A lightweight, type-safe utility for Next.js server & client actions with built-in authentication and RBAC(role based access control) checks, Zod validation, auto retries if server action fails, and real-time toast feedback out of the box. Just write your

9 lines (8 loc) 199 B
export type FieldErrors<T> = { [K in keyof T]?: string[]; }; export type ActionState<TInput, TOutput> = { fieldErrors?: FieldErrors<TInput>; error?: string; data?: TOutput; } | void;