import { type Maybe } from '../value/maybe.type'; /** * Configuration for limiting the number of items returned from an array. */ export interface LimitArrayConfig { /** * Number of items in the list to limit in the result. */ readonly limit: number; /** * If true the limit will be pulled from the end instead of the front of the array. */ readonly limitFromEnd?: boolean; } /** * Limits the number of items in an array based on the provided configuration. * Items are taken from the front of the array by default, or from the end if configured. * * @param array - source array to limit * @param inputConfig - configuration controlling the limit count and direction * @param inputConfig.limit - maximum number of items to include in the result * @param inputConfig.limitFromEnd - when true, items are taken from the end of the array instead of the front * @returns a new array with at most the configured number of items, or the original array if no limit is specified */ export declare function limitArray(array: T[], { limit, limitFromEnd }: Partial): T[]; export declare function limitArray(array: Maybe, { limit, limitFromEnd }: Partial): Maybe; export declare function limitArray(array: Maybe, config: Maybe>): Maybe;