import type { BinaryTransportResponse, ChatGPTTransport } from "./transport/chatgpt-transport.js"; export declare class ChatGPTAuthError extends Error { readonly code = "auth_expired"; constructor(message: string); } export declare class ChatGPTChallengeError extends Error { readonly code = "cloudflare_challenge"; constructor(message: string); } export declare class ChatGPTApiError extends Error { readonly status?: number | undefined; readonly code = "chatgpt_api_error"; constructor(message: string, status?: number | undefined); } export declare class ChatGPTTimeoutError extends Error { readonly code = "upstream_timeout"; constructor(message: string); } export declare class ChatGPTAssetTooLargeError extends Error { readonly maxBytes: number; readonly code = "asset_too_large"; constructor(maxBytes: number); } export type ConversationTimestamp = number | string | null; export type ConversationListItem = { id: string; title: string; create_time?: ConversationTimestamp; update_time?: ConversationTimestamp; is_archived?: boolean; conversation_origin?: string | null; async_status?: string | null; is_automation_conversation?: boolean; default_model_slug?: string | null; workspace_id?: string | null; }; export type ConversationListResponse = { items: ConversationListItem[]; total?: number; offset?: number; limit?: number; has_missing_conversations?: boolean; }; export type ConversationMessageNode = { id: string; message?: { id?: string; author?: { role?: string; name?: string | null; }; create_time?: ConversationTimestamp; content?: { content_type?: string; parts?: unknown[]; text?: unknown; content?: unknown; result?: unknown; thoughts?: unknown[]; }; metadata?: Record; recipient?: string | null; status?: string | null; end_turn?: boolean | null; } | null; parent?: string | null; children?: string[]; }; export type ConversationDetail = { conversation_id?: string; id?: string; title?: string | null; create_time?: ConversationTimestamp; update_time?: ConversationTimestamp; current_node?: string | null; mapping?: Record; is_archived?: boolean; conversation_origin?: string | null; async_status?: string | null; is_automation_conversation?: boolean; default_model_slug?: string | null; workspace_id?: string | null; }; export type DownloadedChatGPTFile = BinaryTransportResponse & { fileName: string | null; declaredMimeType: string | null; }; export declare class ChatGPTClient { private readonly transport; constructor(transport: ChatGPTTransport); listConversations(params?: { offset?: number; limit?: number; order?: "updated" | "created"; isArchived?: boolean; }): Promise; getConversation(conversationId: string): Promise; downloadConversationFile(conversationId: string, fileId: string, maxBytes: number): Promise; close(): Promise; private getJson; private getJsonWithRetry; private requestJson; }