export type TSmartAiOcrImageMimeType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | string; export type TSmartAiMistralOcrTableFormat = 'markdown' | 'html'; export type TSmartAiMistralOcrConfidenceScoresGranularity = 'page' | 'word'; export interface ISmartAiOcrImageInput { dataBase64: string; mimeType: TSmartAiOcrImageMimeType; } export interface ISmartAiOcrPageResult { index: number; text: string; confidence?: number; } export interface ISmartAiOcrResult { text: string; confidence?: number; pages: ISmartAiOcrPageResult[]; raw: TRaw; } export interface ISmartAiOcrEngine { recognizeImage: (input: ISmartAiOcrImageInput, options?: ISmartAiMistralOcrRecognizeOptions) => Promise>; } export interface IMistralOcrPageConfidenceScores { average_page_confidence_score?: number; averagePageConfidenceScore?: number; minimum_page_confidence_score?: number; minimumPageConfidenceScore?: number; } export interface IMistralOcrPageResponse { index: number; markdown: string; confidence_scores?: IMistralOcrPageConfidenceScores | null; confidenceScores?: IMistralOcrPageConfidenceScores | null; } export interface IMistralOcrResponse { pages: IMistralOcrPageResponse[]; model: string; document_annotation?: unknown; documentAnnotation?: unknown; usage_info?: unknown; usageInfo?: unknown; } export interface IMistralOcrRequest { model: string; document: { type: 'image_url'; image_url: string; }; include_image_base64?: boolean; table_format?: TSmartAiMistralOcrTableFormat; extract_header?: boolean; extract_footer?: boolean; confidence_scores_granularity?: TSmartAiMistralOcrConfidenceScoresGranularity; } export interface ISmartAiMistralOcrTransport { process: (request: IMistralOcrRequest) => Promise; } export interface ISmartAiMistralOcrOptions { apiKey?: string; model?: string; endpointUrl?: string; transport?: ISmartAiMistralOcrTransport; includeImageBase64?: boolean; tableFormat?: TSmartAiMistralOcrTableFormat; extractHeader?: boolean; extractFooter?: boolean; confidenceScoresGranularity?: TSmartAiMistralOcrConfidenceScoresGranularity; } export interface ISmartAiMistralOcrRecognizeOptions { includeImageBase64?: boolean; tableFormat?: TSmartAiMistralOcrTableFormat; extractHeader?: boolean; extractFooter?: boolean; confidenceScoresGranularity?: TSmartAiMistralOcrConfidenceScoresGranularity; } export declare const createMistralOcrEngine: (options?: ISmartAiMistralOcrOptions) => ISmartAiOcrEngine;