import { AccountType, StatementMeta, StatementTransaction, StatementUpdateLocalData } from '@zeniai/client-epic-state'; export type StatementParseManualBalanceField = "totalDeposits" | "totalPayments" | "closingBalance"; export interface StatementParseFormTransaction { amount: number; id: string; transactionDate: string; transactionDirection: "debit" | "credit"; transactionMemo: string; statementTransactionId?: string; } export interface StatementParseFormView { closingBalance: number; openingBalance: number; statementEndDate: string; statementStartDate: string; totalDeposits: number; totalPayments: number; transactions: StatementParseFormTransaction[]; } /** Totals derived from in-period transactions (UI + local store; not used in PUT). */ export interface StatementBalancesFromTransactions { closingBalance: number; totalDeposits: number; totalPayments: number; } export type StatementUpdateLocalDataWithTxnBalances = StatementUpdateLocalData & { balancesFromTransactions: StatementBalancesFromTransactions; }; export interface GetStatementParseFormViewInput { originalTransactions: StatementTransaction[]; parsedStatementMeta: StatementMeta | undefined; statementUpdateLocalData: StatementUpdateLocalData | undefined; accountType?: AccountType; } export interface ToStatementUpdateLocalDataFromFormViewInput { formView: StatementParseFormView; originalTransactions: StatementTransaction[]; parsedStatementMeta: StatementMeta | undefined; accountType?: AccountType; changedField?: string; } export interface ApplyStatementParseFormChangeInput { formView: StatementParseFormView; originalTransactions: StatementTransaction[]; parsedStatementMeta: StatementMeta | undefined; accountType?: AccountType; changedField?: string; } export interface ApplyStatementParseFormChangeResult { balancesFromTransactions: StatementBalancesFromTransactions; formView: StatementParseFormView; localData: StatementUpdateLocalDataWithTxnBalances; } export declare const isStatementParseTransactionFieldChange: (changedField: string | undefined) => boolean; export declare const isStatementParseManualBalanceField: (field: string | undefined) => field is StatementParseManualBalanceField; export declare const computeStatementBalancesFromTransactions: (formView: Pick, accountType?: AccountType) => StatementBalancesFromTransactions; export declare const doStatementBalanceAmountsMatch: (statementAmount: number, transactionsAmount: number) => boolean; /** * Main form fields use parse-API statement meta. Transaction-derived totals are * computed separately for additionalInfo / mismatch checks / local store. */ export declare const getStatementParseFormView: ({ accountType, parsedStatementMeta, originalTransactions, statementUpdateLocalData, }: GetStatementParseFormViewInput) => StatementParseFormView & { balancesFromTransactions: StatementBalancesFromTransactions; }; export declare const toStatementUpdateLocalDataFromFormView: ({ accountType, formView, parsedStatementMeta, originalTransactions, }: ToStatementUpdateLocalDataFromFormViewInput) => StatementUpdateLocalDataWithTxnBalances; export declare const applyStatementParseFormChange: ({ accountType, formView, changedField, parsedStatementMeta, originalTransactions, }: ApplyStatementParseFormChangeInput) => ApplyStatementParseFormChangeResult;