2024-06-20 16:38:40 +08:00
|
|
|
import { ApiData, ApiInfo } from "client/js/src/types";
|
2023-03-28 07:12:58 +08:00
|
|
|
declare global {
|
|
|
|
interface Window {
|
|
|
|
__gradio_mode__: "app" | "website";
|
2023-08-11 22:54:56 +08:00
|
|
|
__gradio_space__: string | null;
|
2023-03-28 07:12:58 +08:00
|
|
|
launchGradio: Function;
|
|
|
|
launchGradioFromSpaces: Function;
|
|
|
|
gradio_config: Config;
|
2024-06-20 16:38:40 +08:00
|
|
|
gradio_api_info: ApiInfo<ApiData> | { api: ApiInfo<ApiData> };
|
2023-03-28 07:12:58 +08:00
|
|
|
scoped_css_attach: (link: HTMLLinkElement) => void;
|
|
|
|
__is_colab__: boolean;
|
2023-06-29 05:52:12 +08:00
|
|
|
parentIFrame?: {
|
|
|
|
scrollTo: (x: number, y: number) => void;
|
|
|
|
};
|
2023-03-28 07:12:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Config {
|
2024-07-09 09:58:07 +08:00
|
|
|
auth_required?: true;
|
2023-03-28 07:12:58 +08:00
|
|
|
auth_message: string;
|
|
|
|
components: any[];
|
|
|
|
css: string | null;
|
|
|
|
dependencies: any[];
|
|
|
|
dev_mode: boolean;
|
|
|
|
enable_queue: boolean;
|
|
|
|
layout: any;
|
|
|
|
mode: "blocks" | "interface";
|
|
|
|
root: string;
|
|
|
|
theme: string;
|
|
|
|
title: string;
|
|
|
|
version: string;
|
2023-06-22 03:25:25 +08:00
|
|
|
space_id: string | null;
|
2023-03-28 07:12:58 +08:00
|
|
|
is_colab: boolean;
|
|
|
|
show_api: boolean;
|
|
|
|
stylesheets: string[];
|
|
|
|
path: string;
|
2024-04-20 05:36:13 +08:00
|
|
|
js: string | null;
|
|
|
|
head: string | null;
|
|
|
|
analytics_enabled: boolean;
|
|
|
|
show_error: boolean;
|
|
|
|
is_space: boolean;
|
|
|
|
protocol: "ws" | "sse" | "sse_v1" | "sse_v2" | "sse_v2.1" | "sse_v3";
|
2024-06-09 23:31:03 +08:00
|
|
|
theme_hash?: number;
|
2024-07-09 09:58:07 +08:00
|
|
|
username: string | null;
|
2023-03-28 07:12:58 +08:00
|
|
|
}
|