import type { Config } from "./types"; import { hardware_types } from "./utils"; import type { EventType, EventListener, PostResponse, UploadResponse, SpaceStatusCallback } from "./types"; declare global { interface Window { __gradio_mode__: "app" | "website"; launchGradio: Function; launchGradioFromSpaces: Function; gradio_config: Config; scoped_css_attach: (link: HTMLLinkElement) => void; __is_colab__: boolean; } } type event = (eventType: K, listener: EventListener) => SubmitReturn; type predict = (endpoint: string | number, data?: unknown[], event_data?: unknown) => Promise; type client_return = { predict: predict; config: Config; submit: (endpoint: string | number, data?: unknown[], event_data?: unknown) => SubmitReturn; view_api: (c?: Config) => Promise>; }; type SubmitReturn = { on: event; off: event; cancel: () => Promise; destroy: () => void; }; export declare function post_data(url: string, body: unknown, token?: `hf_${string}`): Promise<[PostResponse, number]>; export declare function upload_files(root: string, files: Array, token?: `hf_${string}`): Promise; export declare function duplicate(app_reference: string, options: { hf_token: `hf_${string}`; private?: boolean; status_callback: SpaceStatusCallback; hardware?: typeof hardware_types[number]; timeout?: number; }): Promise; export declare function client(app_reference: string, options?: { hf_token?: `hf_${string}`; status_callback?: SpaceStatusCallback; normalise_files?: boolean; session_hash?: string; }): Promise; interface ApiData { label: string; type: { type: any; description: string; }; component: string; example_input?: any; } interface JsApiData { label: string; type: string; component: string; example_input: any; } interface EndpointInfo { parameters: T[]; returns: T[]; } interface ApiInfo { named_endpoints: { [key: string]: EndpointInfo; }; unnamed_endpoints: { [key: string]: EndpointInfo; }; } export declare function handle_blob(endpoint: string, data: unknown[], api_info: any, token?: `hf_${string}`): Promise; export declare function walk_and_store_blobs(param: any, type?: any, path?: any[], root?: boolean, api_info?: any): Promise; export {};