/** * loop item holding some interesting values over the loop */ export type LoopContext = { count: number; loop: boolean; item: any | null; value: T | null; key: number | string | null; cancelled: boolean; }; /** * specific item callback for a collection (array, number indexed) */ export type CollectionCallback = (this: LoopContext, value: T, index: number) => any | boolean; /** * specific item callback for a hashmap (string/number indexed, arbitrary value) */ export type HasMapCallback = (this: LoopContext, key: string, value: T) => any | boolean; export type HashMapKey = string | number;