export type AnalyticsOutputFormat = 'table' | 'json'; export type AnalyticsProjectSummary = { id: string; name?: string | null; slug?: string | null; }; export type AnalyticsFunnelSummary = { id: string; name?: string | null; slug?: string | null; }; export type AnalyticsOverviewResponse = { generatedAt: string; from: string | null; to: string | null; currency: string | null; funnels: AnalyticsFunnelSummary[]; totals: Record; byDay: Array<{ date: string; visitors: number; subscriptions: number; chargedRevenueMinor: number; }>; }; export type AnalyticsFunnelFlow = { steps: Array<{ stepId: string; stepName: string | null; stepPath: string | null; stepTitle: string | null; stepType: string | null; stepKind: string | null; stepOrder: number; }>; experiments: unknown[]; branches: unknown[]; }; export type PublishedFunnelFlowResponse = { funnelId: string; publishedVersionId: string | null; status: 'ready' | 'syncing' | 'unpublished'; flow: AnalyticsFunnelFlow | null; updatedAt: string | null; }; export type AnalyticsStepDropoffResponse = { generatedAt: string; from: string | null; to: string | null; funnel: { id: string; name: string; slug: string; }; version: { selected: { id: string; seq: number; message: string | null; publishedAt: string | null; isCurrent: boolean; } | null; options: Array<{ id: string; seq: number; message: string | null; publishedAt: string | null; isCurrent: boolean; }>; }; totals: Record; metrics: Array<{ id: string; label: string; numerator: number; denominator: number; rate: number; numeratorLabel: string; denominatorLabel: string; description: string; chartPoints: unknown[]; }>; steps: AnalyticsStepTransition[]; flow: AnalyticsFunnelFlow | null; }; export type AnalyticsStepTransition = { stepId: string; stepName: string | null; stepOrder: number; entrants: number; completions: number; advancedToNextStep: number; dropoffs: number; dropoffRate: number; nextStepId: string | null; nextStepName: string | null; }; export type MarketingCohortPerformanceRow = { id: string; cohortDate: string; funnelUrl: string; mediaSource: string; spend: number; spendCurrency: string | null; subscribers: number; subscribersAlive: number; subscribersAlivePercent: number | null; revenue: number; revenueDay3: number; revenueDay90: number; revenueDay180: number; revenueCurrency: string | null; revenueCurrencySafe: boolean; providerFee?: number; providerFeeCurrency?: string | null; providerFeeCurrencySafe?: boolean; rdrAlertFee?: number; predictedNetRevenueDay3Minor: number | null; predictedNetRevenueDay3Currency: string | null; predictedNetRevenueDay90Minor: number | null; predictedNetRevenueDay90Currency: string | null; predictedNetRevenueDay180Minor: number | null; predictedNetRevenueDay180Currency: string | null; predictedNetRevenueDay365Minor: number | null; predictedNetRevenueDay365Currency: string | null; pLtvCurrency: string | null; pLtv: number | null; pLtvPredictedNetRevenueDay365Minor: number | null; pLtvPredictedCustomerCount: number; campaign: string; channel: string; country: string; children?: MarketingCohortPerformanceRow[]; segments?: MarketingCohortPerformanceRow[]; }; export type MarketingCohortPerformanceReport = { generatedAt: string; from: string | null; to: string | null; rows: MarketingCohortPerformanceRow[]; sourceHealth?: { complete: boolean; warnings: string[]; }; }; export type ParsedAnalyticsDate = { date: string; fromIso: string; toIso: string; }; type ReportContext = { date: string; workspaceId: string; project: AnalyticsProjectSummary; }; export declare const parseAnalyticsDate: (value: string) => ParsedAnalyticsDate; export declare const normalizeAnalyticsOutputFormat: (value: string | undefined) => AnalyticsOutputFormat; export declare const assertHasConversionData: (date: string, overview: AnalyticsOverviewResponse, stepDropoff: AnalyticsStepDropoffResponse) => void; export declare const assertHasTransitionData: (date: string, stepDropoff: AnalyticsStepDropoffResponse) => void; export declare const assertHasFunnelPathData: (date: string, stepDropoff: AnalyticsStepDropoffResponse, publishedFunnelFlow: PublishedFunnelFlowResponse) => void; export declare const assertHasCohortData: (date: string, report: MarketingCohortPerformanceReport) => void; export declare const buildTransitionRows: (stepDropoff: AnalyticsStepDropoffResponse) => { stepId: string; step: string; nextStep: string; entrants: number; advancedToNextStep: number; dropoffs: number; dropoffRate: number; }[]; export declare const buildFunnelPathRows: (stepDropoff: AnalyticsStepDropoffResponse, publishedFunnelFlow: PublishedFunnelFlowResponse) => { stepId: string; path: string; label: string; users: number; advancedToNextStep: number; conversionToNextStep: number; dropoffs: number; dropoffRate: number; }[]; export declare const buildConversionReportPayload: (input: ReportContext & { overview: AnalyticsOverviewResponse; stepDropoff: AnalyticsStepDropoffResponse; publishedFunnelFlow: PublishedFunnelFlowResponse; }) => { generatedAt: string; date: string; workspaceId: string; project: AnalyticsProjectSummary; funnel: { id: string; name: string; slug: string; }; overview: AnalyticsOverviewResponse; totals: Record; metrics: { id: string; label: string; numerator: number; denominator: number; rate: number; numeratorLabel: string; denominatorLabel: string; description: string; chartPoints: unknown[]; }[]; funnelPath: { stepId: string; path: string; label: string; users: number; advancedToNextStep: number; conversionToNextStep: number; dropoffs: number; dropoffRate: number; }[]; transitions: { stepId: string; step: string; nextStep: string; entrants: number; advancedToNextStep: number; dropoffs: number; dropoffRate: number; }[]; }; export declare const buildFunnelPathReportPayload: (input: ReportContext & { stepDropoff: AnalyticsStepDropoffResponse; publishedFunnelFlow: PublishedFunnelFlowResponse; }) => { generatedAt: string; date: string; workspaceId: string; project: AnalyticsProjectSummary; funnel: { id: string; name: string; slug: string; }; funnelPath: { stepId: string; path: string; label: string; users: number; advancedToNextStep: number; conversionToNextStep: number; dropoffs: number; dropoffRate: number; }[]; }; export declare const buildTransitionReportPayload: (input: ReportContext & { stepDropoff: AnalyticsStepDropoffResponse; }) => { generatedAt: string; date: string; workspaceId: string; project: AnalyticsProjectSummary; funnel: { id: string; name: string; slug: string; }; transitions: { stepId: string; step: string; nextStep: string; entrants: number; advancedToNextStep: number; dropoffs: number; dropoffRate: number; }[]; }; export declare const buildCohortReportPayload: (input: ReportContext & { cohort: MarketingCohortPerformanceReport; }) => { generatedAt: string; date: string; workspaceId: string; project: AnalyticsProjectSummary; cohort: MarketingCohortPerformanceReport; sourceHealth: { complete: boolean; warnings: string[]; } | null; }; export declare const formatAnalyticsJson: (payload: unknown) => string; export declare const formatTransitionsTable: (input: { date: string; stepDropoff: AnalyticsStepDropoffResponse; }) => string; export declare const formatFunnelPathTable: (input: { date: string; stepDropoff: AnalyticsStepDropoffResponse; publishedFunnelFlow: PublishedFunnelFlowResponse; }) => string; export declare const formatConversionsTable: (input: { date: string; overview: AnalyticsOverviewResponse; stepDropoff: AnalyticsStepDropoffResponse; publishedFunnelFlow: PublishedFunnelFlowResponse; }) => string; export declare const formatCohortTable: (input: { date: string; cohort: MarketingCohortPerformanceReport; }) => string; export {};