import { type Maybe, type MaybeNot } from '../value/maybe.type'; /** * Function that takes an optional array of optional values and returns a filtered array with no Maybe values. */ export type FilterMaybeArrayFunction = (value: Maybe>) => T[]; /** * A generic variant of {@link FilterMaybeArrayFunction} that works with any element type. */ export type UniversalFilterMaybeArrayFunction = (values: Maybe[]>) => T[]; /** * Creates a {@link FilterMaybeArrayFunction} that filters maybe values from an array using the provided filter function. * * @param filterFn - Filter predicate used to determine which values to keep. * @returns Reusable filter operator that drops nullish entries and applies the predicate to the rest. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilKind factory * @dbxUtilTags array, filter, maybe, factory, predicate * @dbxUtilRelated filter-maybe-array-values * * @__NO_SIDE_EFFECTS__ */ export declare function filterMaybeArrayFunction(filterFn: Parameters>['filter']>[0]): FilterMaybeArrayFunction; /** * Filters all maybe values from the input array. If a maybe value is input, returns an empty array. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilTags array, filter, maybe, nullish, non-null, defined, compact * @dbxUtilRelated filter-empty-array-values, filter-maybe-array-function * * @param values - Optional array of optional values to filter. * @returns An array containing only non-null and non-undefined values. */ export declare const filterMaybeArrayValues: UniversalFilterMaybeArrayFunction; /** * Filters all empty and maybe values from the input array. If a maybe value is input, returns an empty array. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilTags array, filter, empty, maybe, nullish, non-empty, compact * @dbxUtilRelated filter-maybe-array-values, filter-maybe-array-function * * @param values - Optional array of optional values to filter. * @returns An array containing only non-null, non-undefined, and non-empty values. */ export declare const filterEmptyArrayValues: UniversalFilterMaybeArrayFunction; /** * Checks whether or not all values in the array are {@link MaybeNot} (null or undefined). * * @param values - Array of optional values to check. * @returns `true` if every value in the array is null or undefined. */ export declare function allValuesAreMaybeNot(values: Maybe[]): values is MaybeNot[]; /** * Checks whether or not all values in the array are defined (non-null and non-undefined). * * @param values - Array of optional values to check. * @returns `true` if every value in the array is non-null and non-undefined. */ export declare function allValuesAreNotMaybe(values: Maybe[]): values is T[];