import type { Primitive } from './typeFest'; import type { AnyObject, FalsyValue, NullishValue } from './types'; type Nullish = T extends NullishValue ? T : never; type Truthy = T extends FalsyValue ? never : T; type Falsy = T extends FalsyValue ? T : never; export declare const _isNull: (v: T) => v is T extends null ? T : never; export declare const _isUndefined: (v: T) => v is T extends undefined ? T : never; export declare const _isNullish: (v: T) => v is Nullish; export declare const _isNotNullish: (v: T) => v is NonNullable; /** * Same as Boolean, but with correct type output. * Related: * https://github.com/microsoft/TypeScript/issues/16655 * https://www.karltarvas.com/2021/03/11/typescript-array-filter-boolean.html * * @example * * [1, 2, undefined].filter(_isTruthy) * // => [1, 2] */ export declare const _isTruthy: (v: T) => v is Truthy; export declare const _isFalsy: (v: T) => v is Falsy; /** * Returns true if item is Object, not null and not Array. * * Currently treats RegEx as Object too, e.g _isObject(/some/) === true */ export declare function _isObject(obj: any): obj is AnyObject; export declare function _isPrimitive(v: any): v is Primitive; export declare function _isEmptyObject(obj: AnyObject): boolean; export declare function _isNotEmptyObject(obj: AnyObject): boolean; /** * Object is considered empty if it's one of: * undefined * null * '' (empty string) * [] (empty array) * {} (empty object) * new Map() (empty Map) * new Set() (empty Set) */ export declare function _isEmpty(obj: any): boolean; /** * @see _isEmpty */ export declare function _isNotEmpty(obj: any): boolean; export {};