/** * Token response with expiry information */ export interface TokenResponse { /** The session token */ token: string; /** ISO timestamp when token expires */ expiresAt: string; } /** * Theme configuration for customizing component appearance */ export interface WeavableTheme { /** Primary color for interactive elements */ primaryColor?: string; /** Primary text color */ textColor?: string; /** Secondary text color */ textSecondary?: string; /** Error color */ errorColor?: string; /** Skeleton loading background color */ skeletonBg?: string; /** Skeleton loading shimmer color */ skeletonShimmer?: string; /** Extra small spacing */ spacingXs?: string; /** Small spacing */ spacingSm?: string; /** Medium spacing */ spacingMd?: string; /** Large spacing */ spacingLg?: string; /** Section background color */ sectionBgColor?: string; /** Section padding */ sectionPadding?: string; /** Section border radius */ sectionBorderRadius?: string; /** Section border width */ sectionBorderWidth?: string; /** Section border color */ sectionBorderColor?: string; /** Section box shadow */ sectionShadow?: string; /** Section spacing (gap between cards) */ sectionSpacing?: string; /** Card spacing (gap between cards in section) */ cardSpacing?: string; /** Card background color */ cardBgColor?: string; /** Card border color */ cardBorderColor?: string; /** Card border width */ cardBorderWidth?: string; /** Card border radius */ cardBorderRadius?: string; /** Card box shadow */ cardShadow?: string; /** Card box shadow on hover */ cardShadowHover?: string; /** Card content padding */ cardPadding?: string; /** Card text color */ cardTextColor?: string; /** Card text font size */ cardTextSize?: string; /** Card text font weight */ cardTextWeight?: string; /** Card heading color */ cardHeadingColor?: string; /** Card heading font weight */ cardHeadingWeight?: string; /** Card heading text transform (e.g., 'uppercase', 'lowercase', 'capitalize', 'none') */ cardHeadingTextTransform?: string; /** Card heading letter spacing */ cardHeadingLetterSpacing?: string; /** Card heading font family */ cardHeadingFont?: string; /** Card text font family */ cardTextFont?: string; /** Card h1 font size */ cardH1Size?: string; /** Card h2 font size */ cardH2Size?: string; /** Card h3 font size */ cardH3Size?: string; /** Card h4 font size */ cardH4Size?: string; /** Card h5 font size */ cardH5Size?: string; /** Card h6 font size */ cardH6Size?: string; /** Analytics trend indicator color for positive sentiment (default: #2E7D32) */ analyticsTrendPositiveColor?: string; /** Analytics trend indicator color for negative sentiment (default: #C62828) */ analyticsTrendNegativeColor?: string; /** Analytics trend indicator color for neutral sentiment (default: #6b7280) */ analyticsTrendNeutralColor?: string; /** Analytics sparkline chart color (default: #3b82f6) */ analyticsSparklineColor?: string; /** Analytics metric card title font size (default: 12px) */ analyticsTitleSize?: string; /** Analytics metric card title font weight (default: 600) */ analyticsTitleWeight?: string; /** Analytics metric card title font family */ analyticsTitleFont?: string; /** Analytics metric card primary value font size (default: 22px) */ analyticsValueSize?: string; /** Analytics metric card primary value font weight (default: 700) */ analyticsValueWeight?: string; /** Analytics metric card primary value font family */ analyticsValueFont?: string; /** Analytics metric card supporting text font size (default: 14px) */ analyticsSupportingTextSize?: string; /** Analytics metric card supporting text font family */ analyticsSupportingTextFont?: string; /** Analytics sparkline labels font size (default: 12px) */ analyticsSparklineLabelSize?: string; /** Analytics sparkline labels font family */ analyticsSparklineLabelFont?: string; /** Analytics trend badge font size (default: 14px) */ analyticsTrendSize?: string; /** Analytics trend badge font weight (default: 500) */ analyticsTrendWeight?: string; /** Analytics trend badge font family */ analyticsTrendFont?: string; /** Analytics trend arrow font size (default: 10px) */ analyticsTrendArrowSize?: string; /** Number of columns in horizontal layout (default: 4) */ analyticsColumns?: string; } /** * Configuration for the Weavable provider */ export interface WeavableProviderProps { /** Base URL for the Weavable REST API (required) */ baseUrl: string; /** Connection ID to use for fetching data (required) */ connectionId: string; /** Function to fetch API token with expiry information */ getToken: () => Promise | TokenResponse; /** Optional error callback for logging/monitoring */ onError?: (error: Error) => void; /** Child components */ children: React.ReactNode; /** Optional theme configuration for customizing appearance */ theme?: Partial; /** Optional inline styles (can include CSS variables for customization) */ style?: React.CSSProperties; } /** * Props for WeavableContext component */ export interface WeavableContextProps { /** Optional className for custom styling */ className?: string; /** Optional message to display when no summaries are available */ noSummariesMessage?: string; /** Optional callback fired when summaries are successfully loaded */ onSummariesLoaded?: (params: { fromDate: Date; toDate: Date; }) => void; /** Optional theme overrides scoped to this component (overrides provider-level theme) */ theme?: Partial; } /** * Summary format options from API */ export declare enum SummaryFormat { Markdown = "markdown", Html = "html" } /** * Preset configuration from API */ export interface Preset { /** Unique preset identifier */ id: string; /** Human-readable display name */ displayName: string; /** Whether this preset is enabled */ enabled: boolean; } /** * Config response from GET /rest/config */ export interface Config { /** List of available presets */ presets: Preset[]; /** Default number of days to look back */ defaultDaysBack: number; } /** * Context response from GET /rest/context */ export interface ContextResponse { /** Unique context ID */ id: string; /** ISO date when context was created */ createdDateIso: string; } /** * Summary response from GET /rest/summary */ export interface SummaryResponse { /** The generated summary (null if no data) */ summary: string | null; /** Format of the summary */ format: SummaryFormat; /** Preset ID used for this summary */ preset: string; } /** * Error response from API */ export interface ApiErrorResponse { /** Error message */ error: string; /** Optional error details */ details?: Array<{ message: unknown; }>; } /** * Internal auth context state */ export interface WeavableAuthContext { /** Base URL for API requests */ baseUrl: string; /** Connection ID */ connectionId: string; /** Function to get current auth token (returns cached if valid) */ getToken: () => Promise; /** Error callback */ onError?: (error: Error) => void; } /** * Summary data with metadata */ export interface SummaryData { /** Preset configuration */ preset: Preset; /** Summary content (HTML or Markdown) */ content: string | null; /** Summary format */ format: SummaryFormat; /** Loading state */ loading: boolean; /** Error if fetch failed */ error: Error | null; } export * from './visualization';