Constructors
constructor
- new Temporal<T>(items: T[]): Temporal<T>
Type parameters
T: TemporalItem<"asset" | "liability" | "income" | "expense" | "incomeStream" | "incomeTax" | "person" | "text" | "scenario", T>
Parameters
Properties
Readonly items
items: readonly T[]
Methods
[iterator]
- [iterator](): IterableIterator<T>
Returns IterableIterator<T>
find
- find<This>(callback: (value: T, index: Date, array: Temporal<T>) => boolean, thisArg?: This): undefined | T
Type parameters
Parameters
callback: (value: T, index: Date, array: Temporal<T>) => boolean
- (value: T, index: Date, array: Temporal<T>): boolean
Parameters
Returns boolean
Optional thisArg: This
Returns undefined | T
flatMap
- flatMap<U, This>(callback: (value: T, index: Date, array: Temporal<T>) => U | readonly U[], thisArg?: This): U[]
Type parameters
Parameters
callback: (value: T, index: Date, array: Temporal<T>) => U | readonly U[]
- (value: T, index: Date, array: Temporal<T>): U | readonly U[]
Parameters
Returns U | readonly U[]
Optional thisArg: This
Returns U[]
forEach
- forEach<V, This>(fn: (i: T, idx: Date, temporal: Temporal<T>) => V, thisArg?: This): void
Type parameters
Parameters
fn: (i: T, idx: Date, temporal: Temporal<T>) => V
- (i: T, idx: Date, temporal: Temporal<T>): V
Optional thisArg: This
Returns void
keys
- keys(): Generator<Date, void, unknown>
Returns Generator<Date, void, unknown>
map
- map<V, This>(fn: (i: T, idx: Date, temporal: Temporal<T>) => V, thisArg: This): V[]
Type parameters
Parameters
fn: (i: T, idx: Date, temporal: Temporal<T>) => V
- (i: T, idx: Date, temporal: Temporal<T>): V
thisArg: This
Returns V[]
onDate
- onDate(date: Date): undefined | T
Parameters
Returns undefined | T
reduce
- reduce<This>(callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T, thisArg?: This): T
- reduce<This>(callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T, initialValue: T, thisArg?: This): T
- reduce<U, This>(callbackfn: (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>) => U, initialValue: U, thisArg?: This): U
Type parameters
Parameters
callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T
- (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>): T
Parameters
previousValue: T
currentValue: T
currentIndex: Date
Returns T
Optional thisArg: This
Returns T
Type parameters
Parameters
callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T
- (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>): T
Parameters
previousValue: T
currentValue: T
currentIndex: Date
Returns T
initialValue: T
Optional thisArg: This
Returns T
Type parameters
Parameters
callbackfn: (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>) => U
- (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>): U
Parameters
previousValue: U
currentValue: T
currentIndex: Date
Returns U
initialValue: U
Optional thisArg: This
Returns U
reduceRight
- reduceRight<This>(callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T, thisArg?: This): T
- reduceRight<This>(callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T, initialValue: T, thisArg?: This): T
- reduceRight<U, This>(callbackfn: (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>) => U, initialValue: U, thisArg?: This): U
Type parameters
Parameters
callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T
- (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>): T
Parameters
previousValue: T
currentValue: T
currentIndex: Date
Returns T
Optional thisArg: This
Returns T
Type parameters
Parameters
callbackfn: (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>) => T
- (previousValue: T, currentValue: T, currentIndex: Date, array: Temporal<T>): T
Parameters
previousValue: T
currentValue: T
currentIndex: Date
Returns T
initialValue: T
Optional thisArg: This
Returns T
Type parameters
Parameters
callbackfn: (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>) => U
- (previousValue: U, currentValue: T, currentIndex: Date, array: Temporal<T>): U
Parameters
previousValue: U
currentValue: T
currentIndex: Date
Returns U
initialValue: U
Optional thisArg: This
Returns U
slice
- slice(start?: Date, end?: Date): Temporal<T>
Parameters
Optional start: Date
Optional end: Date
values
- values(): IterableIterator<T>
Returns IterableIterator<T>
An immutable, temporally-sorted-and-indexed collection of TemporalItem instances.
Supports the methods on
Array
that make sense for an immutable object. Note that rather than integers, the indexes are uniformlyDate
objects.