UNPKG

joiful

Version:

TypeScript Declarative Validation. Decorate your class properties to validate them using Joi.

26 lines (25 loc) 1.27 kB
import * as Joi from 'joi'; import { TypedPropertyDecorator } from '../core'; import { ModifierProviders, JoifulOptions } from './common'; import { AnySchemaModifiers } from './any'; export interface FunctionSchemaModifiers extends AnySchemaModifiers { /** * Specifies the arity of the function. * @param argumentCount The number of arguments the function should contain. */ arity(argumentCount: number): this; /** * Specifies the maximum arity of the function. * @param maxArgumentCount The maximum number of arguments the function should contain. */ maxArity(maxArgumentCount: number): this; /** * Specifies the minimum arity of the function. * @param minArgumentCount The minimum number of arguments the function should contain. */ minArity(minArgumentCount: number): this; } export declare function getFunctionSchemaModifierProviders(getJoi: () => typeof Joi): ModifierProviders<Joi.FunctionSchema, FunctionSchemaModifiers>; export interface FunctionSchemaDecorator extends FunctionSchemaModifiers, TypedPropertyDecorator<Function> { } export declare const createFunctionPropertyDecorator: (joifulOptions: JoifulOptions) => import("./common").PropertyDecorator<Function, FunctionSchemaModifiers>;