ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
15 lines (14 loc) • 679 B
TypeScript
/**
* Visit item pairs while walking away from index 0 in both directions around a circular list.
* The visitor receives `(previous, current)` pairs and may stop early by returning `true`.
*
* Order:
* - Forward: 0 -> step -> 2*step -> ... -> middle (inclusive)
* - Backward: 0 -> lastStep -> lastStep-step -> ... -> just above the middle
*
* @param items Items to walk.
* @param step Step size for each hop.
* @param visitPair Visitor called with `(previous, current)` pairs.
* @returns `true` if the visitor stopped the walk.
*/
export declare function walkPairsOutward<T>(items: T[], step: number, visitPair: (previous: T, current: T) => boolean | void): boolean;