import { AlertProps } from '@mui/material'; import { RepeatingTransactionsApi } from '../api'; import { Recurrence, RecurringCopy, RepeatingTransaction, Transaction, DateRange } from '../types'; import { GlobalStore } from './GlobalStore'; interface RecurringAlertProps { message: string; severity: AlertProps['severity']; } export declare class RecurringTransactionsStore { globalStore: GlobalStore; api: RepeatingTransactionsApi; repeatingTransactions: RepeatingTransaction[]; isDataLoaded: boolean; selectedDay: Date | undefined; dateRange: DateRange; selectedRepeatingTransactionGuid: string | null; selectedRecurrence: Recurrence | null; alert: RecurringAlertProps; constructor(globalStore: GlobalStore); get copy(): RecurringCopy; get detailedRepeatingTransactions(): RepeatingTransaction[]; /** * Returns all recurrences built from repeating transactions and filtered by * accounts, scoped to the supplied date range. This is the range-parameterized * core used by both the shared getters (which pass this.dateRange) and by * consumers such as Cash Flow that need their own independent window without * mutating the shared dateRange. */ recurrencesForRange: (dateRange: DateRange) => Recurrence[]; /** * Returns the upcoming expense recurrences scoped to the supplied date range. */ upcomingExpensesForRange: (dateRange: DateRange) => Recurrence[]; /** * Returns the income recurrences scoped to the supplied date range. */ incomeForRange: (dateRange: DateRange) => Recurrence[]; /** * Returns the upcoming income recurrences scoped to the supplied date range. */ upcomingIncomeForRange: (dateRange: DateRange) => Recurrence[]; /** * Returns the next upcoming income recurrence scoped to the supplied range. */ nextIncomeForRange: (dateRange: DateRange) => Recurrence | undefined; /** * Returns all recurrences built from repeating transactions and filtered by accounts. */ get recurrences(): Recurrence[]; /** * Returns all recurrences that have occurred in the past, including those that are paid or missed */ get pastRecurrences(): Recurrence[]; /** * Returns all recurrences that are expected to occur through the end of the month * or should have occurred in the last 3 days. */ get upcomingRecurrences(): Recurrence[]; /** * Returns all expense recurrences. */ get expenses(): Recurrence[]; /** * Returns the upcoming expense recurrences. */ get upcomingExpenses(): Recurrence[]; /** * Returns all income recurrences. */ get income(): Recurrence[]; /** * Returns the upcoming income recurrences. */ get upcomingIncome(): Recurrence[]; get nextIncomeRecurrence(): Recurrence | undefined; /** * Returns the expense recurrences for the current month. */ get currentMonthExpenses(): Recurrence[]; /** * Returns the income recurrences for the current month. */ get currentMonthIncome(): Recurrence[]; /** * Calculates the total amount of all expenses for the current month. */ get expenseTotal(): number; /** * Calculates the total amount of all paid expenses for the current month. */ get paidExpenseTotal(): number; /** * Calculates the total amount of all missed expenses for the current month. */ get missedExpenseTotal(): number; /** * Calculates the total amount of all upcoming expenses for the current month. */ get upcomingExpenseTotal(): number; /** * Calculates the total amount of all income for the current month. */ get incomeTotal(): number; /** * Calculates the total amount of all paid income for the current month. */ get paidIncomeTotal(): number; /** * Calculates the total amount of all upcoming income for the current month. */ get upcomingIncomeTotal(): number; /** * Get the recurrences for the currently selected day. */ get selectedDayRecurrences(): Recurrence[] | undefined; get selectedRepeatingTransaction(): RepeatingTransaction | undefined; setSelectedRepeatingTransactionGuid: (guid: string | null) => string | null; setSelectedRecurrence: (recurrence: Recurrence | null) => Recurrence | null; setRepeatingTransactions: (repeating: RepeatingTransaction[]) => void; /** * Set the date range for filtering recurrences. * @param dateRange - The date range to set. */ setDateRange: (dateRange: DateRange) => DateRange; /** * Set the currently selected day. * @param day - The day to select. */ setSelectedDay: (day: Date) => void; loadRepeatingTransactionData: () => Promise; /** * Load repeating transactions and augment them with additional data. */ loadRepeatingTransactions: () => Promise; /** * Add a new repeating transaction and link it to the associated transaction. * @param repeatingTransaction - The repeating transaction to add. * @param transaction - The transaction associated with the repeating transaction. */ addRepeatingTransaction: (repeatingTransaction: RepeatingTransaction, transaction: Transaction) => Promise; /** * Delete a repeating transaction by its GUID. * @param guid - The GUID of the repeating transaction to delete. */ deleteRepeatingTransaction: (guid: string) => Promise; /** * Update an existing repeating transaction. * @param transaction - The repeating transaction to update. */ updateRepeatingTransaction: (transaction: RepeatingTransaction) => Promise; /** * Mark a recurrence as paid by linking a transaction to the repeating transaction. * @param repeatingTransactionGuid - The GUID of the repeating transaction. * @param transaction - The transaction to link. */ markRecurrenceAsPaid: (repeatingTransactionGuid: string, transaction: Transaction) => Promise; /** * Mark a recurrence as unpaid by unlinking the associated transaction from the repeating transaction. * @param transaction - The transaction to unlink. */ markRecurrenceAsUnpaid: (transaction: Transaction) => Promise; setAlert: (message: string, severity?: RecurringAlertProps["severity"]) => { message: string; severity: import('@mui/types').OverridableStringUnion | undefined; }; } export {};