返回 DeepSeek-Reasonix
trashOperations.ts
根目录 / desktop / frontend / src / lib / trashOperations.ts
1 export type TrashOperationSummary = { succeeded: string[]; failed: string[] };
2 export async function purgeTrashBatch(paths: string[], purge: (path: string) => Promise<void>): Promise<TrashOperationSummary> {
3 const result: TrashOperationSummary = { succeeded: [], failed: [] };
4 for (const path of new Set(paths)) {
5 try { await purge(path); result.succeeded.push(path); }
6 catch { result.failed.push(path); }
7 }
8 return result;
9 }
10
10 lines TYPESCRIPT