import type { IndexedObject, IndexedRecord, NumStr, empty as baseEmpty, stringU as baseStringU, unknowns as baseUnknowns, types } from "../types"; export { _false as false, _null as null, _true as true, _undefined as undefined }; export declare const and: { (value: unknown, guard1: Guard, guard2: Guard): value is A & B; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard): value is A & B & C; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): value is A & B & C & D; } & Readonly<{ factory: { (guard1: Guard, guard2: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): Guard; }; }>; export declare const or: { (value: unknown, guard1: Guard, guard2: Guard): value is A | B; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard): value is A | B | C; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): value is A | B | C | D; } & Readonly<{ factory: { (guard1: Guard, guard2: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): Guard; }; }>; export declare const array: ((value: unknown) => value is baseUnknowns) & Readonly<{ /** * Checks if value type is T[]. * @param value - Value. * @param guard - Guard for type T. * @returns _True_ if value type is T[], _false_ otherwise. */ of: (value: unknown, guard: Guard) => value is readonly T[]; }>; export declare const arrayU: Guard; export declare const arrays: Guard; export declare const arraysU: Guard; export declare const booleanU: Guard; export declare const booleans: Guard; export declare const booleansU: Guard; export declare const indexedObject: ((value: unknown) => value is IndexedObject) & Readonly<{ /** * Checks if value type is IndexedObject\. * @param value - Value. * @param guard - Guard for type T. * @returns _True_ if value type is IndexedObject\, _false_ otherwise. */ of: (value: unknown, guard: Guard) => value is IndexedObject; }>; export declare const indexedObjectU: Guard; export declare const indexedObjects: Guard; export declare const indexedObjectsU: Guard; export declare const map: ((value: unknown) => value is ReadonlyMap) & Readonly<{ /** * Checks if value type is Map\. * @param value - Value. * @param keyGuard - Key guard. * @param valueGuard - Value guard. * @returns _True_ if value type is Map\, _false_ otherwise. */ of: (value: unknown, keyGuard: Guard, valueGuard: Guard) => value is ReadonlyMap; }>; export declare const mapU: Guard | undefined>; export declare const maps: Guard[]>; export declare const mapsU: Guard[] | undefined>; export declare const numStrU: Guard; export declare const numStrs: Guard; export declare const numStrsU: Guard; export declare const numberU: Guard; export declare const numbers: Guard; export declare const numbersU: Guard; export declare const object: ((value: unknown) => value is object) & Readonly<{ factory: { (required: GuardsRecord, optional: GuardsRecord): Guard> & types.object.style.Undefined>; (required: GuardsRecord>, optional: GuardsRecord>): Guard; }; of: { (value: unknown, required: GuardsRecord, optional: GuardsRecord): value is types.object.style.Optional> & types.object.style.Undefined; (value: unknown, required: GuardsRecord>, optional: GuardsRecord>): value is T; }; }>; export declare const objectU: Guard; export declare const objects: Guard; export declare const objectsU: Guard; export declare const propertyKeyU: Guard; export declare const propertyKeys: Guard; export declare const propertyKeysU: Guard; export declare const set: ((value: unknown) => value is ReadonlySet) & Readonly<{ /** * Checks if value type is Set\. * @param value - Value. * @param guard - Guard for type T. * @returns _True_ if value type is Set\, _false_ otherwise. */ of: (value: unknown, guard: Guard) => value is ReadonlySet; }>; export declare const setU: Guard | undefined>; export declare const sets: Guard[]>; export declare const setsU: Guard[] | undefined>; export declare const strings: Guard; export declare const stringsU: Guard; export declare const symbolU: Guard; export declare const symbols: Guard; export declare const symbolsU: Guard; export declare const tuple: { (value: unknown, guard: Guard): value is readonly [A]; (value: unknown, guard1: Guard, guard2: Guard): value is readonly [A, B]; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard): value is readonly [A, B, C]; (value: unknown, guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): value is readonly [A, B, C, D]; } & Readonly<{ factory: { (guard: Guard): Guard; (guard1: Guard, guard2: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard): Guard; (guard1: Guard, guard2: Guard, guard3: Guard, guard4: Guard): Guard; }; }>; export declare const unknowns: Guard; export declare const unknownsU: Guard; export declare const not: ((value: V, guard: Guard) => value is Exclude) & Readonly<{ array: ExclusionGuard; boolean: ExclusionGuard; empty: ExclusionGuard; factory: typeof _notFactory; false: ExclusionGuard; indexedObject: ExclusionGuard; map: ExclusionGuard>; null: ExclusionGuard; numStr: ExclusionGuard; number: ExclusionGuard; object: ExclusionGuard; propertyKey: ExclusionGuard; set: ExclusionGuard>; string: ExclusionGuard; stringU: ExclusionGuard; symbol: ExclusionGuard; true: ExclusionGuard; undefined: ExclusionGuard; }>; /** * Checks if value is a boolean. * @param value - Value. * @returns _True_ if value is a boolean, _false_ otherwise. */ export declare function boolean(value: unknown): value is boolean; /** * Checks if value type is T. * @param value - Value. * @returns _True_ if value type is T, _false_ otherwise. */ export declare function callable(value: unknown): value is T; /** * Checks if value type is T. * @param value - Value. * @returns _True_ if value type is T, _false_ otherwise. */ export declare function constructor(value: unknown): value is T; /** * Checks if value type is empty. * @param value - Value. * @returns _True_ if value type is empty, _false_ otherwise. */ export declare function empty(value: unknown): value is baseEmpty; /** * Checks if value type is T. * @param value - Value. * @param en - Validation object. * @returns _True_ if value type is T, _false_ otherwise. */ export declare function enumeration(value: unknown, en: IndexedRecord): value is T; /** * Creates single-arg guard. * @param guard - Multi-arg guard. * @param args - Arguments. * @returns Single-arg guard. */ export declare function factory(guard: MultiArgGuard, ...args: A): Guard; /** * Checks if value type is T. * @param value - Value. * @param ctor - Constructor. * @returns _True_ if value type is T, _false_ otherwise. */ export declare function instanceOf(value: unknown, ctor: types.fn.Constructor): value is T; /** * Checks if value type is T[]. * @param value - Value. * @param ctor - Constructor. * @returns _True_ if value type is T[], _false_ otherwise. */ export declare function instancesOf(value: unknown, ctor: types.fn.Constructor): value is readonly T[]; /** * Checks if value is _never_. * @param _value - Value. * @returns _False_. */ export declare function never(_value: unknown): _value is never; /** * Checks if value type is NumStr. * @param value - Value. * @returns _True_ if value type is NumStr, _false_ otherwise. */ export declare function numStr(value: unknown): value is NumStr; /** * Checks if value is a number. * @param value - Value. * @returns _True_ if value is a number, _false_ otherwise. */ export declare function number(value: unknown): value is number; /** * Checks if value type is PropertyKey. * @param value - Value. * @returns _True_ if value type is PropertyKey, _false_ otherwise. */ export declare function propertyKey(value: unknown): value is PropertyKey; /** * Checks if value is a string. * @param value - Value. * @returns _True_ if value is a string, _false_ otherwise. */ export declare function string(value: unknown): value is string; /** * Checks if value is a string. * @param value - Value. * @returns _True_ if value is a string, _false_ otherwise. */ export declare function stringU(value: unknown): value is baseStringU; /** * Checks if value is a symbol. * @param value - Value. * @returns _True_ if value is a symbol, _false_ otherwise. */ export declare function symbol(value: unknown): value is symbol; /** * Checks if value is _unknown_. * @param _value - Value. * @returns _True_. */ export declare function unknown(_value: unknown): _value is unknown; export interface ExclusionGuard { /** * Checks if value type is not T. * @param value - Value. * @returns _True_ if value type is not T, _false_ otherwise. */ (value: V): value is Exclude; } export interface Guard { /** * Checks if value type is T. * @param value - Value. * @returns _True_ if value type is T, _false_ otherwise. */ (value: unknown): value is T; } export type Guards = readonly Guard[]; export type GuardsRecord = { readonly [L in K]-?: Guard; }; export interface MultiArgGuard { /** * Checks if value type is T. * @param value - Value. * @param args - Arguments. * @returns _True_ if value type is T, _false_ otherwise. */ (value: unknown, ...args: A): value is T; } /** * Checks if value is _false_. * @param value - Value. * @returns _True_ if value is _false_, _false_ otherwise. */ declare function _false(value: unknown): value is false; /** * Creates guard for type not T. * @param guard - Guard for type T. * @returns Guard for type not T. */ declare function _notFactory(guard: Guard): ExclusionGuard; /** * Checks if value is _null_. * @param value - Value. * @returns _True_ if value is _null_, _false_ otherwise. */ declare function _null(value: unknown): value is null; /** * Checks if value is _true_. * @param value - Value. * @returns _True_ if value is _true_, _false_ otherwise. */ declare function _true(value: unknown): value is true; /** * Checks if value is _undefined_. * @param value - Value. * @returns _True_ if value is _undefined_, _false_ otherwise. */ declare function _undefined(value: unknown): value is undefined; //# sourceMappingURL=guards.d.ts.map