UNPKG

heap-typed

Version:

Heap. Javascript & Typescript Data Structure.

9 lines (8 loc) 684 B
import { IterableElementBase, IterableEntryBase } from '../../../data-structures'; export type EntryCallback<K, V, R> = (value: V, key: K, index: number, container: IterableEntryBase<K, V>) => R; export type ElementCallback<E, R, RT, C> = (element: E, index: number, container: IterableElementBase<E, R, C>) => RT; export type ReduceEntryCallback<K, V, R> = (accumulator: R, value: V, key: K, index: number, container: IterableEntryBase<K, V>) => R; export type ReduceElementCallback<E, R, RT, C> = (accumulator: RT, element: E, index: number, container: IterableElementBase<E, R, C>) => RT; export type IterableElementBaseOptions<E, R> = { toElementFn?: (rawElement: R) => E; };