/** * Sum all numbers in an array * @param array An array of numbers to sum */ export declare function sumArray(array: Array): number; /** * Reduce a fraction * @param array [numerator, denominator] */ export declare function reduceFractionArray(array: [number, number]): number[]; export declare function addItem(array: T[], item: T): T[]; export declare function removeItem(array: T[], item: T): T[]; /** * Get the next index based on the current index and step. * * @param currentIndex the current index * @param length the total length or count of items * @param step the number of steps * @param loop whether to circle back once `currentIndex` is at the start/end */ export declare function getNextIndex(currentIndex: number, length: number, step?: number, loop?: boolean): number; /** * Get's the previous index based on the current index. * Mostly used for keyboard navigation. * * @param index - the current index * @param count - the length or total count of items in the array * @param loop - whether we should circle back to the * first/last once `currentIndex` is at the start/end */ export declare function getPrevIndex(currentIndex: number, count: number, loop?: boolean): number; export declare function getNextItemFromSearch(items: T[], searchString: string, itemToString: (item: T) => string, currentItem: T): T | null;