/** * Array-focused utility helpers. * * @module bquery/core/utils/array */ /** * Ensures the input is always returned as an array. * * @template T - The item type * @param value - A single value, array, or nullish value * @returns An array (empty if nullish) * * @example * ```ts * ensureArray('a'); // ['a'] * ensureArray(['a', 'b']); // ['a', 'b'] * ensureArray(null); // [] * ``` */ export declare function ensureArray(value: T | T[] | null | undefined): T[]; /** * Removes duplicate entries from an array. * * @template T - The item type * @param items - The array to deduplicate * @returns A new array with unique items * * @example * ```ts * unique([1, 2, 2, 3]); // [1, 2, 3] * ``` */ export declare function unique(items: T[]): T[]; /** * Splits an array into chunks of a given size. * * @template T - The item type * @param items - The array to chunk * @param size - The maximum size of each chunk * @returns An array of chunks * * @example * ```ts * chunk([1, 2, 3, 4, 5], 2); // [[1,2],[3,4],[5]] * ``` */ export declare function chunk(items: T[], size: number): T[][]; /** * Removes falsy values from an array. * * @template T - The item type * @param items - The array to compact * @returns A new array without falsy values * * @example * ```ts * compact([0, 1, '', 'ok', null]); // [1, 'ok'] * ``` */ export declare function compact(items: Array): T[]; /** * Flattens a single level of nested arrays. * * @template T - The item type * @param items - The array to flatten * @returns A new flattened array * * @example * ```ts * flatten([1, [2, 3], 4]); // [1, 2, 3, 4] * ``` */ export declare function flatten(items: Array): T[]; //# sourceMappingURL=array.d.ts.map