Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ScenarioBaseSimple<this> & IEnhancements<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined, "sync", this>

Index

Constructors

constructor

Properties

Private Optional #temporal

#temporal: Temporal<ScenarioBase> = ...

Abstract allItems

allItems: AllItems

Abstract asset_list

asset_list: IFAsset[]

A list of Asset. See also assets.

Abstract assets

A lookup table of Asset for convenient lookup by name. See also asset_list.

Readonly categories

categories: Category[]

Readonly Abstract dateRange

dateRange: [start: Date, end: Date]

Optional Readonly end

end: boolean

Abstract expense_list

expense_list: IFExpense[]

A list of Expense. See also expenses.

Abstract expenses

A lookup table of Expense for convenient lookup by name. See also expense_list.

Readonly id

id: string

Abstract incomeStream_list

incomeStream_list: IFIncomeStream[]

A list of IncomeStream. See also incomeStreams.

Abstract incomeStreams

incomeStreams: NamedIndex<IFIncomeStream>

A lookup table of IncomeStream for convenient lookup by name. See also incomeStream_list.

Abstract income_list

income_list: IFIncome[]

A list of Income. See also incomes.

Abstract incomes

A lookup table of Income for convenient lookup by name. See also income_list.

Abstract liabilities

liabilities: NamedIndex<IFLiability>

A lookup table of {@link Loan} for convenient lookup by name. See also {@link loan_list}.

Abstract liability_list

liability_list: IFLiability[]

A list of {@link Loan}. See also {@link loans}.

Readonly name

name: string

Optional notes

notes: string

Abstract people

A lookup table of Person by name.

prettyName

prettyName: string

Readonly scenario

scenario: IFScenario

Readonly scenarios

scenarios: string[]

sort

