mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
refactor: knip cleanup (#7468)
* chore(frontend): expand Knip reports * chore: remove unused Mihomo changelog sync script * refactor: remove unused value exports * refactor: remove unused type exports * refactor: remove circular route dependencies * chore(frontend): move Knip scope to config * chore(i18n): remove stale portable update message
This commit is contained in:
@@ -6,39 +6,6 @@ import {
|
||||
RuleProvider,
|
||||
} from 'tauri-plugin-mihomo-api'
|
||||
|
||||
export interface AppDataContextType {
|
||||
proxies: any
|
||||
clashConfig: BaseConfig
|
||||
rules: Rule[]
|
||||
sysproxy: any
|
||||
runningMode?: string
|
||||
uptime: number
|
||||
proxyProviders: Record<string, ProxyProvider>
|
||||
ruleProviders: Record<string, RuleProvider>
|
||||
systemProxyAddress: string
|
||||
isCoreDataPending: boolean
|
||||
|
||||
refreshProxy: () => Promise<any>
|
||||
refreshClashConfig: () => Promise<any>
|
||||
refreshRules: () => Promise<any>
|
||||
refreshSysproxy: () => Promise<any>
|
||||
refreshProxyProviders: () => Promise<any>
|
||||
refreshRuleProviders: () => Promise<any>
|
||||
refreshAll: () => Promise<any>
|
||||
}
|
||||
|
||||
export interface ConnectionWithSpeed extends IConnectionsItem {
|
||||
curUpload: number
|
||||
curDownload: number
|
||||
}
|
||||
|
||||
export interface ConnectionSpeedData {
|
||||
id: string
|
||||
upload: number
|
||||
download: number
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
export interface ProxiesContextType {
|
||||
proxies: any
|
||||
proxyProviders: Record<string, ProxyProvider | undefined>
|
||||
@@ -134,27 +101,3 @@ export const useAppRefreshers = (): RefreshersContextType =>
|
||||
|
||||
export const useCoreDataStatus = (): CoreDataStatusContextType =>
|
||||
useCtx(CoreDataStatusContext, 'useCoreDataStatus')
|
||||
|
||||
export const useAppData = (): AppDataContextType => {
|
||||
const { proxies, proxyProviders } = useProxiesData()
|
||||
const { rules, ruleProviders } = useRulesData()
|
||||
const { clashConfig } = useClashConfigData()
|
||||
const { sysproxy, runningMode, systemProxyAddress } = useSystemData()
|
||||
const { uptime } = useUptimeData()
|
||||
const { isCoreDataPending } = useCoreDataStatus()
|
||||
const refreshers = useAppRefreshers()
|
||||
|
||||
return {
|
||||
proxies,
|
||||
clashConfig: clashConfig as BaseConfig,
|
||||
rules,
|
||||
sysproxy,
|
||||
runningMode,
|
||||
uptime,
|
||||
proxyProviders: proxyProviders as Record<string, ProxyProvider>,
|
||||
ruleProviders: ruleProviders as Record<string, RuleProvider>,
|
||||
systemProxyAddress,
|
||||
isCoreDataPending,
|
||||
...refreshers,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user