import { Injector } from 'graphql-modules';
import { Currency } from '../../../shared/enums.js';
import type { LedgerBalanceInfoType, LedgerProto, StrictLedgerProto } from '../../../shared/types/index.js';
import type { IGetChargesByIdsResult } from '../../charges/types.js';
import type { IGetFinancialEntitiesByIdsResult } from '../../financial-entities/types.js';
import type { IGetTransactionsByChargeIdsResult } from '../../transactions/types.js';
import type { IGetLedgerRecordsByChargesIdsResult } from '../types.js';
export declare class LedgerError extends Error {
    constructor(message: string);
}
export declare function isTransactionsOppositeSign([first, second]: IGetTransactionsByChargeIdsResult[]): boolean;
export declare function validateTransactionBasicVariables(transaction: IGetTransactionsByChargeIdsResult): {
    currency: Currency;
    valueDate: Date;
    transactionBusinessId: string;
};
type WithRequired<T, K extends keyof T> = T & {
    [P in K]-?: NonNullable<T[P]>;
};
export type ValidateTransaction = Omit<WithRequired<IGetTransactionsByChargeIdsResult, 'debit_date' | 'business_id' | 'debit_timestamp'>, 'currency'> & {
    currency: Currency;
};
type ValidationOptions = {
    skipBusinessId?: boolean;
};
export declare function validateTransactionRequiredVariables(transaction: IGetTransactionsByChargeIdsResult, validationOptions?: ValidationOptions): ValidateTransaction;
export declare function generatePartialLedgerEntry(transaction: ValidateTransaction, ownerId: string, exchangeRate?: number): Omit<StrictLedgerProto, 'creditAccountID1' | 'debitAccountID1'>;
export declare function updateLedgerBalanceByEntry(entry: LedgerProto, ledgerBalance: Map<string, {
    amount: number;
    entityId: string;
    foreignAmounts?: Partial<Record<Currency, {
        local: number;
        foreign: number;
    }>>;
}>, defaultLocalCurrency: Currency): void;
export declare function getLedgerBalanceInfo(injector: Injector, ledgerBalance: Map<string, {
    amount: number;
    entityId: string;
}>, errors?: Set<string>, allowedUnbalancedBusinesses?: Set<string>, financialEntities?: Array<IGetFinancialEntitiesByIdsResult>): Promise<LedgerBalanceInfoType & {
    financialEntities: Array<IGetFinancialEntitiesByIdsResult>;
}>;
export declare function ledgerProtoToRecordsConverter(records: LedgerProto[]): IGetLedgerRecordsByChargesIdsResult[];
export declare function getFinancialAccountTaxCategoryId(injector: Injector, transaction: IGetTransactionsByChargeIdsResult): Promise<string>;
export declare function multipleForeignCurrenciesBalanceEntries(injector: Injector, defaultLocalCurrency: Currency, documentEntries: LedgerProto[], transactionEntries: LedgerProto[], charge: IGetChargesByIdsResult, foreignAmounts: Partial<Record<Currency, {
    local: number;
    foreign: number;
}>>, balanceAgainstLocal?: boolean): Promise<LedgerProto[]>;
export {};
