import { GlobalStore } from './GlobalStore'; export type ActionDrawerTrigger = 'primaryCta' | 'secondaryCta' | 'chartBar'; export interface ActionDrawerState { isDrawerOpen: boolean; trigger: ActionDrawerTrigger; guid: string; /** * Block-specific drilldown data for the current drawer SESSION, opaque to the * store. Each action block defines and reads its own shape (via * useActionContext()). Chart drilldowns put `{ chartBarIndex, tabIndex }` * here; CTAs carry none. * * This is an accumulating bag, not a single owner's value: a nested drawer * (e.g. TransactionDetailsBlock opened from a row inside TransactionHistory * Block) adds its own key via `setActionContext` ON TOP of whatever the outer * drawer already put here, so the outer block's own context survives while the * nested block is open. It resets to a clean slate only when a NEW drawer * session starts (`openActionDrawer`/`openCtaDrawer`, which fully replace the * envelope) — not on every `setActionContext` call. */ context: unknown; } export declare const CLOSED_ACTION_DRAWER: ActionDrawerState; interface OpenActionDrawerArgs { guid: string; trigger: ActionDrawerTrigger; context?: unknown; } /** * UI state shared across the insights-v2 widget tree. Owns the action drawer so * cards, charts, and action blocks coordinate through the store instead of prop * drilling. The drawer state is a fixed envelope (isDrawerOpen/guid/trigger) plus * an opaque `context` bag, so per-block drilldown data never leaks into this shape. */ export declare class InsightsV2Store { globalStore: GlobalStore; actionDrawer: ActionDrawerState; constructor(globalStore: GlobalStore); /** * Merges keys into the current drawer session's context bag — it does NOT * replace it. A nested drawer (e.g. a row click inside TransactionHistoryBlock * opening TransactionDetailsBlock) calls this to layer its own key (e.g. * `transaction_guid`) on top of whatever context the outer drawer already set * (e.g. `chartBarIndex`), so the outer block keeps reading its own keys via * useActionContext while the nested block is open. The bag only returns to a * clean slate when a new drawer session starts via `openActionDrawer`/ * `openCtaDrawer`, which fully replace the envelope. */ setActionContext: (context: Record) => void; /** * Generic drawer opener — the only opener a new action block needs. Pass the * beat guid, the CTA/source that triggered it, and (optionally) a block-specific * context object the block reads back via useActionContext. */ openActionDrawer: ({ guid, trigger, context }: OpenActionDrawerArgs) => void; /** Convenience opener for CTA drawers (no drilldown context). */ openCtaDrawer: (guid: string, trigger: "primaryCta" | "secondaryCta") => void; closeActionDrawer: () => void; } export {};