frontend: add lazy server tree and folder items list with synced navigation and local state badges
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -74,6 +74,17 @@ export async function selectDirectory(): Promise<string | null> {
|
||||
return bridge.selectDirectory()
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量检测本地绝对路径是否存在,非 Electron 环境返回 null 表示无法检测。
|
||||
*/
|
||||
export async function pathsExist(paths: string[]): Promise<Record<string, boolean> | null> {
|
||||
const bridge = getBridge()
|
||||
if (!bridge || paths.length === 0) {
|
||||
return bridge ? {} : null
|
||||
}
|
||||
return bridge.pathsExist(paths)
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造非 Electron 环境下的占位服务状态。
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ export {
|
||||
getServiceStatus,
|
||||
getToken,
|
||||
isElectron,
|
||||
pathsExist,
|
||||
selectDirectory,
|
||||
startService,
|
||||
} from "./bridge"
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface MactfsBridge {
|
||||
getServiceStatus(): Promise<ServiceStatus>
|
||||
startService(): Promise<ServiceStatus>
|
||||
selectDirectory(): Promise<string | null>
|
||||
pathsExist(paths: string[]): Promise<Record<string, boolean>>
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
Reference in New Issue
Block a user