import { DataSource } from './liveDataSlides';

/** Supported query languages. */
export type QueryLanguage = 'sql' | 'odata' | 'graphql' | 'kql' | 'dax';
/** Query parameter definition. */
export interface QueryParameter {
    name: string;
    label: string;
    type: 'string' | 'number' | 'date' | 'datetime' | 'boolean' | 'select';
    defaultValue?: unknown;
    required?: boolean;
    placeholder?: string;
    options?: Array<{
        value: unknown;
        label: string;
    }>;
    validation?: {
        min?: number;
        max?: number;
        pattern?: string;
        message?: string;
    };
}
/** Query execution result. */
export interface QueryResult {
    success: boolean;
    columns: Array<{
        name: string;
        type: 'string' | 'number' | 'date' | 'boolean' | 'object' | 'array';
    }>;
    data: Record<string, unknown>[];
    rowCount: number;
    executionTimeMs: number;
    error?: string;
    warnings?: string[];
    metadata?: Record<string, unknown>;
}
/** Query history entry. */
export interface QueryHistoryEntry {
    id: string;
    query: string;
    language: QueryLanguage;
    parameters: Record<string, unknown>;
    executedAt: string;
    executionTimeMs: number;
    rowCount: number;
    success: boolean;
    error?: string;
}
/** Saved query / favorite. */
export interface SavedQuery {
    id: string;
    name: string;
    description?: string;
    query: string;
    language: QueryLanguage;
    parameters: QueryParameter[];
    createdAt: string;
    updatedAt: string;
    tags?: string[];
    isFavorite?: boolean;
}
/** Result visualization mode. */
export type ResultVisualizationMode = 'table' | 'bar-chart' | 'line-chart' | 'pie-chart' | 'area-chart' | 'metrics' | 'json';
/** Visualization configuration. */
export interface ResultVisualizationConfig {
    mode: ResultVisualizationMode;
    tableConfig?: {
        pageSize?: number;
        sortable?: boolean;
        filterable?: boolean;
        showRowNumbers?: boolean;
    };
    chartConfig?: {
        xAxis?: string;
        yAxis?: string | string[];
        seriesField?: string;
        colorScheme?: string[];
        showLegend?: boolean;
        showGrid?: boolean;
        title?: string;
    };
    metricsConfig?: {
        columns: Array<{
            field: string;
            label: string;
            aggregation: 'sum' | 'avg' | 'min' | 'max' | 'count' | 'first' | 'last';
            format?: 'number' | 'currency' | 'percent';
            precision?: number;
        }>;
    };
}
/** Query slide configuration. */
export interface QuerySlideConfig {
    id: string;
    title: string;
    subtitle?: string;
    /** Query language. */
    language: QueryLanguage;
    /** The query text. */
    query: string;
    /** Query parameters. */
    parameters?: QueryParameter[];
    /** Data source connection. */
    dataSource: DataSource;
    /** Visualization settings. */
    visualization: ResultVisualizationConfig;
    /** Auto-execute on slide enter. */
    autoExecute?: boolean;
    /** Show query editor in presentation mode. */
    showQueryEditor?: boolean;
    /** Allow editing query during presentation. */
    allowQueryEdit?: boolean;
    /** Show execution stats. */
    showExecutionStats?: boolean;
    /** Cache results duration (seconds). */
    cacheDuration?: number;
    /** Query description for audience. */
    description?: string;
    /** Slide styling. */
    style?: QuerySlideStyle;
}
/** Query slide styling. */
export interface QuerySlideStyle {
    editorTheme?: 'light' | 'dark' | 'monokai' | 'github';
    editorFontSize?: number;
    resultBackground?: string;
    accentColor?: string;
    borderRadius?: number;
}
/** Generated Query Slide. */
export interface QuerySlide {
    id: string;
    type: 'query';
    title: string;
    subtitle?: string;
    config: QuerySlideConfig;
    state: QuerySlideState;
}
/** Runtime state of Query Slide. */
export interface QuerySlideState {
    currentQuery: string;
    currentParameters: Record<string, unknown>;
    result: QueryResult | null;
    isExecuting: boolean;
    lastExecutedAt: string | null;
    error: string | null;
    visualizationMode: ResultVisualizationMode;
    history: QueryHistoryEntry[];
}
/**
 * Create a Query Slide.
 */
export declare function createQuerySlide(config: QuerySlideConfig): QuerySlide;
/**
 * Parse query to extract parameter placeholders.
 */
export declare function extractQueryParameters(query: string, language: QueryLanguage): string[];
/**
 * Substitute parameters into query.
 */
export declare function substituteParameters(query: string, language: QueryLanguage, parameters: Record<string, unknown>): string;
/**
 * Validate query parameters.
 */
export declare function validateParameters(parameters: QueryParameter[], values: Record<string, unknown>): {
    valid: boolean;
    errors: Record<string, string>;
};
/**
 * Auto-detect best visualization mode based on result data.
 */
export declare function detectBestVisualization(result: QueryResult): ResultVisualizationMode;
/**
 * Generate chart config from query result.
 */
export declare function generateChartConfig(result: QueryResult, _mode: ResultVisualizationMode): ResultVisualizationConfig['chartConfig'];
/** SQL sales summary query template. */
export declare function createSalesQuerySlide(): QuerySlideConfig;
/** OData product catalog query template. */
export declare function createODataQuerySlide(): QuerySlideConfig;
/** KQL Azure Monitor query template. */
export declare function createKQLQuerySlide(): QuerySlideConfig;
declare const _default: {
    createQuerySlide: typeof createQuerySlide;
    extractQueryParameters: typeof extractQueryParameters;
    substituteParameters: typeof substituteParameters;
    validateParameters: typeof validateParameters;
    detectBestVisualization: typeof detectBestVisualization;
    generateChartConfig: typeof generateChartConfig;
    createSalesQuerySlide: typeof createSalesQuerySlide;
    createODataQuerySlide: typeof createODataQuerySlide;
    createKQLQuerySlide: typeof createKQLQuerySlide;
};
export default _default;
//# sourceMappingURL=querySlide.d.ts.map