import { ReactNode } from 'react'; import { Theme } from '@mui/material/styles'; import { Beat, InsightsFeedCopy, Subtitle, Transaction } from '../../../core'; import { TransactionFilter } from '../../../core/stores/TransactionStore'; import { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'; import { ChartDataSeriesItem } from '../../blocks/ChartBlocks/BarchartBlock/utils'; import { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'; export interface DrillDownHeader { heading?: string; subHeadingText?: string; icon?: ReactNode; } export interface DrillDownHeaderContext { title?: string; subHeader?: Subtitle; categoryName: string; selectedDate?: string | Date; } export declare const DRILLDOWN_VARIANTS: { readonly TRANSACTION: "bill_amount_not_standard"; readonly CATEGORY_SPEND: "category_spend"; readonly MONTHLY_SPEND: "monthly_spend_comparison"; readonly ACCOUNT_BALANCE: "savings_account_balances_summary"; readonly UPCOMING_BILL: "upcoming_bill"; readonly SPEND_TO_INCOME: "monthly_spend_to_income"; readonly SAVINGS_TO_INCOME: "monthly_savings_to_income"; readonly DEBT_TO_INCOME: "monthly_debt_to_income"; readonly COST_OF_LIVING: "cost_living_to_income"; readonly NON_ESSENTIAL_CATEGORY: "non_essential_category_summary"; readonly DEPOSIT_SUMMARY: "monthly_deposit_summary"; }; export type DrillDownVariant = (typeof DRILLDOWN_VARIANTS)[keyof typeof DRILLDOWN_VARIANTS]; /** * One row of the flattened data_series a filterStrategy indexes into: a single-bar monthly total or a * synthesized upcoming-bill bar. Fields are optional because the backend keys each row dynamically * from data_series.names and not every variant carries a guid/category. Double-bar comparison rows * will extend this in the next MR. */ export type ColorKind = (theme: Theme, categoryGuid?: string) => string[]; export type HeaderKind = (ctx: DrillDownHeaderContext) => DrillDownHeader; /** * Everything a filterStrategy needs to turn the currently-selected bar/sub-tab into a * TransactionFilter. Data-only so strategies stay pure and testable. */ export interface FilterContext { beat: Beat; beatTransactions: Transaction[]; dataSeries: ChartDataSeriesItem[]; selectedIndex: number; subIndex: number; isLastTab: boolean; instanceSlotData: InsightsInstanceSlotData; spendCategoryGuids: string[]; displayedDateRange: { start: Date; end: Date; }; } export type FilterStrategy = (ctx: FilterContext) => TransactionFilter; export interface DrillDownVariantConfig { top: 'singleBar' | 'upcomingBill' | 'doubleBar' | 'tabsOnly'; filterStrategy: FilterStrategy; colors: ColorKind; header?: HeaderKind; tipSection?: (setCloseTipSection: (flag: boolean) => void, copy: InsightsFeedCopy, merchantName?: string) => TipSectionProps; scope: 'store' | 'beat'; filterMode: 'store' | 'local'; } export declare const layout: Partial>; export declare const FALLBACK: DrillDownVariantConfig;