Type Utils
    Preparing search index...

    Variable RulesConst

    Rules: {
        Array: {
            max: RuleFactory<"Array.max">;
            min: RuleFactory<"Array.min">;
            optional: RuleFactory<"optional">;
            unique: RuleFactory<"Array.unique", UniqueArgs>;
        };
        getCustomRuleMessages: (rules: Custom[]) => string[];
        getRuleSetterForCustomHandler: <Handler extends CustomHandler>(
            handler: Handler,
        ) => <Subject extends any>(
            subject: Subject,
        ) => Readonly<
            {
                setErrorMessage: (message: string) => Rule;
                setErrorMessageFormator: (
                    messageFormator: (...args: any[]) => string,
                ) => Rule;
            },
        >;
        isCustom: <
            Args extends any[] = unknown[],
            RuleName extends string = string,
            Subject = unknown,
        >(
            arg: unknown,
        ) => arg is Custom<Args, RuleName, Subject>;
        isCustomHandler: <
            Handler extends CustomHandler = CustomHandler<unknown[], unknown>,
        >(
            handler: unknown,
        ) => handler is Handler;
        Number: {
            max: RuleFactory<"Number.max">;
            min: RuleFactory<"Number.min">;
            nonZero: RuleFactory<"Number.nonZero">;
            optional: RuleFactory<"optional">;
        };
        Optional: { optional: RuleFactory<"optional"> };
        Record: {
            nonEmpty: RuleFactory<"Record.nonEmpty">;
            optional: RuleFactory<"optional">;
        };
        setRule: (
            rule: Rule,
        ) => Readonly<
            {
                setErrorMessage: (message: string) => Rule;
                setErrorMessageFormator: (
                    messageFormator: (...args: any[]) => string,
                ) => Rule;
            },
        >;
        String: {
            email: RuleFactory<"String.email">;
            max: RuleFactory<"String.max">;
            min: RuleFactory<"String.min">;
            nonEmpty: RuleFactory<"String.nonEmpty">;
            optional: RuleFactory<"optional">;
            regex: RuleFactory<"String.regex">;
            url: RuleFactory<"String.url">;
        };
        createRule<
            CustomRule extends Custom<any[], string, any>,
            Message extends string = string,
            Formator extends MessageFormator = MessageFormator,
            RuleName extends string = GetCustomRuleName<CustomRule>,
            Handler extends CustomHandler = GetCustomRuleHandler<CustomRule>,
        >(
            __namedParameters: CreateRuleArgs<RuleName, Handler, Message, Formator>,
        ): Factory<Parameters<ReturnType<Handler>>, CustomRule>;
        createRule<
            Handler extends CustomHandler,
            RName extends string = string,
            Message extends string = string,
            Formator extends MessageFormator = MessageFormator,
        >(
            __namedParameters: CreateRuleArgs<RName, Handler, Message, Formator>,
        ): CustomFactory<Parameters<ReturnType<Handler>>, RName, Param0<Handler>>;
        getRule<
            T extends
                | "Number.nonZero"
                | "Number.max"
                | "Number.min"
                | "Array.max"
                | "Array.min"
                | "Array.unique"
                | "String.max"
                | "String.min"
                | "String.regex"
                | "String.nonEmpty"
                | "String.email"
                | "String.url"
                | "Record.nonEmpty"
                | "optional",
        >(
            name: T,
        ): {
            "__Array.max__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.min__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.unique__": (arg: unknown[], deepObject: boolean) => boolean;
            "__Number.max__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.min__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.nonZero__": (arg: number) => boolean;
            __optional__: (arg: unknown) => arg is undefined;
            "__Record.nonEmpty__": (arg: Record<keyof any, unknown>) => boolean;
            "__String.email__": (arg: string) => boolean;
            "__String.max__": (arg: string, n: number | bigint) => boolean;
            "__String.min__": (arg: string, n: number | bigint) => boolean;
            "__String.nonEmpty__": (arg: string) => boolean;
            "__String.regex__": (arg: string, regex: RegExp) => boolean;
            "__String.url__": (arg: string) => boolean;
        }[{
            "Array.max": "__Array.max__";
            "Array.min": "__Array.min__";
            "Array.unique": "__Array.unique__";
            "Number.max": "__Number.max__";
            "Number.min": "__Number.min__";
            "Number.nonZero": "__Number.nonZero__";
            optional: "__optional__";
            "Record.nonEmpty": "__Record.nonEmpty__";
            "String.email": "__String.email__";
            "String.max": "__String.max__";
            "String.min": "__String.min__";
            "String.nonEmpty": "__String.nonEmpty__";
            "String.regex": "__String.regex__";
            "String.url": "__String.url__";
        }[T]];
        getRule<
            T extends
                | "Number.nonZero"
                | "Number.max"
                | "Number.min"
                | "Array.max"
                | "Array.min"
                | "Array.unique"
                | "String.max"
                | "String.min"
                | "String.regex"
                | "String.nonEmpty"
                | "String.email"
                | "String.url"
                | "Record.nonEmpty"
                | "optional",
            R extends Rule,
        >(
            name: T,
        ): R;
        getRule<
            T extends
                | "__Number.nonZero__"
                | "__Number.max__"
                | "__Number.min__"
                | "__Array.max__"
                | "__Array.min__"
                | "__Array.unique__"
                | "__String.max__"
                | "__String.min__"
                | "__String.regex__"
                | "__String.nonEmpty__"
                | "__String.email__"
                | "__String.url__"
                | "__Record.nonEmpty__"
                | "__optional__",
        >(
            key: T,
        ): {
            "__Array.max__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.min__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.unique__": (arg: unknown[], deepObject: boolean) => boolean;
            "__Number.max__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.min__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.nonZero__": (arg: number) => boolean;
            __optional__: (arg: unknown) => arg is undefined;
            "__Record.nonEmpty__": (arg: Record<keyof any, unknown>) => boolean;
            "__String.email__": (arg: string) => boolean;
            "__String.max__": (arg: string, n: number | bigint) => boolean;
            "__String.min__": (arg: string, n: number | bigint) => boolean;
            "__String.nonEmpty__": (arg: string) => boolean;
            "__String.regex__": (arg: string, regex: RegExp) => boolean;
            "__String.url__": (arg: string) => boolean;
        }[T];
        getRule<
            T extends
                | "__Number.nonZero__"
                | "__Number.max__"
                | "__Number.min__"
                | "__Array.max__"
                | "__Array.min__"
                | "__Array.unique__"
                | "__String.max__"
                | "__String.min__"
                | "__String.regex__"
                | "__String.nonEmpty__"
                | "__String.email__"
                | "__String.url__"
                | "__Record.nonEmpty__"
                | "__optional__",
            R extends Rule,
        >(
            key: T,
        ): R;
        isDefaultRule(rule: unknown): rule is Default;
        isRule(rule: unknown): rule is All;
        parseRule<R extends RuleTuple>(
            __namedParameters: R,
        ):
            | ((arg: number | bigint, n: number | bigint) => boolean)
            | ((arg: number | bigint, n: number | bigint) => boolean)
            | ((arg: number) => boolean)
            | ((arg: unknown[], n: number | bigint) => boolean)
            | ((arg: unknown[], n: number | bigint) => boolean)
            | ((arg: unknown[], deepObject: boolean) => boolean)
            | ((arg: string) => boolean)
            | ((arg: string, n: number | bigint) => boolean)
            | ((arg: string, n: number | bigint) => boolean)
            | ((arg: string) => boolean)
            | ((arg: string, regex: RegExp) => boolean)
            | ((arg: string) => boolean)
            | ((arg: Record<keyof any, unknown>) => boolean)
            | ((arg: unknown) => arg is undefined);
        useCustomRules<T, U extends Custom<any[], string, any>>(
            guard: TypeGuard<T>,
            rule: U,
        ): TypeGuard<T>;
        useCustomRules<
            T,
            U1 extends Custom<any[], string, any>,
            U2 extends Custom<any[], string, any>,
        >(
            guard: TypeGuard<T>,
            rule: U1,
            rule2: U2,
        ): TypeGuard<T>;
        useCustomRules<
            T,
            U1 extends Custom<any[], string, any>,
            U2 extends Custom<any[], string, any>,
            U3 extends Custom<any[], string, any>,
        >(
            guard: TypeGuard<T>,
            rule: U1,
            rule2: U2,
            rule3: U3,
        ): TypeGuard<T>;
        useCustomRules<
            T,
            U1 extends Custom<any[], string, any>,
            U2 extends Custom<any[], string, any>,
            U3 extends Custom<any[], string, any>,
            U4 extends Custom<any[], string, any>,
        >(
            guard: TypeGuard<T>,
            rule: U1,
            rule2: U2,
            rule3: U3,
            rule4: U4,
        ): TypeGuard<T>;
        useCustomRules<
            T,
            U1 extends Custom<any[], string, any>,
            U2 extends Custom<any[], string, any>,
            U3 extends Custom<any[], string, any>,
            U4 extends Custom<any[], string, any>,
            U5 extends Custom<any[], string, any>,
        >(
            guard: TypeGuard<T>,
            rule: U1,
            rule2: U2,
            rule3: U3,
            rule4: U4,
            rule5: U5,
        ): TypeGuard<T>;
        useCustomRules<
            T,
            U1 extends Custom<any[], string, any>,
            U2 extends Custom<any[], string, any>,
            U3 extends Custom<any[], string, any>,
            U4 extends Custom<any[], string, any>,
            U5 extends Custom<any[], string, any>,
            U extends Custom<any[], string, any>,
        >(
            guard: TypeGuard<T>,
            rule1: U1,
            rule2: U2,
            rule3: U3,
            rule4: U4,
            rule5: U5,
            ...rules: U[],
        ): TypeGuard<T>;
        useCustomRules<T, U extends Custom<any[], string, any>>(
            guard: TypeGuard<T>,
            ...rules: U[],
        ): TypeGuard<T>;
    } = ...

    Type declaration

    • Array: {
          max: RuleFactory<"Array.max">;
          min: RuleFactory<"Array.min">;
          optional: RuleFactory<"optional">;
          unique: RuleFactory<"Array.unique", UniqueArgs>;
      }
    • getCustomRuleMessages: (rules: Custom[]) => string[]
    • getRuleSetterForCustomHandler: <Handler extends CustomHandler>(
          handler: Handler,
      ) => <Subject extends any>(
          subject: Subject,
      ) => Readonly<
          {
              setErrorMessage: (message: string) => Rule;
              setErrorMessageFormator: (
                  messageFormator: (...args: any[]) => string,
              ) => Rule;
          },
      >
    • isCustom: <
          Args extends any[] = unknown[],
          RuleName extends string = string,
          Subject = unknown,
      >(
          arg: unknown,
      ) => arg is Custom<Args, RuleName, Subject>
    • isCustomHandler: <Handler extends CustomHandler = CustomHandler<unknown[], unknown>>(
          handler: unknown,
      ) => handler is Handler
    • Number: {
          max: RuleFactory<"Number.max">;
          min: RuleFactory<"Number.min">;
          nonZero: RuleFactory<"Number.nonZero">;
          optional: RuleFactory<"optional">;
      }
    • Optional: { optional: RuleFactory<"optional"> }
    • Record: { nonEmpty: RuleFactory<"Record.nonEmpty">; optional: RuleFactory<"optional"> }
    • setRule: (
          rule: Rule,
      ) => Readonly<
          {
              setErrorMessage: (message: string) => Rule;
              setErrorMessageFormator: (
                  messageFormator: (...args: any[]) => string,
              ) => Rule;
          },
      >
    • String: {
          email: RuleFactory<"String.email">;
          max: RuleFactory<"String.max">;
          min: RuleFactory<"String.min">;
          nonEmpty: RuleFactory<"String.nonEmpty">;
          optional: RuleFactory<"optional">;
          regex: RuleFactory<"String.regex">;
          url: RuleFactory<"String.url">;
      }
    • createRule: function
    • getRule: function
      • Type Parameters

        • T extends
              | "Number.nonZero"
              | "Number.max"
              | "Number.min"
              | "Array.max"
              | "Array.min"
              | "Array.unique"
              | "String.max"
              | "String.min"
              | "String.regex"
              | "String.nonEmpty"
              | "String.email"
              | "String.url"
              | "Record.nonEmpty"
              | "optional"

        Parameters

        • name: T

        Returns {
            "__Array.max__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.min__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.unique__": (arg: unknown[], deepObject: boolean) => boolean;
            "__Number.max__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.min__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.nonZero__": (arg: number) => boolean;
            __optional__: (arg: unknown) => arg is undefined;
            "__Record.nonEmpty__": (arg: Record<keyof any, unknown>) => boolean;
            "__String.email__": (arg: string) => boolean;
            "__String.max__": (arg: string, n: number | bigint) => boolean;
            "__String.min__": (arg: string, n: number | bigint) => boolean;
            "__String.nonEmpty__": (arg: string) => boolean;
            "__String.regex__": (arg: string, regex: RegExp) => boolean;
            "__String.url__": (arg: string) => boolean;
        }[{
            "Array.max": "__Array.max__";
            "Array.min": "__Array.min__";
            "Array.unique": "__Array.unique__";
            "Number.max": "__Number.max__";
            "Number.min": "__Number.min__";
            "Number.nonZero": "__Number.nonZero__";
            optional: "__optional__";
            "Record.nonEmpty": "__Record.nonEmpty__";
            "String.email": "__String.email__";
            "String.max": "__String.max__";
            "String.min": "__String.min__";
            "String.nonEmpty": "__String.nonEmpty__";
            "String.regex": "__String.regex__";
            "String.url": "__String.url__";
        }[T]]

      • Type Parameters

        • T extends
              | "Number.nonZero"
              | "Number.max"
              | "Number.min"
              | "Array.max"
              | "Array.min"
              | "Array.unique"
              | "String.max"
              | "String.min"
              | "String.regex"
              | "String.nonEmpty"
              | "String.email"
              | "String.url"
              | "Record.nonEmpty"
              | "optional"
        • R extends Rule

        Parameters

        • name: T

        Returns R

      • Type Parameters

        • T extends
              | "__Number.nonZero__"
              | "__Number.max__"
              | "__Number.min__"
              | "__Array.max__"
              | "__Array.min__"
              | "__Array.unique__"
              | "__String.max__"
              | "__String.min__"
              | "__String.regex__"
              | "__String.nonEmpty__"
              | "__String.email__"
              | "__String.url__"
              | "__Record.nonEmpty__"
              | "__optional__"

        Parameters

        • key: T

        Returns {
            "__Array.max__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.min__": (arg: unknown[], n: number | bigint) => boolean;
            "__Array.unique__": (arg: unknown[], deepObject: boolean) => boolean;
            "__Number.max__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.min__": (arg: number | bigint, n: number | bigint) => boolean;
            "__Number.nonZero__": (arg: number) => boolean;
            __optional__: (arg: unknown) => arg is undefined;
            "__Record.nonEmpty__": (arg: Record<keyof any, unknown>) => boolean;
            "__String.email__": (arg: string) => boolean;
            "__String.max__": (arg: string, n: number | bigint) => boolean;
            "__String.min__": (arg: string, n: number | bigint) => boolean;
            "__String.nonEmpty__": (arg: string) => boolean;
            "__String.regex__": (arg: string, regex: RegExp) => boolean;
            "__String.url__": (arg: string) => boolean;
        }[T]

      • Type Parameters

        • T extends
              | "__Number.nonZero__"
              | "__Number.max__"
              | "__Number.min__"
              | "__Array.max__"
              | "__Array.min__"
              | "__Array.unique__"
              | "__String.max__"
              | "__String.min__"
              | "__String.regex__"
              | "__String.nonEmpty__"
              | "__String.email__"
              | "__String.url__"
              | "__Record.nonEmpty__"
              | "__optional__"
        • R extends Rule

        Parameters

        • key: T

        Returns R

    • isDefaultRule: function
    • isRule: function
    • parseRule: function
      • Type Parameters

        Parameters

        • __namedParameters: R

        Returns
            | ((arg: number | bigint, n: number | bigint) => boolean)
            | ((arg: number | bigint, n: number | bigint) => boolean)
            | ((arg: number) => boolean)
            | ((arg: unknown[], n: number | bigint) => boolean)
            | ((arg: unknown[], n: number | bigint) => boolean)
            | ((arg: unknown[], deepObject: boolean) => boolean)
            | ((arg: string) => boolean)
            | ((arg: string, n: number | bigint) => boolean)
            | ((arg: string, n: number | bigint) => boolean)
            | ((arg: string) => boolean)
            | ((arg: string, regex: RegExp) => boolean)
            | ((arg: string) => boolean)
            | ((arg: Record<keyof any, unknown>) => boolean)
            | ((arg: unknown) => arg is undefined)

    • useCustomRules: function