mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: Associate Profile with Merge/Script.
This commit is contained in:
78
src/services/types.d.ts
vendored
78
src/services/types.d.ts
vendored
@@ -178,11 +178,15 @@ interface IProfileOption {
|
||||
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;
|
||||
chain?: string[];
|
||||
valid?: string[];
|
||||
items?: IProfileItem[];
|
||||
}
|
||||
@@ -254,75 +258,3 @@ interface IVergeConfig {
|
||||
proxy_layout_column?: number;
|
||||
test_list?: IVergeTestItem[];
|
||||
}
|
||||
|
||||
type IClashConfigValue = any;
|
||||
|
||||
interface IProfileMerge {
|
||||
// clash config fields (default supports)
|
||||
rules?: IClashConfigValue;
|
||||
proxies?: IClashConfigValue;
|
||||
"proxy-groups"?: IClashConfigValue;
|
||||
"proxy-providers"?: IClashConfigValue;
|
||||
"rule-providers"?: IClashConfigValue;
|
||||
// clash config fields (use flag)
|
||||
tun?: IClashConfigValue;
|
||||
dns?: IClashConfigValue;
|
||||
hosts?: IClashConfigValue;
|
||||
script?: IClashConfigValue;
|
||||
profile?: IClashConfigValue;
|
||||
payload?: IClashConfigValue;
|
||||
"interface-name"?: IClashConfigValue;
|
||||
"routing-mark"?: IClashConfigValue;
|
||||
// functional fields
|
||||
use?: string[];
|
||||
"prepend-rules"?: any[];
|
||||
"append-rules"?: any[];
|
||||
"prepend-proxies"?: any[];
|
||||
"append-proxies"?: any[];
|
||||
"prepend-proxy-groups"?: any[];
|
||||
"append-proxy-groups"?: any[];
|
||||
// fix
|
||||
ebpf?: any;
|
||||
experimental?: any;
|
||||
iptables?: any;
|
||||
sniffer?: any;
|
||||
authentication?: any;
|
||||
"bind-address"?: any;
|
||||
"external-ui"?: any;
|
||||
"auto-redir"?: any;
|
||||
"socks-port"?: any;
|
||||
"redir-port"?: any;
|
||||
"tproxy-port"?: any;
|
||||
"geodata-mode"?: any;
|
||||
"tcp-concurrent"?: any;
|
||||
}
|
||||
|
||||
// partial of the clash config
|
||||
type IProfileData = Partial<{
|
||||
rules: any[];
|
||||
proxies: any[];
|
||||
"proxy-groups": any[];
|
||||
"proxy-providers": any[];
|
||||
"rule-providers": any[];
|
||||
|
||||
[k: string]: any;
|
||||
}>;
|
||||
|
||||
interface IChainItem {
|
||||
item: IProfileItem;
|
||||
merge?: IProfileMerge;
|
||||
script?: string;
|
||||
}
|
||||
|
||||
interface IEnhancedPayload {
|
||||
chain: IChainItem[];
|
||||
valid: string[];
|
||||
current: IProfileData;
|
||||
callback: string;
|
||||
}
|
||||
|
||||
interface IEnhancedResult {
|
||||
data: IProfileData;
|
||||
status: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user