Options
All
  • Public
  • Public/Protected
  • All
Menu

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 uniformly Date objects.

Type parameters

Hierarchy

  • Temporal

Index

Constructors

constructor

  • new Temporal<T>(items: T[]): Temporal<T>
  • Type parameters

    • T: TemporalItem<"scenario" | "incomeStream" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "person" | "text", T>

    Parameters

    • items: T[]

    Returns Temporal<T>

Properties

Readonly items

items: readonly T[]

Accessors

first

  • get first(): T

last

  • get last(): T

length

  • get length(): number

Methods

[iterator]

  • [iterator](): IterableIterator<T>

entries

  • entries(): void

find

  • find<This>(callback: (value: T, index: Date, array: Temporal<T>) => boolean, thisArg?: This): undefined | T
  • Type parameters

    • This = undefined

    Parameters

    • callback: (value: T, index: Date, array: Temporal<T>) => boolean
        • (value: T, index: Date, array: Temporal<T>): boolean
        • Parameters

          • value: T
          • index: Date
          • array: Temporal<T>

          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

    • U

    • This = undefined

    Parameters

    • callback: (value: T, index: Date, array: Temporal<T>) => U | readonly U[]
        • (value: T, index: Date, array: Temporal<T>): U | readonly U[]
        • Parameters

          • value: T
          • index: Date
          • array: Temporal<T>

          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

    • V

    • This = undefined

    Parameters

    • fn: (i: T, idx: Date, temporal: Temporal<T>) => V
        • (i: T, idx: Date, temporal: Temporal<T>): V
        • Parameters

          Returns V

    • Optional thisArg: This

    Returns void

keys

  • keys(): Generator<Date, void, unknown>

map

  • map<V, This>(fn: (i: T, idx: Date, temporal: Temporal<T>) => V, thisArg: This): V[]
  • Type parameters

    • V

    • This = undefined

    Parameters

    • fn: (i: T, idx: Date, temporal: Temporal<T>) => V
        • (i: T, idx: Date, temporal: Temporal<T>): V
        • Parameters

          Returns V

    • thisArg: This

    Returns V[]

onDate

  • onDate(date: Date): 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

    • This = undefined

    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
          • array: Temporal<T>

          Returns T

    • Optional thisArg: This

    Returns T

  • Type parameters

    • This = undefined

    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
          • array: Temporal<T>

          Returns T

    • initialValue: T
    • Optional thisArg: This

    Returns T

  • Type parameters

    • U

    • This = undefined

    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
          • array: Temporal<T>

          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

    • This = undefined

    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
          • array: Temporal<T>

          Returns T

    • Optional thisArg: This

    Returns T

  • Type parameters

    • This = undefined

    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
          • array: Temporal<T>

          Returns T

    • initialValue: T
    • Optional thisArg: This

    Returns T

  • Type parameters

    • U

    • This = undefined

    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
          • array: Temporal<T>

          Returns U

    • initialValue: U
    • Optional thisArg: This

    Returns U

slice

  • slice(start?: Date, end?: Date): Temporal<T>

values

  • values(): IterableIterator<T>

Generated using TypeDoc