import type { Extends, Not } from '.'; /** * The `Values` type extracts the type of the values stored in arrays or tuples. * * @returns A union of every value contained in the array/tuple * * @template TCollection - The array-like structure from which the values' type will be extracted. * * @example * Let's suppose we have an array of numbers, and we would like to extract the type its values * * ```typescript * type MyTuple = [1, 2, 3, 4]; * * type TupleValues = Values; // TupleValues: 1 | 2 | 3 | 4 * ``` * * @example * Now, let's suppose we have a regular TypeScript array, and we would like to extract its value * * ```typescript * type MyArray = (string | number)[]; * * type ArrayValues = Values; // ArrayValues: string | number * ``` */ export type Values> = TCollection extends Array ? TValues : never; /** * Checks if a given array ({@link TCollection}) is empty. * * @template TCollection - The array to be checked. It should extend 'Array'. * * @example * Validate an array that is empty: * ```typescript * type EmptyArray = []; * * type IsEmptyCheck = IsEmpty; * // Result: Constants.True * ``` * * @example * Validate an array that is not empty: * ```typescript * type NonEmptyArray = [1, 2, 3]; * * type IsEmptyCheck = IsEmpty; * // Result: Constants.False * ``` */ export type IsEmpty> = Extends; /** * Checks if a given array ({@link TCollection}) is not empty. * * @template TCollection - The collection (array) that needs to be checked if it's not empty. It must extend 'Array'. * * @see {@link Not} * @see {@link IsEmpty} * * @example * Checking non-empty array: * ```typescript * type NonEmptyArray = [1, 2, 3]; * * // This type checks will result to True because * // 'NonEmptyArray' is indeed not empty. * type IsNotEmptyCheck = IsNotEmpty; * ``` * * @example * Checking empty array: * ```typescript * type EmptyArray = []; * * // This type checks will result to False because 'EmptyArray' is empty. * type IsNotEmptyCheck = IsNotEmpty; * ``` */ export type IsNotEmpty> = Not>; //# sourceMappingURL=array.d.ts.map