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:
Tunglies
2026-07-13 11:29:25 +08:00
committed by GitHub
parent 6f9fb97b31
commit 7ca20fc4ed
44 changed files with 266 additions and 602 deletions
-57
View File
@@ -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,
}
}