/**
 * Client-safe form validation — zero Node dependencies, tree-shakeable.
 *
 * Published as `@actuate-media/cms-core/forms/client` so public-site form
 * components can mirror the server's rules (same regexes, same caps, same
 * conditional-visibility semantics) for instant inline feedback.
 *
 * This is convenience only: the server re-validates every submission via
 * `validateAndNormalizeSubmission()` (which also imports these primitives, so
 * the two can never drift). The one intentional difference is sanitization —
 * the client validates the raw value; the server strips HTML before storing.
 */
import type { FormField } from './types.js';
export declare const FORM_MAX_TEXT_LEN = 5000;
export declare const FORM_MAX_TEXTAREA_LEN = 50000;
export declare const FORM_MAX_MULTISELECT_ITEMS = 200;
/** The exact email format the server accepts for `email`-format fields. */
export declare const FORM_EMAIL_RE: RegExp;
/** The exact phone format the server accepts for `phone`-format fields. */
export declare const FORM_PHONE_RE: RegExp;
/** Field types that never carry a submitted value. */
export declare const FORM_NON_INPUT_TYPES: ReadonlySet<string>;
export declare function asString(value: unknown): string;
export declare function coerceBoolean(value: unknown): boolean;
/** A field is visible unless its `show` rules exist and not all of them pass. */
export declare function isFieldVisible(field: FormField, values: Record<string, unknown>): boolean;
/** A field is conditionally required when its `require` rules all pass. */
export declare function isFieldConditionallyRequired(field: FormField, values: Record<string, unknown>): boolean;
export declare function isValuePresent(raw: unknown): boolean;
export declare function isHttpUrl(value: string): boolean;
export interface ClientFieldValidation {
    ok: boolean;
    /** Human-readable message for the first failed rule, when `ok` is false. */
    message?: string;
}
/**
 * Validate a single field's value with the same rules the server applies.
 *
 * Pass `allValues` (the full form state) so conditional visibility/required
 * logic evaluates correctly; a hidden field always validates as ok, matching
 * the server (hidden fields are skipped, not required, not stored).
 */
export declare function validateFormFieldClient(field: FormField, value: unknown, allValues?: Record<string, unknown>): ClientFieldValidation;
/**
 * Validate the whole form client-side. Returns the first error per field,
 * keyed by field key. An empty object means the form would pass the server's
 * field validation (spam/honeypot/file checks still run server-side).
 */
export declare function validateFormValuesClient(fields: FormField[], values: Record<string, unknown>): Record<string, string>;
//# sourceMappingURL=client-validation.d.ts.map