import { z } from 'zod'; import Response, { ResponseErrorType } from '../API/Response.js'; /** * Validates the given data against the provided schema. * @param {any} data - The data to be validated. * @param {z.ZodObject | z.ZodUnion | z.ZodIntersection | z.ZodEffects} schema - The schema to validate against. * @returns {boolean | Response} - Returns true if the data is valid, otherwise returns a response object with an error message. */ export default class Validator { /** * Validates the given data against the provided schema. * @param {any} data - The data to be validated. * @param {z.ZodObject | z.ZodUnion | z.ZodIntersection | z.ZodEffects} schema - The schema to validate against. * @returns {boolean | Response} - Returns either true if the data is valid or a Response object with an error message if validation fails. */ static validateSchema(data: any, schema: z.ZodObject | z.ZodUnion | z.ZodIntersection | z.ZodEffects): boolean | Response; }