UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

15 lines (14 loc) 600 B
import { Constraint } from './Contraints'; import type { TemplateOptions } from '../types/Template'; import { Results } from '../types/Results'; import type { Text } from '../types/Text'; export type Validator = { property: string | symbol; constraint: Constraint; text: Text; actual?: Text; }; export declare const asResults: (subject: unknown, template: Text, options?: TemplateOptions) => Results; export declare const validate: (subject?: unknown) => Results; export declare const validateReject: <T>(subject: T) => Promise<T>; export declare const isValid: <T>(t: T) => boolean;