import { JsonSchemaResult, JsonSchemaTarget } from "../standard-schema/json-schema.mjs"; import { BaseValidator } from "./base-validator.mjs"; //#region ../@warlock.js/seal/src/validators/instanceof-validator.d.ts /** * InstanceOf validator class * * Validates that the value is an instance of the given constructor (`value instanceof Ctor`). * Useful for File uploads, Buffer/Uint8Array payloads, and custom domain classes — * anywhere a runtime class identity is the right contract. * * Note: `Date` is already covered by `v.date()` with richer date-specific rules; * reach for `v.instanceof(Date)` only when you specifically want raw `instanceof` * semantics with no normalization. * * @example * v.instanceof(File) // type: File * v.instanceof(Buffer) // type: Buffer * v.instanceof(MyClass) // type: MyClass */ declare class InstanceOfValidator extends BaseValidator { ctor: new (...args: any[]) => T; constructor(ctor: new (...args: any[]) => T, errorMessage?: string); /** * Check if value is an instance of the configured constructor */ matchesType(value: any): boolean; /** * Clone the validator, preserving the target constructor. * * The base `clone()` only copies `BaseValidator` fields, so without this * override a cloned `instanceof` validator loses its `ctor` reference and * `matchesType()` would throw on the next call. */ clone(): this; /** * @inheritdoc * * Class instances are not representable in JSON Schema — returns an empty * schema (permissive). Consumers serializing to OpenAPI should attach an * appropriate format manually if needed (e.g. `{ type: "string", format: "binary" }` * for `File`). */ toJsonSchema(_target?: JsonSchemaTarget): JsonSchemaResult; } //#endregion export { InstanceOfValidator }; //# sourceMappingURL=instanceof-validator.d.mts.map