123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681 |
- 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: [];
- append: [];
- delete: [];
- }
- interface IProxyGroupConfig {
- name: string;
- type: "select" | "url-test" | "fallback" | "load-balance" | "relay";
- proxies?: string[];
- use?: string[];
- url?: string;
- interval?: number;
- lazy?: boolean;
- timeout?: number;
- "max-failed-times"?: number;
- "disable-udp"?: boolean;
- "interface-name": string;
- "routing-mark"?: number;
- "include-all"?: boolean;
- "include-all-proxies"?: boolean;
- "include-all-providers"?: boolean;
- filter?: string;
- "exclude-filter"?: string;
- "exclude-type"?: string;
- "expected-status"?: string;
- hidden?: boolean;
- icon?: string;
- }
- interface WsOptions {
- path?: string;
- headers?: {
- [key: string]: string;
- };
- "max-early-data"?: number;
- "early-data-header-name"?: string;
- "v2ray-http-upgrade"?: boolean;
- "v2ray-http-upgrade-fast-open"?: boolean;
- }
- interface HttpOptions {
- method?: string;
- path?: string[];
- headers?: {
- [key: string]: string;
- };
- }
- interface H2Options {
- path?: string;
- host?: string;
- }
- interface GrpcOptions {
- "grpc-service-name"?: string;
- }
- interface RealityOptions {
- "public-key"?: string;
- "short-id"?: string;
- }
- type NetworkType = "ws" | "http" | "h2" | "grpc";
- // base
- interface IProxyBaseConfig {
- tfo?: boolean;
- mptcp?: boolean;
- "interface-name"?: string;
- "routing-mark"?: number;
- "ip-version"?: "dual" | "ipv4" | "ipv6" | "ipv4-prefer" | "ipv6-prefer";
- "dialer-proxy"?: string;
- }
- // direct
- interface IProxyDirectConfig extends IProxyBaseConfig {
- name: string;
- type: "direct";
- }
- // dns
- interface IProxyDnsConfig extends IProxyBaseConfig {
- name: string;
- type: "dns";
- }
- // http
- interface IProxyHttpConfig extends IProxyBaseConfig {
- name: string;
- type: "http";
- server?: string;
- port?: number;
- username?: string;
- password?: string;
- tls?: boolean;
- sni?: string;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- headers?: {};
- }
- // socks5
- interface IProxySocks5Config extends IProxyBaseConfig {
- name: string;
- type: "socks5";
- server?: string;
- port?: number;
- username?: string;
- password?: string;
- tls?: boolean;
- udp?: boolean;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- }
- // ssh
- interface IProxySshConfig extends IProxyBaseConfig {
- name: string;
- type: "ssh";
- server?: string;
- port?: number;
- username?: string;
- password?: string;
- "private-key"?: string;
- "private-key-passphrase"?: string;
- "host-key"?: string;
- "host-key-algorithms"?: string;
- }
- // trojan
- interface IProxyTrojanConfig extends IProxyBaseConfig {
- name: string;
- type: "trojan";
- server?: string;
- port?: number;
- password?: string;
- alpn?: string[];
- sni?: string;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- udp?: boolean;
- network?: NetworkType;
- "reality-opts"?: RealityOptions;
- "grpc-opts"?: GrpcOptions;
- "ws-opts"?: WsOptions;
- "ss-opts"?: {
- enabled?: boolean;
- method?: string;
- password?: string;
- };
- "client-fingerprint"?: string;
- }
- // tuic
- interface IProxyTuicConfig extends IProxyBaseConfig {
- name: string;
- type: "tuic";
- server?: string;
- port?: number;
- token?: string;
- uuid?: string;
- password?: string;
- ip?: string;
- "heartbeat-interval"?: number;
- alpn?: string[];
- "reduce-rtt"?: boolean;
- "request-timeout"?: number;
- "udp-relay-mode"?: string;
- "congestion-controller"?: string;
- "disable-sni"?: boolean;
- "max-udp-relay-packet-size"?: number;
- "fast-open"?: boolean;
- "max-open-streams"?: number;
- cwnd?: number;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- ca?: string;
- "ca-str"?: string;
- "recv-window-conn"?: number;
- "recv-window"?: number;
- "disable-mtu-discovery"?: boolean;
- "max-datagram-frame-size"?: number;
- sni?: string;
- "udp-over-stream"?: boolean;
- "udp-over-stream-version"?: number;
- }
- // vless
- interface IProxyVlessConfig extends IProxyBaseConfig {
- name: string;
- type: "vless";
- server?: string;
- port?: number;
- uuid?: string;
- flow?: string;
- tls?: boolean;
- alpn?: string[];
- udp?: boolean;
- "packet-addr"?: boolean;
- xudp?: boolean;
- "packet-encoding"?: string;
- network?: NetworkType;
- "reality-opts"?: RealityOptions;
- "http-opts"?: HttpOptions;
- "h2-opts"?: H2Options;
- "grpc-opts"?: GrpcOptions;
- "ws-opts"?: WsOptions;
- "ws-path"?: string;
- "ws-headers"?: {};
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- servername?: string;
- "client-fingerprint"?: string;
- }
- // vmess
- interface IProxyVmessConfig extends IProxyBaseConfig {
- name: string;
- type: "vmess";
- server?: string;
- port?: number;
- uuid?: string;
- alterId?: number;
- cipher?: string;
- udp?: boolean;
- network?: NetworkType;
- tls?: boolean;
- alpn?: string[];
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- servername?: string;
- "reality-opts"?: RealityOptions;
- "http-opts"?: HttpOptions;
- "h2-opts"?: H2Options;
- "grpc-opts"?: GrpcOptions;
- "ws-opts"?: WsOptions;
- "packet-addr"?: boolean;
- xudp?: boolean;
- "packet-encoding"?: string;
- "global-padding"?: boolean;
- "authenticated-length"?: boolean;
- "client-fingerprint"?: string;
- }
- interface WireGuardPeerOptions {
- server?: string;
- port?: number;
- "public-key"?: string;
- "pre-shared-key"?: string;
- reserved?: number[];
- "allowed-ips"?: string[];
- }
- // wireguard
- interface IProxyWireguardConfig extends IProxyBaseConfig, WireGuardPeerOptions {
- name: string;
- type: "wireguard";
- ip?: string;
- ipv6?: string;
- "private-key"?: string;
- workers?: number;
- mtu?: number;
- udp?: boolean;
- "persistent-keepalive"?: number;
- peers?: WireGuardPeerOptions[];
- "remote-dns-resolve"?: boolean;
- dns?: string[];
- "refresh-server-ip-interval"?: number;
- }
- // hysteria
- interface IProxyHysteriaConfig extends IProxyBaseConfig {
- name: string;
- type: "hysteria";
- server?: string;
- port?: number;
- ports?: string;
- protocol?: string;
- "obfs-protocol"?: string;
- up?: string;
- "up-speed"?: number;
- down?: string;
- "down-speed"?: number;
- auth?: string;
- "auth-str"?: string;
- obfs?: string;
- sni?: string;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- alpn?: string[];
- ca?: string;
- "ca-str"?: string;
- "recv-window-conn"?: number;
- "recv-window"?: number;
- "disable-mtu-discovery"?: boolean;
- "fast-open"?: boolean;
- "hop-interval"?: number;
- }
- // hysteria2
- interface IProxyHysteria2Config extends IProxyBaseConfig {
- name: string;
- type: "hysteria2";
- server?: string;
- port?: number;
- ports?: string;
- "hop-interval"?: number;
- protocol?: string;
- "obfs-protocol"?: string;
- up?: string;
- down?: string;
- password?: string;
- obfs?: string;
- "obfs-password"?: string;
- sni?: string;
- "skip-cert-verify"?: boolean;
- fingerprint?: string;
- alpn?: string[];
- ca?: string;
- "ca-str"?: string;
- cwnd?: number;
- "udp-mtu"?: number;
- }
- // shadowsocks
- interface IProxyShadowsocksConfig extends IProxyBaseConfig {
- name: string;
- type: "ss";
- server?: string;
- port?: number;
- password?: string;
- cipher?: string;
- udp?: boolean;
- plugin?: "obfs" | "v2ray-plugin" | "shadow-tls" | "restls";
- "plugin-opts"?: {
- mode?: string;
- host?: string;
- password?: string;
- path?: string;
- tls?: string;
- fingerprint?: string;
- headers?: {};
- "skip-cert-verify"?: boolean;
- version?: number;
- mux?: boolean;
- "v2ray-http-upgrade"?: boolean;
- "v2ray-http-upgrade-fast-open"?: boolean;
- "version-hint"?: string;
- "restls-script"?: string;
- };
- "udp-over-tcp"?: boolean;
- "udp-over-tcp-version"?: number;
- "client-fingerprint"?: string;
- }
- // shadowsocksR
- interface IProxyshadowsocksRConfig extends IProxyBaseConfig {
- name: string;
- type: "ssr";
- server?: string;
- port?: number;
- password?: string;
- cipher?: string;
- obfs?: string;
- "obfs-param"?: string;
- protocol?: string;
- "protocol-param"?: string;
- udp?: boolean;
- }
- // sing-mux
- interface IProxySmuxConfig {
- smux?: {
- enabled?: boolean;
- protocol?: "smux" | "yamux" | "h2mux";
- "max-connections"?: number;
- "min-streams"?: number;
- "max-streams"?: number;
- padding?: boolean;
- statistic?: boolean;
- "only-tcp"?: boolean;
- "brutal-opts"?: {
- enabled?: boolean;
- up?: string;
- down?: string;
- };
- };
- }
- // snell
- interface IProxySnellConfig extends IProxyBaseConfig {
- name: string;
- type: "snell";
- server?: string;
- port?: number;
- psk?: string;
- udp?: boolean;
- version?: number;
- "obfs-opts"?: {};
- }
- interface IProxyConfig
- extends IProxyBaseConfig,
- IProxyDirectConfig,
- IProxyDnsConfig,
- IProxyHttpConfig,
- IProxySocks5Config,
- IProxySshConfig,
- IProxyTrojanConfig,
- IProxyTuicConfig,
- IProxyVlessConfig,
- IProxyVmessConfig,
- IProxyWireguardConfig,
- IProxyHysteriaConfig,
- IProxyHysteria2Config,
- IProxyShadowsocksConfig,
- IProxyshadowsocksRConfig,
- IProxySmuxConfig,
- IProxySnellConfig {
- type:
- | "ss"
- | "ssr"
- | "direct"
- | "dns"
- | "snell"
- | "http"
- | "trojan"
- | "hysteria"
- | "hysteria2"
- | "tuic"
- | "wireguard"
- | "ssh"
- | "socks5"
- | "vmess"
- | "vless";
- }
- 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[];
- }
|