import { z } from 'zod';

/**
 * Zod schemas for Typeform answer validation.
 * Separated from types.ts to avoid Next.js server/client boundary issues.
 */

/**
 * Zod schema for a single AnswerValue (preset or custom).
 */
declare const answerValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"preset">;
    value: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"custom">;
    value: z.ZodString;
}, z.core.$strip>], "type">;
/**
 * Zod schema for MultiAnswerValue (array of AnswerValue).
 */
declare const multiAnswerValueSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"preset">;
    value: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"custom">;
    value: z.ZodString;
}, z.core.$strip>], "type">>;
/**
 * Create a Zod schema for a radio field with "Other" option.
 * Accepts either a preset value from the enum OR a custom value.
 *
 * @param presetValues - Array of valid preset values (e.g., ['hubspot', 'salesforce'])
 * @returns Zod schema that validates AnswerValue with preset constraint
 *
 * @example
 * const crmSchema = radioWithOtherSchema(['hubspot', 'salesforce', 'pipedrive'])
 * // Accepts: { type: 'preset', value: 'hubspot' }
 * // Accepts: { type: 'custom', value: 'Freshsales' }
 * // Rejects: { type: 'preset', value: 'invalid' }
 */
declare function radioWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"preset">;
    value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"custom">;
    value: z.ZodString;
}, z.core.$strip>], "type">;
/**
 * Create a Zod schema for a checkbox field with "Other" option.
 * Each selected value is either a preset or custom AnswerValue.
 *
 * @param presetValues - Array of valid preset values
 * @returns Zod schema that validates MultiAnswerValue with preset constraint
 *
 * @example
 * const toolsSchema = checkboxWithOtherSchema(['zapier', 'make', 'n8n'])
 * // Accepts: [{ type: 'preset', value: 'zapier' }, { type: 'custom', value: 'Tray.io' }]
 */
declare function checkboxWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
    type: z.ZodLiteral<"preset">;
    value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodLiteral<"custom">;
    value: z.ZodString;
}, z.core.$strip>], "type">>;

export { answerValueSchema, checkboxWithOtherSchema, multiAnswerValueSchema, radioWithOtherSchema };
