import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common'; import type { InvoicingFieldHelpByCode, InvoicingFieldHelpGroup } from '../../../entity/invoicing/invoicingCommonPayload'; import { RootState } from '../../../rootStateTypes'; import { InvoicingOnboardingStatus } from './invoicingConfigViewPayload'; import { InvoicingConfigViewState } from './invoicingConfigViewState'; /** * The whole config state plus what only the view layer needs: the derived * onboarding `status` and the shorter names consumers use for the two action * fetch states. Extending the state means every field the config API grows * reaches consumers without touching this selector; the two internal * `*FetchState` fields and the state's own validity predicate are omitted so * each piece of data has exactly one public name. */ export interface InvoicingConfigView extends Omit { acceptTermsState: FetchStateAndError; enableState: FetchStateAndError; status?: InvoicingOnboardingStatus; } export declare const getInvoicingConfigView: (state: RootState) => InvoicingConfigView; /** * The onboarding/route gate's slice of the config: whether invoicing is routed to * the promo, the settings step or the live module, plus the two action fetch * states those surfaces render against. * * Exists so the drawers, the invoicing route gate and the promo screen have a * concern-scoped view to read instead of reaching into * {@link getInvoicingConfigView} — they are nav and routing, not pages, so there * is no page-level view for them to use. The whole config shape stays out of * their props either way. */ export interface InvoicingOnboardingGateView { acceptTermsState: FetchStateAndError; enableState: FetchStateAndError; fetchState: FetchState; isQboConnected: boolean; status?: InvoicingOnboardingStatus; } export declare const getInvoicingOnboardingGateView: (state: RootState) => InvoicingOnboardingGateView; /** * One group's help copy, keyed by field code. Composed by the page-level view * selectors rather than exported to the UI: a screen receives the slice for its * own group, so no screen needs the config shape. Empty when the backend has * not populated the group, which the UI reads as "render no icon". */ export declare const invoicingFieldHelpForGroup: (state: RootState, group: InvoicingFieldHelpGroup) => InvoicingFieldHelpByCode;