UNPKG

n4s

Version:

typed schema validation version of enforce

964 lines (960 loc) 299 kB
import { $ as lengthEquals$1, A as lessThanOrEquals, B as UndefinedRuleInstance, C as ShapeRuleInstance, D as ObjectRulesUnion, E as IsArrayOfRuleInstance, F as isNegative, G as OneOfRuleInstance, H as isNotNaN, I as isBetween, J as AllOfRuleInstance, K as NoneOfRuleInstance, L as greaterThanOrEquals, M as isPositive, N as isNumber, O as numberNotEquals$1, P as isNotBetween, Q as isNotArray, R as NullRuleInstance, S as LooseRuleInstance, T as MultiTypeInputArgs, U as isNaN, V as AnyRuleInstance, W as CompoundRuleLazyTypes, X as equals$1, Y as BooleanRuleInstance, Z as isEmpty$1, _ as RecordRuleInstance, a as startsWith, at as shorterThan, b as PartialRuleInstance, c as isString, ct as notInside, d as endsWith, dt as isArray, et as lengthNotEquals, f as doesNotStartWith, ft as includes, g as TupleRuleInstance, gt as RuleRunReturn, h as SchemaRuleLazyTypes, ht as RuleInstance, i as FirstParam, it as minLength, j as lessThan, k as toNumber$1, l as isNotBlank, lt as equals, m as LazyRuleInstance, mt as ExtractRuleFunctions, nt as longerThanOrEquals, o as notMatches, ot as shorterThanOrEquals, p as doesNotEndWith, pt as BuildRuleInstance, q as AnyOfRuleInstance, r as enforceEager, rt as maxLength, s as matches, st as inside, t as CustomMatcherArgs, tt as longerThan$1, u as isBlankString, ut as notEquals, v as OmitRuleInstance, w as MultiTypeInput, x as OptionalRuleInstance, y as PickRuleInstance, z as NullishRuleInstance } from "./n4sTypes-3THfSmAQ.mjs"; import { Nullable } from "vest-utils"; import * as context0 from "context"; //#region src/enforceContext.d.ts /** * Context API for accessing validation state during rule execution. * Provides access to the current value being validated, metadata, and parent context. * Used internally by rules to track nested validation (e.g., in shape, isArrayOf). * * @example * ```typescript * // Access context in custom rules * enforce.extend({ * customRule: (value: any) => { * const context = enforce.context(); * console.log('Current value:', context?.value); * console.log('Metadata:', context?.meta); * return true; * } * }); * * // Context is automatically set in nested validations * enforce({ user: { name: 'John' } }).shape({ * user: enforce.shape({ * name: enforce.isString() * }) * }); * // When validating 'name', context.parent() gives access to 'user' object * ``` */ declare const ctx: context0.CtxCascadeApi<CTXType>; type CTXType = { meta: Record<string, any>; value: any; set?: boolean; parent: () => Nullable<CTXType>; }; type EnforceContext = Nullable<{ meta: Record<string, any>; value: any; parent: () => EnforceContext; }>; //#endregion //#region src/rules/parsers/toBoolean.d.ts declare function toBoolean(value: unknown): RuleRunReturn<boolean>; //#endregion //#region src/rules/parsers/generalParsers.d.ts declare function defaultTo<TValue>(value: TValue, fallback: NonNullable<TValue>): RuleRunReturn<NonNullable<TValue>>; //#endregion //#region ../vest-utils/types/vest-utils.d.cts //#region src/withResolvers.d.ts declare global { interface PromiseConstructor { withResolvers<T$1>(): { promise: Promise<T$1>; resolve: (value: T$1 | PromiseLike<T$1>) => void; reject: (reason?: any) => void; }; } } //#endregion //#region src/greaterThan.d.ts declare function greaterThan$1(value: number | string, gt: number | string): boolean; //#endregion //#region src/longerThan.d.ts //#endregion //#region src/numberEquals.d.ts declare function numberEquals$1(value: string | number, eq: string | number): boolean; //#endregion //#region src/lazy.d.ts /** * Extracts the output type from a custom matcher function. * If the matcher returns { type: T }, uses T (coercion rules like toNumber). * Otherwise falls back to the first parameter type (validation rules like isPositive). */ type InferMatcherOutput<K$1 extends keyof n4s.EnforceMatchers> = ReturnType<Extract<n4s.EnforceMatchers[K$1], (...args: any[]) => any>> extends { type: infer T; } ? T : FirstParam<n4s.EnforceMatchers[K$1]>; type TCustomLazyRules = { [K in keyof n4s.EnforceMatchers as K extends keyof SchemaRuleLazyTypes ? never : K extends keyof CompoundRuleLazyTypes ? never : K]: (...args: CustomMatcherArgs<K>) => RuleInstance<InferMatcherOutput<K>, [FirstParam<n4s.EnforceMatchers[K]>]> }; declare const baseEnforceLazy: { isArray: <T$1 = any>() => RuleInstance<T$1[], [T$1[]]> & { readonly defaultTo: (fallback: {}) => BuildRuleInstance<{}, [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly parseJSON: () => BuildRuleInstance<unknown, [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly toBoolean: () => BuildRuleInstance<boolean, [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly join: (separator?: string | undefined) => BuildRuleInstance<string, [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly uniq: () => BuildRuleInstance<unknown[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly equals: (b: unknown) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly includes: (item: unknown) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly inside: (container: string | unknown[]) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly isArray: () => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly isEmpty: () => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly isNotArray: () => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly isNotEmpty: () => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly lengthEquals: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly lengthNotEquals: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly longerThan: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly longerThanOrEquals: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly maxLength: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly minLength: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly notEquals: (b: unknown) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly notInside: (container: any) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly shorterThan: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; readonly shorterThanOrEquals: (n: number) => BuildRuleInstance<T$1[], [T$1[]], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly join: (value: unknown[], separator?: string) => RuleRunReturn<string>; readonly uniq: (value: unknown[]) => RuleRunReturn<unknown[]>; readonly equals: typeof equals; readonly includes: typeof includes; readonly inside: typeof inside; readonly isArray: typeof isArray; readonly isEmpty: typeof isEmpty$1; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals$1; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan$1; readonly longerThanOrEquals: typeof longerThanOrEquals; readonly maxLength: typeof maxLength; readonly minLength: typeof minLength; readonly notEquals: typeof notEquals; readonly notInside: typeof notInside; readonly shorterThan: typeof shorterThan; readonly shorterThanOrEquals: typeof shorterThanOrEquals; }>>; }; isBoolean: () => BooleanRuleInstance; isNull: () => NullRuleInstance; isNullish: () => NullishRuleInstance; isNumber: () => RuleInstance<number, [number]> & { readonly defaultTo: (fallback: {}) => BuildRuleInstance<{}, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly parseJSON: () => BuildRuleInstance<unknown, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly toBoolean: () => BuildRuleInstance<boolean, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly ceil: () => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly clamp: (min: number, max: number) => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly floor: () => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly round: () => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly toAbsolute: () => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly toDate: () => BuildRuleInstance<Date, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly isNotBetween: typeof isNotBetween; readonly isNotNaN: typeof isNotNaN; readonly isNumber: typeof isNumber; readonly isOdd: (value: string | number) => boolean; readonly isPositive: typeof isPositive; readonly lessThan: typeof lessThan; readonly lessThanOrEquals: typeof lessThanOrEquals; readonly numberEquals: typeof numberEquals$1; readonly numberNotEquals: typeof numberNotEquals$1; readonly toNumber: typeof toNumber$1; }>>; readonly toFloat: () => BuildRuleInstance<number, [number], ExtractRuleFunctions<{ readonly defaultTo: typeof defaultTo; readonly parseJSON: (value: string) => RuleRunReturn<unknown>; readonly toBoolean: typeof toBoolean; readonly ceil: (value: number) => RuleRunReturn<number>; readonly clamp: (value: number, min: number, max: number) => RuleRunReturn<number>; readonly floor: (value: number) => RuleRunReturn<number>; readonly round: (value: number) => RuleRunReturn<number>; readonly toAbsolute: (value: number) => RuleRunReturn<number>; readonly toDate: (value: unknown) => RuleRunReturn<Date>; readonly toFloat: (value: unknown) => RuleRunReturn<number>; readonly toInteger: (value: unknown, radix?: number) => RuleRunReturn<number>; readonly gt: typeof greaterThan$1; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals$1; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan$1; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween;