diff options
| author | Matain <[email protected]> | 2022-06-12 23:34:56 +0800 |
|---|---|---|
| committer | Matain <[email protected]> | 2022-06-12 23:34:56 +0800 |
| commit | ea5d7cf003eeef30cb7bbe789c6ba7f314bf1ce4 (patch) | |
| tree | bff1bd7b0e8e8eb753d373b57f007bbe97f96c76 /src/store/types.ts | |
| parent | 4fd2c8f646e48dd0c07d0c2041de52e9a4f8bc82 (diff) | |
| parent | 38571da24ac54137564be5e41b7a409009e2ee10 (diff) | |
Merge branch 'master' of https://github.com/haishanh/yacd into haishanh-master
Diffstat (limited to 'src/store/types.ts')
| -rw-r--r-- | src/store/types.ts | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/store/types.ts b/src/store/types.ts index 3a3e412..faf8a92 100644 --- a/src/store/types.ts +++ b/src/store/types.ts @@ -44,39 +44,45 @@ export type TunPartial<T> = { ///// store.proxies -type LatencyHistory = Array<{ time: string; delay: number }>; -type PrimitiveProxyType = 'Shadowsocks' | 'Snell' | 'Socks5' | 'Http' | 'Vmess'; +type LatencyHistoryItem = { time: string; delay: number }; +export type LatencyHistory = LatencyHistoryItem[]; + export type ProxyItem = { name: string; - type: PrimitiveProxyType; + type: string; history: LatencyHistory; all?: string[]; now?: string; + + __provider?: string; }; + +export type ProxyDelayItem = { + number?: number; +}; + export type ProxiesMapping = Record<string, ProxyItem>; -export type DelayMapping = Record<string, { number?: number }>; +export type DelayMapping = Record<string, ProxyDelayItem>; export type ProxyProvider = { name: string; type: 'Proxy'; updatedAt: string; vehicleType: 'HTTP' | 'File' | 'Compatible'; - proxies: Array<ProxyItem>; + proxies: ProxyItem[]; }; -export type FormattedProxyProvider = Omit<ProxyProvider, 'proxies'> & { - proxies: string[]; -}; +export type FormattedProxyProvider = Omit<ProxyProvider, 'proxies'> & { proxies: string[] }; export type SwitchProxyCtxItem = { groupName: string; itemName: string }; -type SwitchProxyCtx = { - to: SwitchProxyCtxItem; -}; +type SwitchProxyCtx = { to: SwitchProxyCtxItem }; + export type StateProxies = { - proxies: ProxiesMapping; - delay: DelayMapping; groupNames: string[]; proxyProviders?: FormattedProxyProvider[]; + + proxies: ProxiesMapping; + delay: DelayMapping; dangleProxyNames?: string[]; showModalClosePrevConns: boolean; |
