next-safe-action
Version:
Type safe and validated Server Actions in your Next.js project.
27 lines (24 loc) • 604 B
text/typescript
import { Schema } from "yup";
import { ValidationAdapter, IfInstalled, Infer, ValidationIssue } from "./types.mjs";
import "@sinclair/typebox";
import "valibot";
import "zod";
declare class YupAdapter implements ValidationAdapter {
validate<S extends IfInstalled<Schema>>(
schema: S,
data: unknown
): Promise<
| {
readonly success: true;
readonly data: Infer<S>;
readonly issues?: undefined;
}
| {
readonly success: false;
readonly issues: ValidationIssue[];
readonly data?: undefined;
}
>;
}
declare function yupAdapter(): YupAdapter;
export { yupAdapter };