import { Beat } from '../core'; /** * Which renderer draws a beat: * - `legacy` — the per-template legacy component (feed, mini, micro) or the legacy caption / embedded * `switch` (transaction row, details drawer). * - `v2` — `BaseLayout` (full, mini) or `CompactInsightCard` (micro, embedded) from `insights_payload`. * - `error` — `InsightErrorCard`: the beat is flagged but its envelope is missing. */ export type InsightRender = 'legacy' | 'v2' | 'error'; /** * The single gate every surface calls. Two facts decide: `beat.is_insights_v2` (written by firefly * when the insight's Insights 2.0 flag is on) and whether the envelope is present. * * | `is_insights_v2` | envelope | result | * | false / absent | any | `legacy` | * | true | non-empty | `v2` | * | true | empty | `error` | * * `error` is never downgraded to `legacy`: a flagged insight's legacy copy fields are filled from the * same V2 copy block, so a failed envelope would otherwise render a plausible legacy-looking card with * no block, no logo and no footer, and the failure would never surface. An absent flag (older firefly, * cortex) renders the legacy path unchanged. * * The gate checks only that `instance_slot` is an object and `description` is present. It does not * look inside the slot: an empty `{}` is a valid envelope and resolves to `v2`, because a beat * whose template has no ditto config names no block, and the card renders its copy and CTAs alone. * So `block` is optional on `InstanceSlot` and a renderer must not dereference it unguarded. * * A payload missing `description` resolves to `error` instead: all three renderers — `BaseLayout`, * `CompactInsightCard` and the micro `InsightCard` — paint `description.html_text` unguarded, so * that one would throw. */ export declare const resolveInsightRender: (beat?: Beat | null) => InsightRender;