sort: number & (cmp?: (a: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, b: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">) => number) => ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">[]

Sort order

Abstract spouse1

spouse1: IFPerson

Abstract spouse2

spouse2: null | IFPerson

Readonly start

start: Date

Abstract tax_list

tax_list: IFIncomeTax[]

A list of IncomeTax. See also taxes.

Abstract taxes

A lookup table of IncomeTax for convenient lookup by name. See also tax_list.

Abstract text_list

text_list: IFText[]

List of text messages

Abstract texts

A lookup table of IncomeTax for convenient lookup by name. See also tax_list.

Readonly type

type: "scenario"

Accessors

net_assets

  • get net_assets(): number

person_list

sources

  • Get the sources of income for potential income streams. This does not include loans; if borrowing is part of the strategy, as in a revolving line of credit or a reverse mortgage, use an Asset with negative balance.

    Returns (IFAsset | IFIncome)[]

temporal

total_expenses

  • get total_expenses(): number

Methods

[iterator]

  • [iterator](): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, unknown, unknown>

asArray

  • asArray(): ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">[]
  • Return all of the values from this generator as an array. You do not want to call this on an infinite generator (for obvious reasons); consider using IEnhancements.slice or IEnhancements.limit to limit the size before calling this.

    Returns ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">[]

concat

  • concat<T, TReturn, TNext>(...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedGenerator<T, void | TReturn, TNext>
  • Concatenates generators (or iterators or iterables).

    Ensures that any supplied generators are terminated when this is terminated.

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]

      zero or more additional Genable to provide values.

    Returns EnhancedGenerator<T, void | TReturn, TNext>

every

  • every(p: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => boolean, thisArg?: any): boolean
  • Returns false and terminates this generator if the predicate is false for any of the generator's yielded values.

    If the generator terminates without having failed the predicate, true is returned.

    Parameters

    • p: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => boolean

      predicate to apply to each yielded value.

        • (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number): boolean
        • Parameters

          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">
          • idx: number

          Returns boolean

    • Optional thisArg: any

      Optional value to supply as context (this) for the predicate

    Returns boolean

filter

  • filter(f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => boolean, thisArg?: any): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>
  • Return a new EnhancedGenerator that yields only the values that satisfy the predicate f.

    f receives the value and a sequential index.

    Parameters

    • f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => boolean
        • (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number): boolean
        • Parameters

          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">
          • idx: number

          Returns boolean

    • Optional thisArg: any

      Optional context to be passed as this to the predicate.

    Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>

findItem

  • findItem<T>(name: string, type: T): undefined | ItemImpl<T>
  • Type parameters

    • T: "incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text"

    Parameters

    • name: string
    • type: T

    Returns undefined | ItemImpl<T>

findItems

  • findItems<T, R>(type: T): R
  • Type parameters

    • T: "incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text"

    • R: ItemImpl<T>[]

    Parameters

    • type: T

    Returns R

findText

  • findText(name: string): string

flat

  • flat<D>(depth?: D): any
  • Flatten the values yielded by this generator to level depth. Produces a generator that yields the individual values at each level in depth-first order. Any iterable (including Array) or iterator will be traversed and its values yielded.

    The return type is currently over-broad

    Type parameters

    • D: number = 1

    Parameters

    • Optional depth: D

      (default = 1)

    Returns any

flatMap

  • flatMap<D>(f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => any, depth?: D): any
  • Flatten the values yielded by applying the function to the values yielded by the generator to level depth. Produces a generator that yields the individual values at each level in depth-first order. Any iterable (including Array) or iterator will be traversed and its values yielded.

    The return type is currently over-broad

    Type parameters

    • D: number = 1

    Parameters

    • f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => any
        • (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number): any
        • Parameters

          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">
          • idx: number

          Returns any

    • Optional depth: D

    Returns any

forEach

  • forEach(f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => void, thisArg?: any): void
  • Operate on each value produced by this generator. The function f is called with two values, the value yielded by this generator and a sequential index.

    Parameters

    • f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => void
        • (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number): void
        • Parameters

          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">
          • idx: number

          Returns void

    • Optional thisArg: any

      Value to be supplied as context this for function f.

    Returns void

hasCategory

  • hasCategory(category: Category): boolean
  • Determine if an item is in a specified category.

    Parameters

    Returns boolean

inScenario

  • inScenario(scenario: string): boolean
  • Determine if an item is in a specified scenario.

    Parameters

    • scenario: string

    Returns boolean

items

  • items(): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, unknown, unknown>
  • Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, unknown, unknown>

    all the items in a scenario as an enhanced iterator

join

  • join(sep?: string): string

limit

  • limit(max: number): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>
  • Limit the number of values that can be generated. A RangeError is thrown if this limit is exceeded. This is useful when you wish to abort an excessively large computation.

    Use with 0 as the first argument if you want to truncate.

    Parameters

    • max: number

    Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>

map

  • map<V>(f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => V, thisArg?: any): EnhancedGenerator<V, any, undefined>
  • Apply the function to each value yielded by this generator. It is called with two arguments, the value yielded, and a sequential index. The return value is a generator that yields the values produced by the function.

    Type parameters

    • V

    Parameters

    • f: (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number) => V
        • (v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, idx: number): V
        • Parameters

          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">
          • idx: number

          Returns V

    • Optional thisArg: any

      Optional value to be supplied as context this for function f.

    Returns EnhancedGenerator<V, any, undefined>

reduce

  • reduce<A, T, TReturn, TNext>(f: (acc: A | T, v: T) => A): A
  • reduce<A, T, TReturn, TNext>(f: (acc: A, v: T) => A, init: A): A
  • reduce<A>(f: (acc: A, v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">) => A, init?: A): A
  • Like Array.prototype.reduce, but the 3rd argument to the reducing function ("array") is omitted because there is no array.

    Type parameters

    • A

    • T

    • TReturn

    • TNext

    Parameters

    • f: (acc: A | T, v: T) => A
        • (acc: A | T, v: T): A
        • Parameters

          • acc: A | T
          • v: T

          Returns A

    Returns A

  • Like Array.prototype.reduce, but the 3rd argument to the reducing function ("array") is omitted because there is no array.

    Type parameters

    • A

    • T

    • TReturn = T

    • TNext = T

    Parameters

    • f: (acc: A, v: T) => A
        • (acc: A, v: T): A
        • Parameters

          • acc: A
          • v: T

          Returns A

    • init: A

    Returns A

  • Type parameters

    • A

    Parameters

    • f: (acc: A, v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">) => A
        • (acc: A, v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">): A
        • Parameters

          • acc: A
          • v: ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">

          Returns A

    • Optional init: A

    Returns A

repeat

  • repeat<N>(value: N, repetitions?: number): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text"> | N, void, undefined>
  • Returns a new generator that repeats the supplied value after this generator completes.

    Type parameters

    • N

    Parameters

    • value: N

      the value to repeat

    • Optional repetitions: number

      The number repetitions; the default is infinite.

    Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text"> | N, void, undefined>

repeatLast

  • repeatLast(max?: number): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>
  • Returns a new generator that repeats the last value returned by this (or undefined if this did not return any values).

    Parameters

    • Optional max: number

    Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>

slice

  • slice(start?: number, end?: number): EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>
  • Return a new EnhancedGenerator that only yields the indicated values, skipping start initial values and continuing until the end.

    Parameters

    • Optional start: number
    • Optional end: number

    Returns EnhancedGenerator<ItemImpl<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, undefined>

some

  • some<T>(p: (v: T, idx: number) => boolean, thisArg?: any): boolean
  • Returns true and terminates the generator if the predicate is true for any of the generator's yielded values.

    If the generator terminates without having satisfied the predicate, false is returned.

    Type parameters

    • T

    Parameters

    • p: (v: T, idx: number) => boolean

      predicate to apply to each yielded value.

        • (v: T, idx: number): boolean
        • Parameters

          • v: T
          • idx: number

          Returns boolean

    • Optional thisArg: any

      Optional value to supply as context (this) for the predicate

    Returns boolean

states

  • states(start: CalendarStep): Generator<IItemState<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, IItemState<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">>
  • Parameters

    Returns Generator<IItemState<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">, any, IItemState<"incomeStream" | "person" | "scenario" | "asset" | "liability" | "income" | "expense" | "incomeTax" | "text">>

Generated using TypeDoc