import { FetchStateAndError, ID } from '../../../commonStateTypes/common'; import { InvoicingInvoiceKPIs } from '../../../entity/invoicing/invoice/invoiceState'; import { InvoicingListCounts } from '../../../entity/invoicing/invoicingCommonPayload'; import { InvoicingListSort } from '../invoicingApiHelper'; export declare const ALL_INVOICING_INVOICE_TAB_IDS: readonly ["all", "paid", "partially_paid", "payment_due", "not_paid", "voided"]; export declare const toInvoicingInvoiceTabId: (v: string) => "paid" | "voided" | "partially_paid" | "payment_due" | "not_paid" | "all"; export type InvoicingInvoiceTabId = ReturnType; /** Filters that drive the invoice list query (mirrors the Invoices hooks). */ export interface InvoiceListFilters { customerId?: ID; dateFrom?: string; dateTo?: string; search?: string; subscriptionId?: ID; } /** * Per-tab cache slice. Each status tab is a separate server query (the backend * filters by `status`), so its loaded ids, pagination cursor and fetch state are * cached independently. Mirrors the transaction-list per-tab cache pattern. */ export interface InvoiceTabState extends FetchStateAndError { invoiceIds: ID[]; nextCursor: string | null; } export interface InvoiceListState { /** Selected status tab (CES-owned so it persists across page revisits). */ activeTab: InvoicingInvoiceTabId; /** Tab-independent list counts. */ counts: InvoicingListCounts; countsFetchState: FetchStateAndError; /** Base query shared across tabs (search / customer / subscription / dates). */ filters: InvoiceListFilters; /** Per-tab cached invoice ids + cursor + fetch state. */ /** * Per-tab cache. `Partial` because the tab set comes from `/1.0/config`: a * status the backend added that this build's tab-id union does not know still * renders a tab, and its cache entry is created on first use rather than * pre-seeded. Readers must default a missing entry. */ invoiceByTab: Partial>; kpisFetchState: FetchStateAndError; /** Tab-independent money KPIs. */ kpis?: InvoicingInvoiceKPIs; /** Active server-side sort (undefined = backend default order). */ sort?: InvoicingListSort; } export declare const makeInvoiceTabState: () => InvoiceTabState; /** * The cache entry for a tab, created on first use. The tab set is config-driven, * so a status this build's union does not know still needs somewhere to cache. */ export declare const invoiceTabStateFor: (invoiceByTab: Partial>, tabId: InvoicingInvoiceTabId) => InvoiceTabState; export declare const makeInvoiceByTab: () => Partial>;