import { default as React } from 'react';

export interface DataSource {
    id: string;
    name: string;
    type: DataSourceType;
    config: DataSourceConfig;
    refreshInterval?: number;
    lastFetched?: string;
    status: 'idle' | 'loading' | 'success' | 'error';
    error?: string;
}
export type DataSourceType = 'rest-api' | 'graphql' | 'websocket' | 'json-file' | 'csv-file' | 'database' | 'mock';
export type DataSourceConfig = RestApiConfig | GraphQLConfig | WebSocketConfig | FileConfig | DatabaseConfig | MockConfig;
export interface RestApiConfig {
    type: 'rest-api';
    url: string;
    method?: 'GET' | 'POST' | 'PUT';
    headers?: Record<string, string>;
    body?: unknown;
    transform?: string;
    authentication?: AuthConfig;
}
export interface GraphQLConfig {
    type: 'graphql';
    endpoint: string;
    query: string;
    variables?: Record<string, unknown>;
    headers?: Record<string, string>;
    transform?: string;
    authentication?: AuthConfig;
}
export interface WebSocketConfig {
    type: 'websocket';
    url: string;
    protocols?: string[];
    initialMessage?: string;
    messageFilter?: string;
    transform?: string;
}
export interface FileConfig {
    type: 'json-file' | 'csv-file';
    path: string;
    encoding?: string;
    csvDelimiter?: string;
    csvHeaders?: boolean;
}
export interface DatabaseConfig {
    type: 'database';
    connectionString: string;
    query: string;
    parameters?: Record<string, unknown>;
}
export interface MockConfig {
    type: 'mock';
    data: unknown;
    delay?: number;
    randomize?: boolean;
}
export interface AuthConfig {
    type: 'basic' | 'bearer' | 'api-key' | 'oauth2';
    credentials?: {
        username?: string;
        password?: string;
        token?: string;
        apiKey?: string;
        apiKeyHeader?: string;
        clientId?: string;
        clientSecret?: string;
        tokenUrl?: string;
    };
}
export interface DataBinding {
    id: string;
    elementId: string;
    sourceId: string;
    path: string;
    formatter?: DataFormatter;
    fallback?: unknown;
}
export interface DataFormatter {
    type: 'number' | 'currency' | 'percent' | 'date' | 'custom';
    options?: FormatOptions;
    customFormat?: string;
}
export interface FormatOptions {
    locale?: string;
    currency?: string;
    minimumFractionDigits?: number;
    maximumFractionDigits?: number;
    dateStyle?: 'full' | 'long' | 'medium' | 'short';
    timeStyle?: 'full' | 'long' | 'medium' | 'short';
    notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
    prefix?: string;
    suffix?: string;
}
export interface KPIWidgetConfig {
    title: string;
    metric: string;
    previousMetric?: string;
    format?: DataFormatter;
    icon?: string;
    colorThresholds?: {
        good: number;
        warning: number;
        critical: number;
    };
    invertColors?: boolean;
    sparklineData?: string;
}
export interface LiveChartConfig {
    title?: string;
    chartType: 'line' | 'bar' | 'area' | 'pie' | 'doughnut' | 'radar' | 'scatter';
    dataPath: string;
    labelPath?: string;
    seriesConfig?: Array<{
        name: string;
        valuePath: string;
        color?: string;
    }>;
    options?: {
        stacked?: boolean;
        legend?: boolean;
        animation?: boolean;
        realtime?: boolean;
        maxPoints?: number;
    };
}
export interface LiveTableConfig {
    dataPath: string;
    columns: Array<{
        key: string;
        header: string;
        width?: number;
        align?: 'left' | 'center' | 'right';
        format?: DataFormatter;
        sortable?: boolean;
        filterable?: boolean;
    }>;
    pagination?: {
        enabled: boolean;
        pageSize: number;
    };
    search?: boolean;
    sortBy?: string;
    sortOrder?: 'asc' | 'desc';
}
export interface LiveCountdownConfig {
    targetDate: string | {
        binding: string;
    };
    format?: 'days' | 'hours' | 'full' | 'compact';
    labels?: {
        days?: string;
        hours?: string;
        minutes?: string;
        seconds?: string;
    };
    onComplete?: 'hide' | 'showMessage' | 'loop';
    completeMessage?: string;
}
export interface LiveProgressConfig {
    valuePath: string;
    maxPath?: string;
    max?: number;
    showValue?: boolean;
    showPercent?: boolean;
    format?: DataFormatter;
    color?: string;
    trackColor?: string;
    type?: 'bar' | 'circle' | 'semicircle';
}
export declare function fetchDataSource(source: DataSource): Promise<unknown>;
export declare function subscribeWebSocket(config: WebSocketConfig, onMessage: (data: unknown) => void, onError?: (error: Error) => void): () => void;
export declare function extractPath(data: unknown, path: string): unknown;
export declare function formatValue(value: unknown, formatter?: DataFormatter): string;
export interface LiveDataContextValue {
    sources: Map<string, DataSource>;
    data: Map<string, unknown>;
    bindings: Map<string, DataBinding>;
    registerSource: (source: DataSource) => void;
    unregisterSource: (id: string) => void;
    refreshSource: (id: string) => Promise<void>;
    refreshAll: () => Promise<void>;
    registerBinding: (binding: DataBinding) => void;
    unregisterBinding: (id: string) => void;
    getBoundValue: (bindingId: string) => unknown;
    getFormattedValue: (bindingId: string) => string;
    setManualData: (sourceId: string, data: unknown) => void;
}
export interface LiveDataProviderProps {
    children: React.ReactNode;
    initialSources?: DataSource[];
    initialBindings?: DataBinding[];
    globalRefreshInterval?: number;
}
export declare function LiveDataProvider({ children, initialSources, initialBindings, globalRefreshInterval, }: LiveDataProviderProps): React.ReactElement;
export declare function useLiveData(): LiveDataContextValue;
export declare function useDataSource(id: string): {
    data: unknown;
    status: DataSource['status'];
    error?: string;
    refresh: () => Promise<void>;
};
export declare function useBoundValue<T = unknown>(sourceId: string, path: string, formatter?: DataFormatter, fallback?: T): {
    value: T | undefined;
    formatted: string;
    loading: boolean;
};
export interface KPIWidgetProps {
    config: KPIWidgetConfig;
    sourceId: string;
    className?: string;
    style?: React.CSSProperties;
}
export declare function KPIWidget({ config, sourceId, className, style, }: KPIWidgetProps): React.ReactElement;
export interface LiveTableProps {
    config: LiveTableConfig;
    sourceId: string;
    className?: string;
    style?: React.CSSProperties;
}
export declare function LiveTable({ config, sourceId, className, style, }: LiveTableProps): React.ReactElement;
declare const _default: {
    LiveDataProvider: typeof LiveDataProvider;
    useLiveData: typeof useLiveData;
    useDataSource: typeof useDataSource;
    useBoundValue: typeof useBoundValue;
    KPIWidget: typeof KPIWidget;
    LiveTable: typeof LiveTable;
    fetchDataSource: typeof fetchDataSource;
    subscribeWebSocket: typeof subscribeWebSocket;
    extractPath: typeof extractPath;
    formatValue: typeof formatValue;
};
export default _default;
//# sourceMappingURL=liveDataSlides.d.ts.map