export type ApplyResult = { accepted: true; outstandingAfter: number; } | { accepted: false; reason: 'over-application'; remaining: number; }; /** * outstanding = totalPaymentDue - sum(payments) - sum(credits). * * A credit reduces what is owed exactly as a payment does; the two differ in * provenance, not arithmetic, which is why they are summed together here. */ export declare function computeOutstanding(totalPaymentDue: number, payments: readonly number[], credits: readonly number[]): number; /** * Validates one candidate payment or credit against what is still outstanding. * * Never clamps. A candidate that would take applied-to-date above the invoice * total is rejected outright and the caller reports it, rather than silently * recording a figure that does not reconcile. A non-positive candidate is * rejected for the same reason: it is not a payment. */ export declare function applyPayment(totalPaymentDue: number, payments: readonly number[], credits: readonly number[], candidate: number): ApplyResult; //# sourceMappingURL=balance.d.ts.map