From ce0fe626b2fede792840d91f284e388a128e1501 Mon Sep 17 00:00:00 2001 From: imengying Date: Sat, 12 Sep 2026 03:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E7=AA=84=E4=BB=85=E9=99=90=E6=9C=AC?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BD=BF=E7=94=A8=E7=9A=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 导出符号审计发现 7 个类型仅在定义文件内使用却带着 export: AppState、CarrierSlot、FormattedBytes、LatencyBucket、 LiveTransportHandlers、LiveTransportOptions、NodeLatencyStats。 去掉 export 关键字,行为无变化。 --- frontend/src/AppProvider.tsx | 2 +- frontend/src/format.ts | 2 +- frontend/src/hooks/useNodeLatency.ts | 2 +- frontend/src/latency.ts | 4 ++-- frontend/src/transport.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/AppProvider.tsx b/frontend/src/AppProvider.tsx index 13ff1bc..7131c7e 100755 --- a/frontend/src/AppProvider.tsx +++ b/frontend/src/AppProvider.tsx @@ -32,7 +32,7 @@ const defaultConfig: Config = { ...demoViewConfig, site_description: "", site_na type Access = "ok" | "login" | "turnstile"; -export interface AppState { +interface AppState { config: Config; configReady: boolean; servers: Server[]; diff --git a/frontend/src/format.ts b/frontend/src/format.ts index 7fc8cb0..da78b4f 100644 --- a/frontend/src/format.ts +++ b/frontend/src/format.ts @@ -10,7 +10,7 @@ export function percent(used: number | null, total: number | null) { return safeTotal > 0 ? Math.min(100, Math.max(0, (number(used) / safeTotal) * 100)) : 0; } -export interface FormattedBytes { +interface FormattedBytes { value: string; unit: string; } diff --git a/frontend/src/hooks/useNodeLatency.ts b/frontend/src/hooks/useNodeLatency.ts index 11dcfa9..e7df072 100755 --- a/frontend/src/hooks/useNodeLatency.ts +++ b/frontend/src/hooks/useNodeLatency.ts @@ -29,7 +29,7 @@ export interface CarrierLatencyRow { lossBars: LatencyBar[]; } -export interface NodeLatencyStats { +interface NodeLatencyStats { latencyDisplay: string; lossDisplay: string; latencyBars: LatencyBar[]; diff --git a/frontend/src/latency.ts b/frontend/src/latency.ts index c414a2c..6116d0a 100644 --- a/frontend/src/latency.ts +++ b/frontend/src/latency.ts @@ -24,7 +24,7 @@ export const CARRIER_SLOTS = [ { key: "unicom" as const, label: "联通", labelEn: "Unicom", color: "#60a5fa", aliases: ["联通", "chinaunicom", "unicom", "cucc", "cu"] }, ] as const; -export type CarrierSlot = typeof CARRIER_SLOTS[number]; +type CarrierSlot = typeof CARRIER_SLOTS[number]; function latencyTone(value: number): LatencyTone { if (value <= 60) return "good"; @@ -97,7 +97,7 @@ export function selectCarrierTasks( return selected; } -export interface LatencyBucket { +interface LatencyBucket { timestamp: number; latency: number | null; loss: number | null; diff --git a/frontend/src/transport.ts b/frontend/src/transport.ts index b809f8d..6561c87 100644 --- a/frontend/src/transport.ts +++ b/frontend/src/transport.ts @@ -40,12 +40,12 @@ export function reconnectDelay(attempt: number, randomValue = Math.random()) { return Math.min(RECONNECT_MAX_DELAY, Math.round(jitteredDelay)); } -export interface LiveTransportHandlers { +interface LiveTransportHandlers { onBatch: (updates: BatchUpdate[]) => void; onConnectedChange: (connected: boolean) => void; } -export interface LiveTransportOptions { +interface LiveTransportOptions { serverId: string | null; }