/**
 * Export Manager
 *
 * Multi-format export utility for conversations, sessions, code, and data.
 * Supports JSON, Markdown, HTML, and plain text formats with customizable templates.
 */
import { EventEmitter } from 'events';
export type ExportFormat = 'json' | 'markdown' | 'html' | 'text' | 'csv';
export interface ExportOptions {
    /** Output format */
    format: ExportFormat;
    /** Include metadata (timestamps, tokens, cost) */
    includeMetadata?: boolean;
    /** Include tool calls */
    includeToolCalls?: boolean;
    /** Include tool results */
    includeToolResults?: boolean;
    /** Include thinking/reasoning */
    includeThinking?: boolean;
    /** Include timestamps */
    includeTimestamps?: boolean;
    /** Redact sensitive data */
    redactSecrets?: boolean;
    /** Pretty print JSON */
    prettyPrint?: boolean;
    /** Max content length per message (0 for unlimited) */
    maxContentLength?: number;
    /** Max tool result length */
    maxToolResultLength?: number;
    /** Custom title */
    title?: string;
    /** Custom CSS for HTML export */
    customCss?: string;
    /** Custom template path */
    templatePath?: string;
    /** Include checkpoints */
    includeCheckpoints?: boolean;
    /** Syntax highlighting for code blocks */
    syntaxHighlight?: boolean;
}
export interface ConversationMessage {
    role: 'user' | 'assistant' | 'system' | 'tool';
    content: string;
    timestamp?: Date;
    tokens?: number;
    toolName?: string;
    toolCallId?: string;
    thinking?: string;
}
export interface ConversationExport {
    title?: string;
    model?: string;
    startTime?: Date;
    endTime?: Date;
    totalCost?: number;
    totalTokens?: number;
    messages: ConversationMessage[];
    metadata?: Record<string, unknown>;
}
export interface CodeExport {
    path: string;
    language?: string;
    content: string;
    lineStart?: number;
    lineEnd?: number;
}
export interface TableExport {
    headers: string[];
    rows: (string | number | boolean | null)[][];
    title?: string;
}
export declare function exportConversation(data: ConversationExport, options?: Partial<ExportOptions>): string;
export declare function exportToFile(data: ConversationExport, filePath: string, options?: Partial<ExportOptions>): Promise<void>;
export declare function exportCode(code: CodeExport, format?: 'markdown' | 'html' | 'text'): string;
export declare function exportTable(table: TableExport, format?: 'markdown' | 'html' | 'csv' | 'text'): string;
export declare class ExportManager extends EventEmitter {
    private defaultOptions;
    private outputDir;
    private redactor;
    constructor(options?: Partial<ExportOptions>, outputDir?: string);
    /**
     * Ensure output directory exists
     */
    private ensureOutputDir;
    /**
     * Generate filename based on format and timestamp
     */
    private generateFilename;
    /**
     * Export session by ID
     */
    exportSession(sessionId: string, format: ExportFormat, options?: Partial<ExportOptions>): Promise<{
        success: boolean;
        filePath?: string;
        error?: string;
    }>;
    /**
     * Export session to string
     */
    exportSessionToString(sessionId: string, format: ExportFormat, options?: Partial<ExportOptions>): Promise<string>;
    /**
     * Export tool results
     */
    exportToolResults(toolName: string, results: Array<{
        timestamp: Date;
        success: boolean;
        duration?: number;
        output: string;
    }>, format: ExportFormat, options?: Partial<ExportOptions>): Promise<{
        success: boolean;
        filePath?: string;
        error?: string;
    }>;
    /**
     * Convert session to export data
     */
    private sessionToExportData;
    /**
     * Convert database message to conversation message
     */
    private messageToConversationMessage;
    /**
     * Format export data
     */
    private formatExport;
    /**
     * Redact sensitive data
     */
    private redactData;
    /**
     * List exported files
     */
    listExports(): Promise<Array<{
        filename: string;
        path: string;
        size: number;
        created: Date;
    }>>;
    conversation(data: ConversationExport, options?: Partial<ExportOptions>): string;
    toFile(data: ConversationExport, filePath: string, options?: Partial<ExportOptions>): Promise<void>;
    code(code: CodeExport, format?: 'markdown' | 'html' | 'text'): string;
    table(table: TableExport, format?: 'markdown' | 'html' | 'csv' | 'text'): string;
}
export declare function getExportManager(): ExportManager;
export declare function resetExportManager(): void;
export default ExportManager;
