import type { Validator } from "../types"; /** * Checks the type of value by using the `typeof` operator. * Accepts an optional custom comparator function, where you can define * different logic of comparing type, i.e. `instanceof` or any other check. * * Please, remember that `typeof null === "object"` and `typeof NaN === 'number'` in JavaScript. * * @example * * ```ts * import { type } from 'compose-validators'; * * const validate = type('object'); * * validate('abc') // => { type: 'object' } * validate([]) // => {} * validate({}) // => {} * validate(null) // => {} * ``` * * @param t expected data type * @param comparator custom comparator function (typeof by default) */ export declare const type: (t: string, comparator?: (v: T) => boolean) => Validator; /** * A handy utility on top of {@link type} validator. * Checks that the given value is boolean by using the `typeof` operator. * * @example * * ```ts * import { boolean } from 'compose-validators'; * * boolean('abc') // => { type: 'boolean' } * boolean(true) // => {} * ``` */ export declare const boolean: Validator; /** * A handy utility on top of {@link type} validator. * Checks that the given value is number by using the `typeof` operator. * * @example * * ```ts * import { number } from 'compose-validators'; * * number('abc') // => { type: 'number' } * number(5) // => {} * number(NaN) // => {} * ``` */ export declare const number: Validator; /** * A handy utility on top of {@link type} validator. * Checks that the given value is string by using the `typeof` operator. * * @example * * ```ts * import { string } from 'compose-validators'; * * string(5) // => { type: 'string' } * string('abc') // => {} * ``` */ export declare const string: Validator; /** * A handy utility on top of {@link type} validator. * Checks that the given value is array by using the `Array.isArray` function. * * @example * * ```ts * import { array } from 'compose-validators'; * * array(5) // => { type: 'array' } * array([]) // => {} * ``` */ export declare const array: Validator;