import { HttpClient } from "../api/http"; import type { AsyncTaskManager } from "../services/async-task-manager"; import { ChunkService } from "../services/chunk"; import { FileService } from "../services/file"; import type { AsyncChunkTask, AsyncConversionTask, ChunkDocumentResponse, ChunkFileUploadParams, ConversionFileResult, ConversionOptions, ConversionTarget, ConvertDocumentResponse, ConvertDocumentsRequest, FileSource, FileUploadParams, HealthCheckResponse, HierarchicalChunkerOptionsDocumentsRequest, HttpSource, HybridChunkerOptionsDocumentsRequest, PresignedUrlConvertDocumentResponse, S3Source, TargetConversionResult, TaskStatusResponse } from "../types/api"; import type { DoclingAPI, DoclingAPIConfig, S3Config } from "../types/client"; import type { ProgressConfig, SafeConversionResult, SafeFileConversionResult } from "../types/client"; import { type ConnectionState } from "./websocket-client"; export declare class DoclingAPIClient implements DoclingAPI { readonly type: "api"; private http; private config; private ws; private progressManager; readonly files: FileService; readonly chunks: ChunkService; private static readonly EXT_BY_INPUT; private static readonly CT_BY_INPUT; constructor(config: DoclingAPIConfig | string); private mergeWithDefaults; convert(file: Uint8Array | string, filename: string, options?: ConversionOptions, progress?: ProgressConfig): Promise; extractText(file: Uint8Array | string, filename: string, options?: Omit): Promise; toHtml(file: Uint8Array | string, filename: string, options?: Omit, progress?: ProgressConfig): Promise; toMarkdown(file: Uint8Array | string, filename: string, options?: Omit, progress?: ProgressConfig): Promise; convertDocument(file: Uint8Array | string, filename: string, options: ConversionOptions, progress?: ProgressConfig): Promise; process(file: Uint8Array | string, filename: string, options?: ConversionOptions, progress?: ProgressConfig): Promise; convertToFile(file: Uint8Array | string, filename: string, options: ConversionOptions): Promise; health(): Promise; convertSource(request: ConvertDocumentsRequest): Promise; convertFile(params: FileUploadParams): Promise; convertSourceAsync(request: ConvertDocumentsRequest): Promise; convertFileAsync(params: FileUploadParams, _progressOverride?: ProgressConfig): Promise; convertFileAsyncToZip(params: FileUploadParams, _progressOverride?: ProgressConfig): Promise; pollTaskStatus(taskId: string, waitSeconds?: number): Promise; getTaskResult(taskId: string): Promise; getTaskResultFile(taskId: string): Promise; convertSync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; convertAsync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; convertStream(inputStream: NodeJS.ReadableStream, filename: string, options?: ConversionOptions): Promise; convertStreamToFile(inputStream: NodeJS.ReadableStream, filename: string, options: ConversionOptions): Promise; chunkHybridSync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; chunkHierarchicalSync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; chunkHybridAsync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; chunkHierarchicalAsync(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; chunkHybridFileAsync(params: ChunkFileUploadParams): Promise; chunkHierarchicalFileAsync(params: ChunkFileUploadParams): Promise; chunkHybridSource(request: HybridChunkerOptionsDocumentsRequest): Promise; chunkHierarchicalSource(request: HierarchicalChunkerOptionsDocumentsRequest): Promise; chunkHybridSourceAsync(request: HybridChunkerOptionsDocumentsRequest): Promise; chunkHierarchicalSourceAsync(request: HierarchicalChunkerOptionsDocumentsRequest): Promise; getTaskManager(): AsyncTaskManager; convertFromUrl(url: string, options?: ConversionOptions, headers?: Record): Promise; convertFromFile(filePath: string, options?: ConversionOptions): Promise; convertFromBuffer(buffer: Uint8Array, filename: string, options?: ConversionOptions): Promise; convertFromBase64(base64String: string, filename: string, options?: ConversionOptions): Promise; convertFromS3(s3Config: S3Config, options?: ConversionOptions): Promise; convertWithTarget(sources: (HttpSource | FileSource | S3Source | (S3Config & { kind: "s3"; }))[], target: ConversionTarget | (S3Config & { kind: "s3"; }), options?: ConversionOptions): Promise; private validateConvertRequest; private prepareFiles; private createAsyncTask; private waitForTaskCompletion; private normalizeDocumentResponse; private normalizeError; convertWithAutoProgress(file: Uint8Array | string, filename: string, options?: ConversionOptions, progressOverride?: ProgressConfig): Promise; convertToStream(file: Uint8Array | string, filename: string, outputStream: { write(chunk: string | Uint8Array): boolean; end(): void; }, options?: ConversionOptions, returnAsZip?: boolean): Promise<{ success: boolean; error?: { message: string; details?: string; }; }>; private createStreamRequest; private executeStreamRequest; private executeZipStreamRequest; private isReadableStream; private executeContentStreamRequest; private createStreamError; private createProgressWrapper; private pollRecursively; private convertInputByType; private handleFileStreamResponse; private handleDataStreamResponse; private handleEmptyStreamResponse; convertWithProgress(file: Uint8Array | string, filename: string, options?: ConversionOptions, onProgress?: (progress: { stage: string; percentage?: number; message?: string; uploadProgress?: number; conversionProgress?: number; }) => void): Promise; validateFiles(files: Array<{ buffer?: Uint8Array; filePath?: string; filename: string; }>): Promise<{ valid: boolean; results: Array<{ filename: string; valid: boolean; errors?: string[]; warnings?: string[]; }>; }>; convertWithWebSocket(request: ConvertDocumentsRequest, onProgress?: (progress: { stage: string; percentage?: number; message?: string; taskId: string; position?: number; status: string; timestamp: number; }) => void): Promise; convertFileWithWebSocket(buffer: Uint8Array, filename: string, options?: ConversionOptions, onProgress?: (progress: { stage: string; percentage?: number; message?: string; taskId: string; position?: number; status: string; timestamp: number; uploadedBytes?: number; totalBytes?: number; }) => void): Promise; getWebSocketState(): ConnectionState; convertFileWithPipeline(filePath: string, options?: ConversionOptions, onProgress?: (progress: { stage: string; percentage?: number; message?: string; uploadedBytes?: number; totalBytes?: number; bytesPerSecond?: number; }) => void): Promise; convertStreamWithPipeline(stream: NodeJS.ReadableStream, filename: string, options?: ConversionOptions, size?: number, onProgress?: (progress: { stage: string; percentage?: number; message?: string; uploadedBytes?: number; totalBytes?: number; bytesPerSecond?: number; }) => void): Promise; convertStreamDirect(inputStream: NodeJS.ReadableStream, filename: string, contentType: string, options?: ConversionOptions, estimatedSize?: number, onProgress?: (progress: { uploadedBytes: number; totalBytes: number; percentage: number; bytesPerSecond: number; stage: "preparing" | "uploading" | "processing" | "completed"; }) => void): Promise; convertMultipleFiles(files: Array<{ buffer?: Uint8Array; filePath?: string; stream?: NodeJS.ReadableStream; filename: string; size?: number; }>, options?: ConversionOptions, onProgress?: (progress: { stage: string; currentFile: number; totalFiles: number; filename: string; percentage?: number; message?: string; uploadedBytes?: number; totalBytes?: number; }) => void): Promise<{ success: boolean; results: Array<{ filename: string; success: boolean; result?: ConvertDocumentResponse; error?: string; }>; }>; private static readonly EXT_CT_MAP; private getContentType; private convertWithAsyncProgress; safeConvert(file: Uint8Array | string, filename: string, options?: ConversionOptions): Promise; safeConvertToFile(file: Uint8Array | string, filename: string, options: ConversionOptions): Promise; getHttpClient(): HttpClient; getConfig(): DoclingAPIConfig; updateConfig(updates: Partial): void; destroy(): void; }