UNPKG

@mazaventures/valentine

Version:

Toolkit for Venture Capital firms to run their back office efficiently and openly

96 lines 3.13 kB
import { NAVCalculation, ValuationMethodSchema } from '../models/types'; /** * Service for managing Net Asset Value (NAV) calculations. * Handles fund valuations, company holdings, and historical NAV tracking. * * @example * ```typescript * const nav = new NAVService(); * * // Calculate fund NAV * const calculation = await nav.calculateNAV({ * fundId: "fund-1", * date: new Date(), * holdings: [{ * companyId: "company-1", * value: 1000000, * method: "LAST_ROUND" * }], * currency: "USD" * }); * ``` */ export declare class NAVService { private calculations; /** * Initializes a new instance of the NAVService class. */ constructor(); /** * Calculates the Net Asset Value (NAV) for a fund. * * @param params - NAV calculation parameters * @param params.fundId - ID of the fund * @param params.date - Date of the calculation * @param params.holdings - Array of company holdings with their valuations * @param params.currency - Currency of the calculation * @returns NAV calculation result * @throws {Error} If validation fails */ calculateNAV(params: { fundId: string; date: Date; holdings: Array<{ companyId: string; value: number; method: typeof ValuationMethodSchema._type; notes?: string; }>; currency: string; }): Promise<NAVCalculation>; /** * Retrieves a specific NAV calculation by ID. * * @param id - Calculation ID * @returns NAV calculation or undefined if not found */ getCalculation(id: string): Promise<NAVCalculation | undefined>; /** * Lists all NAV calculations for a fund, sorted by date (newest first). * * @param fundId - Fund ID to list calculations for * @returns Array of NAV calculations */ listCalculations(fundId: string): Promise<NAVCalculation[]>; /** * Gets the most recent NAV calculation for a fund. * * @param fundId - Fund ID * @returns Latest NAV calculation or undefined if none exists */ getLatestNAV(fundId: string): Promise<NAVCalculation | undefined>; /** * Retrieves historical NAV calculations within a date range. * * @param fundId - Fund ID * @param startDate - Start date of the range * @param endDate - End date of the range * @returns Array of NAV calculations within the date range */ getHistoricalNAV(fundId: string, startDate: Date, endDate: Date): Promise<NAVCalculation[]>; /** * Gets the latest valuation for a specific company. * * @param companyId - Company ID to get valuation for * @param date - Optional date to get valuation at or before * @returns Company valuation details or undefined if not found */ getCompanyValuation(companyId: string, date?: Date): Promise<{ value: number; currency: string; method: typeof ValuationMethodSchema._type; calculationId: string; date: Date; } | undefined>; } //# sourceMappingURL=nav.d.ts.map