open-nav
    Preparing search index...

    Interface DownloadOptions

    interface DownloadOptions {
        dateFrom: string;
        dateTo: string;
        delayMs?: number;
        direction?: InvoiceDirectionType;
        onProgress?: (progress: DownloadProgress) => void;
        sleep?: (ms: number) => Promise<void>;
    }
    Index
    dateFrom: string

    First issue date, inclusive, as yyyy-mm-dd.

    dateTo: string

    Last issue date, inclusive, as yyyy-mm-dd.

    delayMs?: number

    Pause between requests, in milliseconds. Defaults to 250.

    NAV rate limits per taxpayer, and a download makes one request per invoice. Pacing is cheaper than being throttled.

    direction?: InvoiceDirectionType

    INBOUND for invoices issued to you, OUTBOUND for your own.

    onProgress?: (progress: DownloadProgress) => void

    Called before each invoice is fetched, for progress reporting.

    sleep?: (ms: number) => Promise<void>

    Injectable sleep, for tests.