import { type RequestEvent } from '@sveltejs/kit'; import { type SuperValidated, type ZodValidation, type UnwrapEffects, type DrainOuterGeneric } from './index.js'; import type { z, AnyZodObject } from 'zod'; import { type StringPathLeaves } from './stringPath.js'; import { type NumericRange } from './utils.js'; export { defaultValues } from './schemaEntity.js'; /** * Sends a message with a form, with an optional HTTP status code that will set * form.valid to false if status >= 400. A status lower than 400 cannot be sent. */ export declare function message, M>(form: DrainOuterGeneric>, message: M, options?: { status?: NumericRange<400, 599>; }): { status: number; data: { form: SuperValidated; } | undefined; } | { form: SuperValidated; }; export declare const setMessage: typeof message; /** * Sets an error for a form field, with an optional HTTP status code. * form.valid is automatically set to false. A status lower than 400 cannot be sent. */ export declare function setError>(form: SuperValidated, path: '' | StringPathLeaves>>, error: string | string[], options?: { overwrite?: boolean; status?: NumericRange<400, 599>; }): { status: number; data: { form: SuperValidated; } | undefined; }; export type SuperValidateOptions = { errors?: boolean; id?: string; warnings?: { multipleRegexps?: boolean; multipleSteps?: boolean; }; }; export declare function superValidate, M = any>(schema: T, options?: SuperValidateOptions): Promise, M>>; export declare function superValidate, M = any>(data: RequestEvent | Request | FormData | URLSearchParams | URL | Partial>> | null | undefined, schema: T, options?: SuperValidateOptions): Promise, M>>; export declare function superValidateSync, M = any>(schema: T, options?: SuperValidateOptions): SuperValidated, M>; export declare function superValidateSync, M = any>(data: FormData | URLSearchParams | URL | Partial>> | null | undefined, schema: T, options?: SuperValidateOptions): SuperValidated, M>; export declare function actionResult | App.Error | string, Type extends T extends string ? 'redirect' | 'error' : 'success' | 'failure' | 'error'>(type: Type, data?: T, options?: number | { status?: number; message?: Type extends 'redirect' ? App.PageData['flash'] : never; }): Response;