import { type Type } from 'arktype'; import { type TransformAndValidateObjectFactory, type TransformAndValidateObjectFactoryDefaults, type TransformAndValidateObjectHandleValidate, type TransformAndValidateObjectOutput } from './transform'; import { type TransformAndValidateResultFunction } from './transform.result'; /** * A TransformAndValidate result for a function with the parsed object attached as "params". */ export type TransformAndValidateFunctionResult = O & { params: T; }; export type TransformAndValidateFunctionResultFunction = TransformAndValidateResultFunction, I, C>; export type TransformAndValidateFunctionResultFactory = (schema: Type, fn: (parsed: T) => Promise, handleValidationError?: TransformAndValidateObjectHandleValidate) => TransformAndValidateFunctionResultFunction; /** * Creates a factory for transform-and-validate functions that return the result with the parsed object attached as `params`. * * @param defaults - Shared error handler defaults. * @returns A factory that produces functions returning {@link TransformAndValidateFunctionResult} * * @__NO_SIDE_EFFECTS__ */ export declare function transformAndValidateFunctionResultFactory(defaults: TransformAndValidateObjectFactoryDefaults): TransformAndValidateFunctionResultFactory; /** * Wraps an existing {@link TransformAndValidateObjectFactory} to produce functions that attach the parsed object * as `params` on the result. * * @param transformAndValidateObjectFactory - The base factory to wrap. * @returns A factory that produces functions returning results with `params` attached. * * @__NO_SIDE_EFFECTS__ */ export declare function toTransformAndValidateFunctionResultFactory(transformAndValidateObjectFactory: TransformAndValidateObjectFactory): TransformAndValidateFunctionResultFactory; /** * Transforms a {@link TransformAndValidateObjectOutput} into a {@link TransformAndValidateFunctionResult} * by attaching the parsed object as `params` on the result. * * @param objectOutput - the transform-and-validate output (sync or async) * @returns the result with `params` attached */ export declare function toTransformAndValidateFunctionResult(objectOutput: Promise>): Promise>; export declare function toTransformAndValidateFunctionResult(objectOutput: TransformAndValidateObjectOutput): TransformAndValidateFunctionResult;