import type { ApiData, ApiInfo, ClientOptions, Config, DuplicateOptions, EndpointInfo, JsApiData, PredictReturn, SpaceStatus, Status, UploadResponse, SubmitIterable, GradioEvent } from "./types"; import { FileData } from "./upload"; export declare class Client { app_reference: string; options: ClientOptions; config: Config | undefined; api_info: ApiInfo | undefined; api_map: Record; session_hash: string; jwt: string | false; last_status: Record; private cookies; stream_status: { open: boolean; }; pending_stream_messages: Record; pending_diff_streams: Record; event_callbacks: Record Promise>; unclosed_events: Set; heartbeat_event: EventSource | null; abort_controller: AbortController | null; stream_instance: EventSource | null; fetch(input: RequestInfo | URL, init?: RequestInit): Promise; stream(url: URL): EventSource; view_api: () => Promise>; upload_files: (root_url: string, files: (Blob | File)[], upload_id?: string) => Promise; upload: (file_data: FileData[], root_url: string, upload_id?: string, max_file_size?: number) => Promise<(FileData | null)[] | null>; handle_blob: (endpoint: string, data: unknown[], endpoint_info: EndpointInfo) => Promise; post_data: (url: string, body: unknown, additional_headers?: any) => Promise; submit: (endpoint: string | number, data: unknown[] | Record, event_data?: unknown, trigger_id?: number | null, all_events?: boolean) => SubmitIterable; predict: (endpoint: string | number, data: unknown[] | Record, event_data?: unknown) => Promise; open_stream: () => Promise; private resolve_config; private resolve_cookies; constructor(app_reference: string, options?: ClientOptions); private init; _resolve_hearbeat(_config: Config): Promise; static connect(app_reference: string, options?: ClientOptions): Promise; close(): void; static duplicate(app_reference: string, options?: DuplicateOptions): Promise; private _resolve_config; private config_success; handle_space_success(status: SpaceStatus): Promise; component_server(component_id: number, fn_name: string, data: unknown[] | { binary: boolean; data: Record; }): Promise; set_cookies(raw_cookies: string): void; private prepare_return_obj; } /** * @deprecated This method will be removed in v1.0. Use `Client.connect()` instead. * Creates a client instance for interacting with Gradio apps. * * @param {string} app_reference - The reference or URL to a Gradio space or app. * @param {ClientOptions} options - Configuration options for the client. * @returns {Promise} A promise that resolves to a `Client` instance. */ export declare function client(app_reference: string, options?: ClientOptions): Promise; /** * @deprecated This method will be removed in v1.0. Use `Client.duplicate()` instead. * Creates a duplicate of a space and returns a client instance for the duplicated space. * * @param {string} app_reference - The reference or URL to a Gradio space or app to duplicate. * @param {DuplicateOptions} options - Configuration options for the client. * @returns {Promise} A promise that resolves to a `Client` instance. */ export declare function duplicate_space(app_reference: string, options: DuplicateOptions): Promise; export type ClientInstance = Client; //# sourceMappingURL=client.d.ts.map