Module types

Source

Type Aliases§

Source§

type Accumulator<I, O> = (acc: O, x: I[number]) => O

An accumulator function for use in reducing an array.

Source§

type ElementType<T> = T[number]

The type of an element in an array.

Source§

type Fn<I, O> = (x: I) => O

A function that takes a single input.

Source§

type IndexedPredicate<I> = (x: I, i: number) => boolean

A function that returns a boolean and accepts an index as the second argument.

Source§

type POJO<T> = Record<string, T>

A plain object with string keys.

Source§

type Predicate<I> = (x: I) => boolean

A function that returns a boolean.

Source§

type ValueType<T> = T[keyof T]

The type of a property in a POJO (plain JavaScript object).