-
Notifications
You must be signed in to change notification settings - Fork 153
/
finance.d.ts
160 lines (137 loc) · 5.52 KB
/
finance.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
* @class Finance
*/
export class Finance {
/**
* Present Value (PV)
* The current worth of a future sum of money or stream of cash flows given a specified rate of return
* @param rate
* @param cashFlow
*/
public PV(rate: number, cashFlow: number): number;
/**
* Future Value (FV)
* The value of an asset or cash at a specified date in the future that is equivalent in value to a specified sum today
* @param rate
* @param cashFlow
* @param numOfPeriod
*/
public FV(rate: number, cashFlow: number, numOfPeriod: number): number;
/**
* Net Present Value (NPV)
* Compares the money received in the future to an amount of money received today, while accounting for time and interest [through the discount rate].
* It's based on the principal of time value of money (TVM), which explains how time affects monetary value
* @param rate
* @param initialInvestment
* @param cashFlows
*/
public NPV(rate: number, initialInvestment: number, ...cashFlows: number[]): number;
/**
* Internal Rate of Return (IRR)
* The discount rate often used in capital budgeting that makes the net present value of all cash flows from a particular project equal to zero
* @param cfs
* @param cashFlows
*/
public IRR(cfs: number, ...cashFlows: number[]): number;
/**
* Payback Period (PP)
* The length of time required to recover the cost of an investment
* @param numOfPeriods
* @param cashFlows
*/
public PP(numOfPeriods: number, ...cashFlows: number[]): number;
/**
* Return on Investment (ROI)
* A simple calculation that tells you the bottom line return of any investment
* @param initialInvestment
* @param earnings
*/
public ROI(initialInvestment: number, earnings: number): number;
/**
* Amortization (AM)
* The paying off of debt with a fixed repayment schedule in regular installments over a period of time
* @param principal
* @param rate
* @param period
* @param yearOrMonth
* @param payAtBeginning
*/
public AM(principal: number, rate: number, period: number, yearOrMonth: number, payAtBeginning?: boolean): number;
/**
* Profitability Index (PI)
* An index that attempts to identify the relationship between the costs and benefits of a proposed project through the use of a ratio calculated
* @param rate
* @param initialInvestment
* @param cashFlows
*/
public PI(rate: number, initialInvestment: number, ...cashFlows: number[]): number;
/**
* Discount Factor (DF)
* The factor by which a future cash flow must be multiplied in order to obtain the present value
* @param rate
* @param numOfPeriods
*/
public DF(rate: number, numOfPeriods: number): number;
/**
* Compound Interest (CI)
* The interest calculated on the initial principal and also on the accumulated interest of previous periods of a deposit or loan
* @param rate
* @param numOfCompoundings
* @param principal
* @param numOfPeriods
*/
public CI(rate: number, numOfCompoundings: number, principal: number, numOfPeriods: number): number;
/**
* Compound Annual Growth Rate (CAGR)
* The year-over-year growth rate of an investment over a specified period of time
* @param beginningValue
* @param endingValue
* @param numOfPeriods
*/
public CAGR(beginningValue: number, endingValue: number, numOfPeriods: number): number;
/**
* Leverage Ratio (LR)
* Used to calculate the financial leverage of a company or individual to get an idea of the methods of financing or to measure ability to meet financial obligations
* @param totalLiabilities
* @param totalDebts
* @param totalIncome
*/
public LR(totalLiabilities: number, totalDebts: number, totalIncome: number): number;
/**
* Rule of 72 (R72)
* A rule stating that in order to find the number of years required to double your money at a given interest rate, you divide the compound return into 72
* @param rate
*/
public R72(rate: number): number;
/**
* Weighted Average Cost of Capital (WACC)
* The rate that a company is expected to pay on average to all its security holders to finance its assets
* @param marketValueOfEquity
* @param marketValueOfDebt
* @param costOfEquity
* @param costOfDebt
* @param taxRate
*/
public WACC(marketValueOfEquity: number, marketValueOfDebt: number, costOfEquity: number, costOfDebt: number, taxRate: number): number;
/**
* Loan Payment Per Period (PMT)
* Payment for a loan based on constant payments and a constant interest rate
* @param fractionalRate
* @param numOfPayments
* @param principal
*/
public PMT(fractionalRate: number, numOfPayments: number, principal: number): number;
/**
* Inflation-adjusted Return (IAR)
* Measure the return taking into account the time period's inflation rate
* @param investmentReturn
* @param inflationRate
*/
public IAR(investmentReturn: number, inflationRate: number): number;
/**
* Seeks the zero point of the function fn(x), accurate to within x \pm 0.01. fn(x) must be decreasing with x.
* @param fn
*/
private seekZero(fn: (input: number) => number): number;
}