UNPKG

react-elegant-ui

Version:

Elegant UI components, made by BEM best practices for react

11 lines (10 loc) 487 B
/** * Complex search by array top to down or vice versa * * Loop search from start index until start index inclusive * * @param items array of items * @param predicate callback to check suitable * @param direction 1 to positive search, -1 to negative search */ export declare const findIndexLoop: <T extends unknown>(items: readonly T[], predicate: (item: T, iteration: number, items: readonly T[]) => boolean, startIndex?: number, direction?: 1 | -1, loop?: boolean) => number;