UNPKG

n4s

Version:

typed schema validation version of enforce

966 lines (963 loc) 300 kB
import { $ as longerThanOrEquals, A as isPositive, B as isNotNaN, C as MultiTypeInputArgs, D as toNumber, E as numberNotEquals, F as greaterThanOrEquals, G as AllOfRuleInstance, H as OneOfRuleInstance, I as NullRuleInstance, J as isEmpty, K as BooleanRuleInstance, L as NullishRuleInstance, M as isNotBetween, N as isNegative, O as lessThanOrEquals, P as isBetween, Q as longerThan, R as UndefinedRuleInstance, S as MultiTypeInput, T as ObjectRulesUnion, U as NoneOfRuleInstance, V as isNaN, W as AnyOfRuleInstance, X as lengthEquals, Y as isNotArray, Z as lengthNotEquals, _ as PickRuleInstance, a as startsWith, at as notInside, b as LooseRuleInstance, c as isString, ct as isArray, d as endsWith, dt as ExtractRuleFunctions, et as maxLength, f as doesNotStartWith, ft as RuleInstance, g as OmitRuleInstance, h as RecordRuleInstance, i as FirstParam, it as inside, j as isNumber, k as lessThan, l as isNotBlank, lt as includes, m as TupleRuleInstance, nt as shorterThan, o as notMatches, ot as equals, p as doesNotEndWith, pt as RuleRunReturn, q as equals$1, r as enforceEager, rt as shorterThanOrEquals, s as matches, st as notEquals, t as CustomMatcherArgs, tt as minLength, u as isBlankString, ut as BuildRuleInstance, v as PartialRuleInstance, w as IsArrayOfRuleInstance, x as ShapeRuleInstance, y as OptionalRuleInstance, z as AnyRuleInstance } from "./n4sTypes-BSTzXRsU.cjs"; import { Nullable } from "vest-utils"; import * as context0 from "context"; //#region src/rules/compoundRules/compoundRulesTypes.d.ts /** * Type mappings for compound rule lazy API return types */ type CompoundRuleLazyTypes = { allOf: <T$1>(...rules: any[]) => AllOfRuleInstance<T$1>; anyOf: <Rules extends RuleInstance<any>[]>(...rules: Rules) => AnyOfRuleInstance<Rules[number]['infer']>; noneOf: <T$1>(...rules: any[]) => NoneOfRuleInstance<T$1>; oneOf: <Rules extends RuleInstance<any>[]>(...rules: Rules) => OneOfRuleInstance<Rules[number]['infer']>; }; //#endregion //#region src/rules/schemaRules/schemaRulesLazyTypes.d.ts /** * Type mappings for schema rule lazy API return types */ type SchemaRuleLazyTypes = { isArrayOf: <Rules extends RuleInstance<any, any>[]>(...rules: Rules) => IsArrayOfRuleInstance<MultiTypeInput<Rules>, MultiTypeInputArgs<Rules>>; list: <Rules extends RuleInstance<any, any>[]>(...rules: Rules) => IsArrayOfRuleInstance<MultiTypeInput<Rules>, MultiTypeInputArgs<Rules>>; lazy: <T$1>(factory: () => RuleInstance<T$1, any>) => LazyRuleInstance<T$1>; loose: <S extends Record<string, RuleInstance<any>>>(schema: S) => LooseRuleInstance<S>; optional: <R extends RuleInstance<any>>(rule: R) => OptionalRuleInstance<R['infer']>; partial: <S extends Record<string, RuleInstance<any>>>(schema: S) => PartialRuleInstance<S>; pick: <S extends Record<string, RuleInstance<any>>>(schema: S, keys: string[] | string) => PickRuleInstance<S>; omit: <S extends Record<string, RuleInstance<any>>>(schema: S, keys: string[] | string) => OmitRuleInstance<S>; shape: <S extends Record<string, RuleInstance<any>>>(schema: S) => ShapeRuleInstance<S>; record: { <V extends RuleInstance<any, any>>(valueRule: V): RecordRuleInstance<never, V>; <K$1 extends RuleInstance<string, any>, V extends RuleInstance<any, any>>(keyRule: K$1, valueRule: V): RecordRuleInstance<K$1, V>; }; tuple: <Rules extends RuleInstance<any, any>[]>(...rules: Rules) => TupleRuleInstance<Rules>; }; //#endregion //#region src/rules/schemaRules/lazy.d.ts type LazyRuleInstance<T$1> = RuleInstance<T$1, [T$1]>; //#endregion //#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(value: number | string, gt: number | string): boolean; //#endregion //#region src/longerThan.d.ts //#endregion //#region src/numberEquals.d.ts declare function numberEquals(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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly isNotArray: typeof isNotArray; readonly isNotEmpty: (value: unknown) => boolean; readonly lengthEquals: typeof lengthEquals; readonly lengthNotEquals: typeof lengthNotEquals; readonly longerThan: typeof longerThan; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; 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; readonly numberNotEquals: typeof numberNotEquals; readonly toNumber: typeof toNumber; }>>; 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; readonly gte: typeof greaterThanOrEquals; readonly lt: typeof lessThan; readonly lte: typeof lessThanOrEquals; readonly eq: typeof equals$1; readonly neq: typeof numberNotEquals; readonly equals: typeof equals$1; readonly greaterThan: typeof greaterThan; readonly greaterThanOrEquals: typeof greaterThanOrEquals; readonly isBetween: typeof isBetween; readonly isEven: (value: string | number) => boolean; readonly isNaN: typeof isNaN; readonly isNegative: typeof isNegative; readonly