patrimoniumjs
Version:
Patrimonium.js is a JavaScript library providing a set of tools to modelize the real estate operations of an individual and their impact on the financial situation of the same individual.
70 lines (69 loc) • 1.72 kB
TypeScript
/**
* Represents the options of the `Loan`.
*/
export interface LoanOptions {
/**
* Borrowed amount.
*/
amount: number;
/**
* Loan period in months.
*/
period: number;
/**
* Interest rate of the loan (in percentage of the loan amount).
*/
interestRate: number;
/**
* Rate of the loan insurance (in percentage of the loan amount).
*/
insuranceRate: number;
/**
* Amount of the banking fees when signing the loan.
*/
bankingFees?: number;
elapsedMonths?: number;
}
/**
* Represents a loan.
*/
export declare class Loan {
/**
* Number of months elapsed since the beginning of the loan.
*/
elapsedMonths: number;
/**
* Amount borrowed.
*/
readonly amount: number;
/**
* Loan period in months.
*/
readonly period: number;
/**
* Interest rate of the loan (in percentage of the loan amount).
*/
readonly interestRate: number;
/**
* Rate of the loan insurance (in percentage of the loan amount).
*/
readonly insuranceRate: number;
/**
* Amount of the banking fees when signing the loan.
*/
readonly bankingFees: number;
/**
* Constructs a `Loan` based on the specified options.
* @param options The options of the `Loan`.
*/
constructor(options: LoanOptions);
/**
* Returns the monthly payment of the loan.
* @returns The monthly payment of the loan.
*/
get monthlyPayment(): number;
/**
* Returns the amount of the loan that still needs to be repaid.
*/
getAmountStillToBeRepaid(): number;
}