UNPKG

@httpc/kit

Version:

httpc toolbox for building function-based API with minimal code and end-to-end type safety

16 lines (15 loc) 814 B
import type { ILogger } from "../logging"; import { IValidator, ValidationResult } from "./types"; export type ValidationServiceOptions = { onMissingValidator: "throw" | "skip"; }; declare const ValidationService_base: { new (logger: ILogger, ...args: any[]): import("../services")._BaseService<"not_found" | "invalid_param" | "unauthorized" | "forbidden" | "not_allowed" | "invalid_state" | "misconfiguration" | "not_supported" | "processing_error">; }; export declare class ValidationService extends ValidationService_base { readonly validators: IValidator[]; protected options: ValidationServiceOptions; constructor(logger: ILogger, validators: IValidator[], options?: Partial<ValidationServiceOptions>); validate(object: any, schema: any): ValidationResult; } export {};