import { Querier } from '@platform-modules/db';
import { I as InvoiceProvider, D as DocumentSpec, a as InvoiceDocumentResult, b as InvoiceError } from './port-Cd34h8WD.js';
export { C as CustomerParty, c as DocumentLineItem, d as DocumentTaxTreatment, e as DocumentType, f as InvoiceErrorCode, i as isInvoiceError, t as toInvoiceError } from './port-Cd34h8WD.js';

type IssueBehavior = (credential: unknown, spec: DocumentSpec, callCount: number) => Promise<InvoiceDocumentResult> | InvoiceDocumentResult;
declare class MockInvoiceProvider implements InvoiceProvider {
    #private;
    readonly calls: Array<{
        credential: unknown;
        spec: DocumentSpec;
    }>;
    readonly issueCallCount: {
        current: number;
    };
    constructor(behavior?: IssueBehavior);
    issue(credential: unknown, spec: DocumentSpec): Promise<InvoiceDocumentResult>;
}

type IssueInvoiceResult = {
    ok: true;
    result: InvoiceDocumentResult;
} | {
    ok: false;
    error: InvoiceError;
};
declare function issueInvoice(db: Querier, provider: InvoiceProvider, credential: unknown, spec: DocumentSpec): Promise<IssueInvoiceResult>;

export { DocumentSpec, InvoiceDocumentResult, InvoiceError, InvoiceProvider, type IssueInvoiceResult, MockInvoiceProvider, issueInvoice };
