mortgage-calculator-package
Version:
A simple, embeddable mortgage calculator that dynamically generates an interactive and styled calculator widget. It allows users to input mortgage amount, interest rate, amortization period, and payment frequency, and calculates the monthly payment based
57 lines (56 loc) • 1.99 kB
TypeScript
export interface MortgageResult {
maxMortgageAmount: number;
monthlyMortgagePayment: number;
stressTestRate: number;
gdsRatio: number;
tdsRatio: number;
monthlyGrossIncome: number;
totalMonthlyHousingCosts: number;
totalMonthlyDebtCosts: number;
homeExpenses: number;
includedCondoFees: number;
cashLeftGross: number;
isQualified: boolean;
}
export interface MortgageParams {
grossAnnualIncome: number;
monthlyDebtPayments: number;
propertyTaxMonthly: number;
condoFees: number;
heatCosts: number;
interestRate: number;
amortizationYears: number;
amortizationMonths: number;
affordabilityLevel: number;
rentalIncomeMonthly: number;
includeRentalIncome: boolean;
}
export declare function formatCurrency(amount: number, detailed?: boolean): string;
export declare function formatPercentage(value: number, decimals?: number): string;
export declare function parseNumericValue(value: string): number;
export declare function formatNumericInput(value: number): string;
export declare function calculateMonthlyFromYearly(yearly: number): number;
export declare function calculateYearlyFromMonthly(monthly: number): number;
export declare function getAffordabilityLabel(level: number): string;
export declare function getAffordabilityColor(level: number): string;
export declare function calculateMaxMortgage(params: {
grossAnnualIncome: number;
monthlyDebtPayments: number;
propertyTaxMonthly: number;
condoFees: number;
heatCosts: number;
interestRate: number;
amortizationYears: number;
amortizationMonths: number;
affordabilityLevel: number;
rentalIncomeMonthly: number;
includeRentalIncome: boolean;
stressTestRule: string;
condoFeeInclusionRate: number;
rentalIncomeRule: string;
rentalIncomePortion: number;
loanType: string;
compounding: string;
customGdsRatio?: number;
customTdsRatio?: number;
}): MortgageResult;