From 22fa77430edc31c73f7d0363e863ecc823b7ef39 Mon Sep 17 00:00:00 2001 From: Edoardo Ranghieri Date: Fri, 19 Jul 2024 02:36:27 +0200 Subject: [PATCH] fix(types): add generic `validate` function for adapters --- packages/next-safe-action/src/adapters/types.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/next-safe-action/src/adapters/types.ts b/packages/next-safe-action/src/adapters/types.ts index 0a26e4af..7e52cab3 100644 --- a/packages/next-safe-action/src/adapters/types.ts +++ b/packages/next-safe-action/src/adapters/types.ts @@ -29,6 +29,11 @@ export type ValidationIssue = { }; export interface ValidationAdapter { + // generic + validate( + schema: S, + data: unknown + ): Promise<{ success: true; data: Infer } | { success: false; issues: ValidationIssue[] }>; // zod validate( schema: S,