Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.36 KB

callbacks.md

File metadata and controls

51 lines (40 loc) · 1.36 KB

Documentation

Callbacks

interface AggregateFunction<TSource, TResult> {
  (accumulator: TResult, value: TSource, index: number, source: IEnumerable<TSource>): TResult
}

interface CompareFunction<TSource> {
  (a: TSource, b: TSource): number
}

interface EqualityFunction<TSource> {
  (a: TSource, b: TSource): boolean
}

interface PredicateFunction<TSource> {
  (value: TSource, index: number, source: IEnumerable<TSource>): boolean
}

interface ResultFunction<TFirst, TSecond, TResult> {
  (first: TFirst, second: TSecond, index: number): TResult
}

interface SelectFunction<TSource, TResult> {
  (value: TSource): TResult
}

interface IndexedSelectFunction<TSource, TResult> {
  (value: TSource, index: number, source: IEnumerable<TSource>): TResult
}

interface SelectManyFunction<TSource, TResult> {
  (value: TSource): IEnumerable<TResult>
}

interface IndexedSelectManyFunction<TSource, TResult> {
  (value: TSource, index: number, source: IEnumerable<TSource>): IEnumerable<TResult>
}