123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- type Platform =
- | "aix"
- | "android"
- | "darwin"
- | "freebsd"
- | "haiku"
- | "linux"
- | "openbsd"
- | "sunos"
- | "win32"
- | "cygwin"
- | "netbsd";
- /**
- * defines in `vite.config.ts`
- */
- declare const OS_PLATFORM: Platform;
- /**
- * Some interface for clash api
- */
- interface IConfigData {
- port: number;
- mode: string;
- ipv6: boolean;
- "socket-port": number;
- "allow-lan": boolean;
- "log-level": string;
- "mixed-port": number;
- "redir-port": number;
- "socks-port": number;
- "tproxy-port": number;
- "external-controller": string;
- secret: string;
- tun: {
- stack: string;
- device: string;
- "auto-route": boolean;
- "auto-detect-interface": boolean;
- "dns-hijack": string[];
- "strict-route": boolean;
- mtu: number;
- };
- }
- interface IRuleItem {
- type: string;
- payload: string;
- proxy: string;
- }
- interface IProxyItem {
- name: string;
- type: string;
- udp: boolean;
- xudp: boolean;
- tfo: boolean;
- history: {
- time: string;
- delay: number;
- }[];
- all?: string[];
- now?: string;
- hidden?: boolean;
- icon?: string;
- provider?: string; // 记录是否来自provider
- fixed?: string; // 记录固定(优先)的节点
- }
- type IProxyGroupItem = Omit<IProxyItem, "all"> & {
- all: IProxyItem[];
- };
- interface IProxyProviderItem {
- name: string;
- type: string;
- proxies: IProxyItem[];
- updatedAt: string;
- vehicleType: string;
- subscriptionInfo?: {
- Upload: number;
- Download: number;
- Total: number;
- Expire: number;
- };
- }
- interface IRuleProviderItem {
- name: string;
- behavior: string;
- format: string;
- ruleCount: number;
- type: string;
- updatedAt: string;
- vehicleType: string;
- }
- interface ITrafficItem {
- up: number;
- down: number;
- }
- interface ILogItem {
- type: string;
- time?: string;
- payload: string;
- }
- interface IConnectionsItem {
- id: string;
- metadata: {
- network: string;
- type: string;
- host: string;
- sourceIP: string;
- sourcePort: string;
- destinationPort: string;
- destinationIP?: string;
- process?: string;
- processPath?: string;
- };
- upload: number;
- download: number;
- start: string;
- chains: string[];
- rule: string;
- rulePayload: string;
- curUpload?: number; // upload speed, calculate at runtime
- curDownload?: number; // download speed, calculate at runtime
- }
- interface IConnections {
- downloadTotal: number;
- uploadTotal: number;
- connections: IConnectionsItem[];
- }
- /**
- * Some interface for command
- */
- interface IClashInfo {
- // status: string;
- mixed_port?: number; // clash mixed port
- socks_port?: number; // clash socks port
- redir_port?: number; // clash redir port
- tproxy_port?: number; // clash tproxy port
- port?: number; // clash http port
- server?: string; // external-controller
- secret?: string;
- }
- interface IProfileItem {
- uid: string;
- type?: "local" | "remote" | "merge" | "script";
- name?: string;
- desc?: string;
- file?: string;
- url?: string;
- updated?: number;
- selected?: {
- name?: string;
- now?: string;
- }[];
- extra?: {
- upload: number;
- download: number;
- total: number;
- expire: number;
- };
- option?: IProfileOption;
- home?: string;
- }
- interface IProfileOption {
- user_agent?: string;
- with_proxy?: boolean;
- self_proxy?: boolean;
- update_interval?: number;
- danger_accept_invalid_certs?: boolean;
- merge?: string;
- script?: string;
- rules?: string;
- proxies?: string;
- groups?: string;
- }
- interface IProfilesConfig {
- current?: string;
- valid?: string[];
- items?: IProfileItem[];
- }
- interface IVergeTestItem {
- uid: string;
- name?: string;
- icon?: string;
- url: string;
- }
- interface ISeqProfileConfig {
- prepend: string[];
- append: string[];
- delete: string[];
- }
- interface IVergeConfig {
- app_log_level?: "trace" | "debug" | "info" | "warn" | "error" | string;
- language?: string;
- tray_event?: "main_window" | "system_proxy" | "tun_mode" | string;
- env_type?: "bash" | "cmd" | "powershell" | string;
- startup_script?: string;
- start_page?: string;
- clash_core?: string;
- theme_mode?: "light" | "dark" | "system";
- traffic_graph?: boolean;
- enable_memory_usage?: boolean;
- enable_group_icon?: boolean;
- menu_icon?: "monochrome" | "colorful" | "disable";
- tray_icon?: "monochrome" | "colorful";
- common_tray_icon?: boolean;
- sysproxy_tray_icon?: boolean;
- tun_tray_icon?: boolean;
- enable_tun_mode?: boolean;
- enable_auto_launch?: boolean;
- enable_service_mode?: boolean;
- enable_silent_start?: boolean;
- enable_system_proxy?: boolean;
- proxy_auto_config?: boolean;
- pac_file_content?: string;
- enable_random_port?: boolean;
- verge_mixed_port?: number;
- verge_socks_port?: number;
- verge_redir_port?: number;
- verge_tproxy_port?: number;
- verge_port?: number;
- verge_redir_enabled?: boolean;
- verge_tproxy_enabled?: boolean;
- verge_socks_enabled?: boolean;
- verge_http_enabled?: boolean;
- enable_proxy_guard?: boolean;
- use_default_bypass?: boolean;
- proxy_guard_duration?: number;
- system_proxy_bypass?: string;
- web_ui_list?: string[];
- hotkeys?: string[];
- theme_setting?: {
- primary_color?: string;
- secondary_color?: string;
- primary_text?: string;
- secondary_text?: string;
- info_color?: string;
- error_color?: string;
- warning_color?: string;
- success_color?: string;
- font_family?: string;
- css_injection?: string;
- };
- auto_close_connection?: boolean;
- auto_check_update?: boolean;
- default_latency_test?: string;
- default_latency_timeout?: number;
- enable_builtin_enhanced?: boolean;
- auto_log_clean?: 0 | 1 | 2 | 3;
- proxy_layout_column?: number;
- test_list?: IVergeTestItem[];
- }
|