/** * Map validation core module * Provides validation for `Map` instances. The validator can optionally * delegate to per-entry validators for keys and values, mirroring how * `arrayOf()` validates each element of an array. */ import { type StandardSchemaV1 } from "../../Validate/standardSchema"; import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type"; export type MapExtractValidatedType = V extends (value: never) => { type: infer T; } ? ValidateType : never; /** * Creates a Map validator. The validator can optionally accept per-entry key * and value validators that are applied to every entry of the map. When the * value-side validator is provided, the entry validators short-circuit on the * first failure and surface the failing message, mirroring `arrayOf()`. * @template KV - Validator for the map key * @template VV - Validator for the map value * @param {KV} [keyValidator] - Validator applied to every key * @param {VV} [valueValidator] - Validator applied to every value * @param {string} [message] - Custom error message for type validation * @returns {Function} - Validator function for Map instances */ export declare const map: ValidateCoreReturnType = (value: unknown) => ValidateCoreReturnType, VV extends (value: any) => ValidateCoreReturnType = (value: unknown) => ValidateCoreReturnType, K = MapExtractValidatedType, V = MapExtractValidatedType>(keyValidator?: KV, valueValidator?: VV, message?: string) => ((value: Map) => ValidateCoreReturnType>) & StandardSchemaV1, Map>;