/** * Set validation core module * Provides validation for `Set` instances. The validator can optionally * delegate to a per-element validator, mirroring how `arrayOf()` validates * each element of an array. * * The function is named `setOf` to avoid conflicting with the top-level * `Object` module's `set` runtime helper, and mirrors `arrayOf()` for * consistency. */ import { type StandardSchemaV1 } from "../../Validate/standardSchema"; import type { ValidateCoreReturnType, ValidateType } from "../../Validate/type"; export type SetExtractValidatedType = V extends (value: never) => { type: infer T; } ? ValidateType : never; /** * Creates a Set validator. When a per-element validator is supplied, every * element of the set must satisfy it; iteration short-circuits at the first * failure and surfaces the failing message. * @template IV - Validator for set elements * @param {IV} [itemValidator] - Validator applied to every element * @param {string} [message] - Custom error message for type validation * @returns {Function} - Validator function for Set instances */ export declare const setOf: ValidateCoreReturnType = (value: unknown) => ValidateCoreReturnType, T = SetExtractValidatedType>(itemValidator?: IV, message?: string) => ((value: Set) => ValidateCoreReturnType>) & StandardSchemaV1, Set>;