import { JsonSchemaResult, JsonSchemaTarget } from "../standard-schema/json-schema.mjs"; import { PrimitiveValidator } from "./primitive-validator.mjs"; //#region ../@warlock.js/seal/src/validators/boolean-validator.d.ts /** * Boolean validator class * * Extends PrimitiveValidator — inherits enum/in/oneOf/allowsOnly/forbids/notIn. * Defines accepted/declined directly as real methods (not ScalarValidator field copies) * so they survive cloning correctly. */ declare class BooleanValidator extends PrimitiveValidator { constructor(errorMessage?: string); /** * Check if value is a boolean type */ matchesType(value: any): boolean; /** Value must be accepted (true, "yes", 1, "on", etc.) */ accepted(errorMessage?: string): this; /** Value must be accepted if another field equals a value */ acceptedIf(field: string, value: any, errorMessage?: string): this; /** Value must be accepted unless another field equals a value */ acceptedUnless(field: string, value: any, errorMessage?: string): this; /** Value must be accepted if another field is required */ acceptedIfRequired(field: string, errorMessage?: string): this; /** Value must be accepted if another field is present */ acceptedIfPresent(field: string, errorMessage?: string): this; /** Value must be accepted if another field is missing */ acceptedWithout(field: string, errorMessage?: string): this; /** Value must be declined (false, "no", 0, "off", etc.) */ declined(errorMessage?: string): this; /** Value must be declined if another field equals a value */ declinedIf(field: string, value: any, errorMessage?: string): this; /** Value must be declined unless another field equals a value */ declinedUnless(field: string, value: any, errorMessage?: string): this; /** Value must be declined if another field is required */ declinedIfRequired(field: string, errorMessage?: string): this; /** Value must be declined if another field is present */ declinedIfPresent(field: string, errorMessage?: string): this; /** Value must be declined if another field is missing */ declinedWithout(field: string, errorMessage?: string): this; /** * Value must be strictly true (not "yes", "on", 1, etc.) * @alias accepted - strict version */ mustBeTrue(errorMessage?: string): this; /** * Value must be strictly false (not "no", "off", 0, etc.) * @alias declined - strict version */ mustBeFalse(errorMessage?: string): this; /** * @inheritdoc * * @note accepted/declined rules and all cross-field boolean rules * are not representable in JSON Schema and are silently omitted. * * @example * ```ts * v.boolean().toJsonSchema("draft-2020-12") * // → { type: "boolean" } * * v.boolean().nullable().toJsonSchema("openapi-3.0") * // → { type: "boolean", nullable: true } * ``` */ toJsonSchema(target?: JsonSchemaTarget): JsonSchemaResult; } //#endregion export { BooleanValidator }; //# sourceMappingURL=boolean-validator.d.mts.map