@huyooo/file-explorer-frontend-react 0.4.18 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +0 -1
- package/dist/index.js +1 -3456
- package/package.json +4 -4
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/components/Breadcrumb.css +0 -61
- package/src/components/Breadcrumb.tsx +0 -38
- package/src/components/CompressDialog.css +0 -267
- package/src/components/CompressDialog.tsx +0 -222
- package/src/components/ContextMenu.css +0 -155
- package/src/components/ContextMenu.tsx +0 -375
- package/src/components/FileGrid.css +0 -239
- package/src/components/FileGrid.tsx +0 -278
- package/src/components/FileIcon.css +0 -41
- package/src/components/FileIcon.tsx +0 -86
- package/src/components/FileInfoDialog.css +0 -214
- package/src/components/FileInfoDialog.tsx +0 -202
- package/src/components/FileList.css +0 -169
- package/src/components/FileList.tsx +0 -228
- package/src/components/FileListView.css +0 -36
- package/src/components/FileListView.tsx +0 -355
- package/src/components/FileSidebar.css +0 -94
- package/src/components/FileSidebar.tsx +0 -66
- package/src/components/ProgressDialog.css +0 -211
- package/src/components/ProgressDialog.tsx +0 -183
- package/src/components/SortIndicator.css +0 -7
- package/src/components/SortIndicator.tsx +0 -19
- package/src/components/StatusBar.css +0 -20
- package/src/components/StatusBar.tsx +0 -21
- package/src/components/Toolbar.css +0 -150
- package/src/components/Toolbar.tsx +0 -127
- package/src/components/Window.css +0 -246
- package/src/components/Window.tsx +0 -335
- package/src/hooks/useApplicationIcon.ts +0 -80
- package/src/hooks/useDragAndDrop.ts +0 -104
- package/src/hooks/useMediaPlayer.ts +0 -164
- package/src/hooks/useSelection.ts +0 -112
- package/src/hooks/useWindowDrag.ts +0 -60
- package/src/hooks/useWindowResize.ts +0 -126
- package/src/index.css +0 -184
- package/src/index.ts +0 -37
- package/src/types/index.ts +0 -274
- package/src/utils/fileTypeIcon.ts +0 -309
- package/src/utils/folderTypeIcon.ts +0 -132
package/src/index.css
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File Explorer Frontend (React) - 全局主题 token
|
|
3
|
-
*
|
|
4
|
-
* 主题协议(跨项目统一):
|
|
5
|
-
* - 使用 document.documentElement 的 data-theme = light | dark
|
|
6
|
-
* - 默认跟随系统 prefers-color-scheme
|
|
7
|
-
*
|
|
8
|
-
* 说明:
|
|
9
|
-
* - React 组件样式尽量使用 var(--huyooo-*),避免硬编码颜色
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
:root {
|
|
13
|
-
color-scheme: light;
|
|
14
|
-
|
|
15
|
-
/* 对齐 ai-chat(light):暖白底 + 中性灰 + 统一蓝主色 */
|
|
16
|
-
--huyooo-bg: #f7f7f4;
|
|
17
|
-
--huyooo-surface: #f2f1ed;
|
|
18
|
-
--huyooo-surface-2: #f0efeb;
|
|
19
|
-
--huyooo-muted: #ebeae5;
|
|
20
|
-
--huyooo-muted-hover: #e6e5e0;
|
|
21
|
-
--huyooo-border: #26251e1a;
|
|
22
|
-
--huyooo-text: #26251eeb;
|
|
23
|
-
--huyooo-text-muted: #26251e99;
|
|
24
|
-
--huyooo-text-disabled: #26251e66;
|
|
25
|
-
--huyooo-primary: #54a9ff;
|
|
26
|
-
--huyooo-focus-ring: rgba(84, 169, 255, 0.18);
|
|
27
|
-
--huyooo-shadow-sm: 0 1px 2px 0 rgba(38, 37, 30, 0.08);
|
|
28
|
-
--huyooo-scrollbar: rgba(38, 37, 30, 0.2);
|
|
29
|
-
--huyooo-scrollbar-hover: rgba(38, 37, 30, 0.3);
|
|
30
|
-
--huyooo-danger: #cf2d56;
|
|
31
|
-
--huyooo-success: #1f8a65;
|
|
32
|
-
--huyooo-warning: rgb(245, 158, 11);
|
|
33
|
-
--huyooo-danger-bg: rgba(207, 45, 86, 0.1);
|
|
34
|
-
--huyooo-danger-border: rgba(207, 45, 86, 0.22);
|
|
35
|
-
--huyooo-success-bg: rgba(31, 138, 101, 0.1);
|
|
36
|
-
--huyooo-success-border: rgba(31, 138, 101, 0.22);
|
|
37
|
-
--huyooo-warning-bg: rgba(255, 251, 235, 0.92);
|
|
38
|
-
--huyooo-warning-border: rgba(253, 230, 138, 0.9);
|
|
39
|
-
--huyooo-overlay: rgba(0, 0, 0, 0.5);
|
|
40
|
-
--huyooo-panel-bg: #f2f1ed;
|
|
41
|
-
--huyooo-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
42
|
-
--huyooo-code-bg: #f2f1ed;
|
|
43
|
-
--huyooo-code-text: #26251eeb;
|
|
44
|
-
--huyooo-menu-bg: #f2f1ed;
|
|
45
|
-
--huyooo-menu-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
|
|
46
|
-
|
|
47
|
-
/* macOS window control colors (for Window 组件) */
|
|
48
|
-
--huyooo-window-close-bg: rgb(255, 95, 87);
|
|
49
|
-
--huyooo-window-close-border: rgb(224, 68, 62);
|
|
50
|
-
--huyooo-window-minimize-bg: rgb(254, 188, 46);
|
|
51
|
-
--huyooo-window-minimize-border: rgb(216, 158, 36);
|
|
52
|
-
--huyooo-window-maximize-bg: rgb(40, 200, 64);
|
|
53
|
-
--huyooo-window-maximize-border: rgb(26, 171, 41);
|
|
54
|
-
--huyooo-window-control-icon: rgba(0, 0, 0, 0.5);
|
|
55
|
-
|
|
56
|
-
/* media overlay helpers (used in FileGrid video thumbnail) */
|
|
57
|
-
--huyooo-overlay-strong: rgba(0, 0, 0, 0.85);
|
|
58
|
-
|
|
59
|
-
/* on-primary text colors (selected state etc.) */
|
|
60
|
-
--huyooo-on-primary: #ffffff;
|
|
61
|
-
--huyooo-on-primary-muted: rgba(255, 255, 255, 0.8);
|
|
62
|
-
|
|
63
|
-
/* filetype colors (FileInfoDialog / FileIcon) */
|
|
64
|
-
/* 对齐 ai-chat:文件夹/目录用主色 */
|
|
65
|
-
--huyooo-filetype-folder: var(--huyooo-primary);
|
|
66
|
-
--huyooo-filetype-image: #7ec699;
|
|
67
|
-
--huyooo-filetype-video: #c678dd;
|
|
68
|
-
--huyooo-filetype-music: #e06c75;
|
|
69
|
-
--huyooo-filetype-document: #61afef;
|
|
70
|
-
--huyooo-filetype-code: #98c379;
|
|
71
|
-
--huyooo-filetype-archive: #d19a66;
|
|
72
|
-
--huyooo-filetype-file: #abb2bf;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@media (prefers-color-scheme: dark) {
|
|
76
|
-
:root {
|
|
77
|
-
color-scheme: dark;
|
|
78
|
-
|
|
79
|
-
/* 对齐 ai-chat(dark):深灰底 + 统一蓝主色 */
|
|
80
|
-
--huyooo-bg: #1e1e1e;
|
|
81
|
-
--huyooo-surface: #1e1e1e;
|
|
82
|
-
--huyooo-surface-2: #252526;
|
|
83
|
-
--huyooo-muted: #2d2d2d;
|
|
84
|
-
--huyooo-muted-hover: #3c3c3c;
|
|
85
|
-
--huyooo-border: #333;
|
|
86
|
-
--huyooo-text: #ccc;
|
|
87
|
-
--huyooo-text-muted: #888;
|
|
88
|
-
--huyooo-text-disabled: #666;
|
|
89
|
-
--huyooo-primary: #54a9ff;
|
|
90
|
-
--huyooo-focus-ring: rgba(84, 169, 255, 0.22);
|
|
91
|
-
--huyooo-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
|
|
92
|
-
--huyooo-scrollbar: rgba(255, 255, 255, 0.2);
|
|
93
|
-
--huyooo-scrollbar-hover: rgba(255, 255, 255, 0.3);
|
|
94
|
-
--huyooo-danger: #cf2d56;
|
|
95
|
-
--huyooo-success: #1f8a65;
|
|
96
|
-
--huyooo-warning: #f59e0b;
|
|
97
|
-
--huyooo-danger-bg: rgba(207, 45, 86, 0.14);
|
|
98
|
-
--huyooo-danger-border: rgba(207, 45, 86, 0.28);
|
|
99
|
-
--huyooo-success-bg: rgba(31, 138, 101, 0.14);
|
|
100
|
-
--huyooo-success-border: rgba(31, 138, 101, 0.28);
|
|
101
|
-
--huyooo-warning-bg: rgba(245, 158, 11, 0.12);
|
|
102
|
-
--huyooo-warning-border: rgba(245, 158, 11, 0.25);
|
|
103
|
-
--huyooo-overlay: rgba(0, 0, 0, 0.6);
|
|
104
|
-
--huyooo-panel-bg: #252526;
|
|
105
|
-
--huyooo-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
106
|
-
--huyooo-code-bg: #1f2937;
|
|
107
|
-
--huyooo-code-text: #e5e7eb;
|
|
108
|
-
--huyooo-menu-bg: #252526;
|
|
109
|
-
--huyooo-menu-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 4px 6px -2px rgba(0, 0, 0, 0.35);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
:root[data-theme="light"] {
|
|
114
|
-
color-scheme: light;
|
|
115
|
-
/* 显式 light 必须覆盖 prefers-color-scheme: dark 的变量 */
|
|
116
|
-
--huyooo-bg: #f7f7f4;
|
|
117
|
-
--huyooo-surface: #f2f1ed;
|
|
118
|
-
--huyooo-surface-2: #f0efeb;
|
|
119
|
-
--huyooo-muted: #ebeae5;
|
|
120
|
-
--huyooo-muted-hover: #e6e5e0;
|
|
121
|
-
--huyooo-border: #26251e1a;
|
|
122
|
-
--huyooo-text: #26251eeb;
|
|
123
|
-
--huyooo-text-muted: #26251e99;
|
|
124
|
-
--huyooo-text-disabled: #26251e66;
|
|
125
|
-
--huyooo-primary: #54a9ff;
|
|
126
|
-
--huyooo-focus-ring: rgba(84, 169, 255, 0.18);
|
|
127
|
-
--huyooo-shadow-sm: 0 1px 2px 0 rgba(38, 37, 30, 0.08);
|
|
128
|
-
--huyooo-scrollbar: rgba(38, 37, 30, 0.2);
|
|
129
|
-
--huyooo-scrollbar-hover: rgba(38, 37, 30, 0.3);
|
|
130
|
-
--huyooo-danger: #cf2d56;
|
|
131
|
-
--huyooo-success: #1f8a65;
|
|
132
|
-
--huyooo-warning: rgb(245, 158, 11);
|
|
133
|
-
--huyooo-danger-bg: rgba(207, 45, 86, 0.1);
|
|
134
|
-
--huyooo-danger-border: rgba(207, 45, 86, 0.22);
|
|
135
|
-
--huyooo-success-bg: rgba(31, 138, 101, 0.1);
|
|
136
|
-
--huyooo-success-border: rgba(31, 138, 101, 0.22);
|
|
137
|
-
--huyooo-warning-bg: rgba(255, 251, 235, 0.92);
|
|
138
|
-
--huyooo-warning-border: rgba(253, 230, 138, 0.9);
|
|
139
|
-
--huyooo-overlay: rgba(0, 0, 0, 0.5);
|
|
140
|
-
--huyooo-panel-bg: #f2f1ed;
|
|
141
|
-
--huyooo-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
142
|
-
--huyooo-code-bg: #f2f1ed;
|
|
143
|
-
--huyooo-code-text: #26251eeb;
|
|
144
|
-
--huyooo-menu-bg: #f2f1ed;
|
|
145
|
-
--huyooo-menu-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
|
|
146
|
-
--huyooo-filetype-folder: var(--huyooo-primary);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
:root[data-theme="dark"] {
|
|
150
|
-
color-scheme: dark;
|
|
151
|
-
|
|
152
|
-
/* 显式 dark 必须覆盖 light 的变量 */
|
|
153
|
-
--huyooo-bg: #1e1e1e;
|
|
154
|
-
--huyooo-surface: #1e1e1e;
|
|
155
|
-
--huyooo-surface-2: #252526;
|
|
156
|
-
--huyooo-muted: #2d2d2d;
|
|
157
|
-
--huyooo-muted-hover: #3c3c3c;
|
|
158
|
-
--huyooo-border: #333;
|
|
159
|
-
--huyooo-text: #ccc;
|
|
160
|
-
--huyooo-text-muted: #888;
|
|
161
|
-
--huyooo-text-disabled: #666;
|
|
162
|
-
--huyooo-primary: #54a9ff;
|
|
163
|
-
--huyooo-focus-ring: rgba(84, 169, 255, 0.22);
|
|
164
|
-
--huyooo-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
|
|
165
|
-
--huyooo-scrollbar: rgba(255, 255, 255, 0.2);
|
|
166
|
-
--huyooo-scrollbar-hover: rgba(255, 255, 255, 0.3);
|
|
167
|
-
--huyooo-danger: #cf2d56;
|
|
168
|
-
--huyooo-success: #1f8a65;
|
|
169
|
-
--huyooo-warning: #f59e0b;
|
|
170
|
-
--huyooo-danger-bg: rgba(207, 45, 86, 0.14);
|
|
171
|
-
--huyooo-danger-border: rgba(207, 45, 86, 0.28);
|
|
172
|
-
--huyooo-success-bg: rgba(31, 138, 101, 0.14);
|
|
173
|
-
--huyooo-success-border: rgba(31, 138, 101, 0.28);
|
|
174
|
-
--huyooo-warning-bg: rgba(245, 158, 11, 0.12);
|
|
175
|
-
--huyooo-warning-border: rgba(245, 158, 11, 0.25);
|
|
176
|
-
--huyooo-overlay: rgba(0, 0, 0, 0.6);
|
|
177
|
-
--huyooo-panel-bg: #252526;
|
|
178
|
-
--huyooo-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
|
179
|
-
--huyooo-code-bg: #1f2937;
|
|
180
|
-
--huyooo-code-text: #e5e7eb;
|
|
181
|
-
--huyooo-menu-bg: #252526;
|
|
182
|
-
--huyooo-menu-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 4px 6px -2px rgba(0, 0, 0, 0.35);
|
|
183
|
-
--huyooo-filetype-folder: var(--huyooo-primary);
|
|
184
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// 主题 token(全局 CSS 变量)
|
|
2
|
-
import './index.css';
|
|
3
|
-
|
|
4
|
-
// Types
|
|
5
|
-
export * from './types';
|
|
6
|
-
|
|
7
|
-
// Core Components
|
|
8
|
-
export { FileListView, type FileListViewHandle } from './components/FileListView';
|
|
9
|
-
export { FileSidebar } from './components/FileSidebar';
|
|
10
|
-
export { Toolbar } from './components/Toolbar';
|
|
11
|
-
export { Breadcrumb } from './components/Breadcrumb';
|
|
12
|
-
export { StatusBar } from './components/StatusBar';
|
|
13
|
-
|
|
14
|
-
// Base Components
|
|
15
|
-
export { FileIcon } from './components/FileIcon';
|
|
16
|
-
export { FileGrid } from './components/FileGrid';
|
|
17
|
-
export { FileList } from './components/FileList';
|
|
18
|
-
export { ContextMenu } from './components/ContextMenu';
|
|
19
|
-
export { SortIndicator } from './components/SortIndicator';
|
|
20
|
-
|
|
21
|
-
// Window Component
|
|
22
|
-
export { Window } from './components/Window';
|
|
23
|
-
|
|
24
|
-
// Dialog Components
|
|
25
|
-
export { CompressDialog } from './components/CompressDialog';
|
|
26
|
-
export type { CompressOptions, CompressFormat, CompressLevel } from './types';
|
|
27
|
-
export { ProgressDialog, type ProgressInfo, type ProgressStatus } from './components/ProgressDialog';
|
|
28
|
-
export { FileInfoDialog, type FileInfoDialogProps } from './components/FileInfoDialog';
|
|
29
|
-
|
|
30
|
-
// Hooks
|
|
31
|
-
export { useSelection } from './hooks/useSelection';
|
|
32
|
-
export { useDragAndDrop } from './hooks/useDragAndDrop';
|
|
33
|
-
export { useMediaPlayer } from './hooks/useMediaPlayer';
|
|
34
|
-
export { useWindowDrag } from './hooks/useWindowDrag';
|
|
35
|
-
export { useWindowResize } from './hooks/useWindowResize';
|
|
36
|
-
export { useApplicationIcon } from './hooks/useApplicationIcon';
|
|
37
|
-
|
package/src/types/index.ts
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 文件类型(使用 const object 而非 enum,更好的 tree-shaking)
|
|
3
|
-
*/
|
|
4
|
-
export const FileType = {
|
|
5
|
-
FOLDER: 'folder',
|
|
6
|
-
FILE: 'file',
|
|
7
|
-
IMAGE: 'image',
|
|
8
|
-
VIDEO: 'video',
|
|
9
|
-
MUSIC: 'music',
|
|
10
|
-
DOCUMENT: 'document',
|
|
11
|
-
CODE: 'code',
|
|
12
|
-
TEXT: 'text',
|
|
13
|
-
PDF: 'pdf',
|
|
14
|
-
ARCHIVE: 'archive',
|
|
15
|
-
APPLICATION: 'application',
|
|
16
|
-
UNKNOWN: 'unknown'
|
|
17
|
-
} as const;
|
|
18
|
-
|
|
19
|
-
export type FileType = typeof FileType[keyof typeof FileType];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 文件系统项
|
|
23
|
-
*/
|
|
24
|
-
export interface FileItem {
|
|
25
|
-
/** 唯一标识(通常是完整路径) */
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
type: FileType;
|
|
29
|
-
size?: string;
|
|
30
|
-
dateModified?: string;
|
|
31
|
-
url?: string;
|
|
32
|
-
thumbnailUrl?: string;
|
|
33
|
-
children?: FileItem[];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* 视图模式
|
|
38
|
-
*/
|
|
39
|
-
export type ViewMode = 'grid' | 'list' | 'columns';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 排序配置
|
|
43
|
-
*/
|
|
44
|
-
export interface SortConfig {
|
|
45
|
-
field: 'name' | 'dateModified' | 'size' | 'type';
|
|
46
|
-
direction: 'asc' | 'desc';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 侧边栏项目
|
|
51
|
-
*/
|
|
52
|
-
export interface SidebarItem {
|
|
53
|
-
id: string;
|
|
54
|
-
label: string;
|
|
55
|
-
icon?: string;
|
|
56
|
-
path?: string;
|
|
57
|
-
children?: SidebarItem[];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 面包屑项
|
|
62
|
-
*/
|
|
63
|
-
export interface BreadcrumbItem {
|
|
64
|
-
id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 操作结果
|
|
70
|
-
*/
|
|
71
|
-
export interface OperationResult<T = void> {
|
|
72
|
-
success: boolean;
|
|
73
|
-
data?: T;
|
|
74
|
-
error?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** 压缩格式 */
|
|
78
|
-
export type CompressFormat = 'zip' | 'tar' | 'tgz' | 'tarbz2';
|
|
79
|
-
|
|
80
|
-
/** 压缩级别 */
|
|
81
|
-
export type CompressLevel = 'fast' | 'normal' | 'best';
|
|
82
|
-
|
|
83
|
-
/** 压缩选项 */
|
|
84
|
-
export interface CompressOptions {
|
|
85
|
-
format: CompressFormat;
|
|
86
|
-
level?: CompressLevel;
|
|
87
|
-
outputName: string;
|
|
88
|
-
outputDir: string;
|
|
89
|
-
deleteSource?: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** 解压选项 */
|
|
93
|
-
export interface ExtractOptions {
|
|
94
|
-
targetDir: string;
|
|
95
|
-
deleteArchive?: boolean;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/** 压缩进度 */
|
|
99
|
-
export interface CompressProgress {
|
|
100
|
-
currentFile: string;
|
|
101
|
-
processedCount: number;
|
|
102
|
-
totalCount: number;
|
|
103
|
-
percent: number;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** 压缩结果 */
|
|
107
|
-
export interface CompressResult {
|
|
108
|
-
success: boolean;
|
|
109
|
-
outputPath?: string;
|
|
110
|
-
error?: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** 进度状态 */
|
|
114
|
-
export type ProgressStatus = 'pending' | 'processing' | 'success' | 'error';
|
|
115
|
-
|
|
116
|
-
/** 进度信息(UI 使用) */
|
|
117
|
-
export interface ProgressInfo {
|
|
118
|
-
type: 'compress' | 'extract';
|
|
119
|
-
status: ProgressStatus;
|
|
120
|
-
percent: number;
|
|
121
|
-
currentFile?: string;
|
|
122
|
-
processedCount?: number;
|
|
123
|
-
totalCount?: number;
|
|
124
|
-
error?: string;
|
|
125
|
-
outputPath?: string;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* 文件操作适配器接口
|
|
130
|
-
*/
|
|
131
|
-
export interface FileExplorerAdapter {
|
|
132
|
-
/** 读取目录 */
|
|
133
|
-
readDirectory(dirPath: string): Promise<FileItem[]>;
|
|
134
|
-
/** 读取系统路径目录 */
|
|
135
|
-
readSystemPath(pathId: string): Promise<FileItem[]>;
|
|
136
|
-
/** 获取系统路径 */
|
|
137
|
-
getSystemPath(pathId: string): Promise<string | null>;
|
|
138
|
-
/** 读取文件内容 */
|
|
139
|
-
readFileContent(filePath: string): Promise<string>;
|
|
140
|
-
/** 写入文件内容 */
|
|
141
|
-
writeFileContent(filePath: string, content: string): Promise<OperationResult>;
|
|
142
|
-
/** 创建文件夹 */
|
|
143
|
-
createFolder(parentDir: string, folderName: string): Promise<OperationResult<{ finalPath: string }>>;
|
|
144
|
-
/** 创建文件 */
|
|
145
|
-
createFile(parentDir: string, fileName: string, content?: string): Promise<OperationResult<{ finalPath: string }>>;
|
|
146
|
-
/** 删除文件 */
|
|
147
|
-
deleteFiles(paths: string[]): Promise<OperationResult>;
|
|
148
|
-
/** 重命名文件 */
|
|
149
|
-
renameFile(oldPath: string, newPath: string): Promise<OperationResult>;
|
|
150
|
-
/** 复制文件 */
|
|
151
|
-
copyFiles(sourcePaths: string[], targetDir: string): Promise<OperationResult<{ copiedPaths: string[] }>>;
|
|
152
|
-
/** 移动文件 */
|
|
153
|
-
moveFiles(sourcePaths: string[], targetDir: string): Promise<OperationResult<{ movedPaths: string[] }>>;
|
|
154
|
-
/** 使用系统默认应用打开 */
|
|
155
|
-
openPath(filePath: string): Promise<OperationResult>;
|
|
156
|
-
/** 复制文件到剪贴板 */
|
|
157
|
-
copyFilesToClipboard(filePaths: string[]): Promise<OperationResult>;
|
|
158
|
-
/** 获取剪贴板文件 */
|
|
159
|
-
getClipboardFiles(): Promise<OperationResult<{ files: string[] }>>;
|
|
160
|
-
/** 粘贴文件 */
|
|
161
|
-
pasteFiles(targetDir: string, sourcePaths: string[]): Promise<OperationResult<{ pastedPaths: string[] }>>;
|
|
162
|
-
/** 流式搜索文件 */
|
|
163
|
-
searchFilesStream(searchPath: string, pattern: string, searchId: string): Promise<OperationResult>;
|
|
164
|
-
/** 监听搜索结果 */
|
|
165
|
-
onSearchResults(callback: (data: { searchId: string; items: FileItem[]; done: boolean }) => void): () => void;
|
|
166
|
-
/** 压缩文件 */
|
|
167
|
-
compressFiles(sources: string[], options: CompressOptions): Promise<CompressResult>;
|
|
168
|
-
/** 解压文件 */
|
|
169
|
-
extractArchive(archivePath: string, options: ExtractOptions): Promise<CompressResult>;
|
|
170
|
-
/** 判断是否为压缩文件 */
|
|
171
|
-
isArchiveFile(filePath: string): Promise<boolean>;
|
|
172
|
-
/** 监听压缩进度 */
|
|
173
|
-
onCompressProgress(callback: (data: CompressProgress) => void): () => void;
|
|
174
|
-
/** 监听解压进度 */
|
|
175
|
-
onExtractProgress(callback: (data: CompressProgress) => void): () => void;
|
|
176
|
-
/** 监听目录变化 */
|
|
177
|
-
watchDirectory(dirPath: string, watchId: string): Promise<OperationResult>;
|
|
178
|
-
/** 停止监听目录 */
|
|
179
|
-
unwatchDirectory(watchId: string): Promise<OperationResult>;
|
|
180
|
-
/** 监听文件变化事件 */
|
|
181
|
-
onWatchEvent(callback: (data: { watchId: string; event: WatchEvent }) => void): () => void;
|
|
182
|
-
/** 显示文件/文件夹的系统属性窗口 */
|
|
183
|
-
showFileInfo(filePath: string): Promise<OperationResult>;
|
|
184
|
-
/** 在终端中打开目录 */
|
|
185
|
-
openInTerminal(dirPath: string): Promise<OperationResult>;
|
|
186
|
-
/** 通过 Cursor 打开 */
|
|
187
|
-
openInEditor(targetPath: string): Promise<OperationResult>;
|
|
188
|
-
/** 在新窗口中打开文件夹(使用系统文件管理器) */
|
|
189
|
-
openInNewWindow(folderPath: string): Promise<OperationResult>;
|
|
190
|
-
/** 请求窗口聚焦(用于右键打开菜单前激活窗口) */
|
|
191
|
-
requestWindowFocus(): void;
|
|
192
|
-
|
|
193
|
-
// ===== 媒体服务 =====
|
|
194
|
-
|
|
195
|
-
/** 检测媒体文件是否需要转码 */
|
|
196
|
-
mediaNeedsTranscode?(filePath: string): Promise<OperationResult<TranscodeInfo>>;
|
|
197
|
-
/** 获取可播放的媒体 URL(自动转码) */
|
|
198
|
-
mediaGetPlayableUrl?(filePath: string): Promise<{ success: boolean; url?: string; error?: string }>;
|
|
199
|
-
/** 获取媒体元数据 */
|
|
200
|
-
mediaGetMetadata?(filePath: string): Promise<OperationResult<MediaMetadata>>;
|
|
201
|
-
/** 监听转码进度 */
|
|
202
|
-
onMediaTranscodeProgress?(callback: (data: { filePath: string; progress: MediaTranscodeProgress }) => void): () => void;
|
|
203
|
-
/** 清理指定文件的转码缓存 */
|
|
204
|
-
mediaCleanupFile?(filePath: string): Promise<OperationResult>;
|
|
205
|
-
|
|
206
|
-
// ===== 媒体预览窗口 =====
|
|
207
|
-
|
|
208
|
-
/** 打开媒体预览窗口(原生窗口) */
|
|
209
|
-
openMediaPreviewWindow?(filePath: string, mediaType: 'image' | 'video' | 'audio'): Promise<OperationResult>;
|
|
210
|
-
/** 关闭媒体预览窗口 */
|
|
211
|
-
closeMediaPreviewWindow?(filePath: string): Promise<OperationResult>;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/** 文件变化事件类型 */
|
|
215
|
-
export type WatchEventType = 'add' | 'change' | 'remove' | 'rename';
|
|
216
|
-
|
|
217
|
-
/** 文件变化事件 */
|
|
218
|
-
export interface WatchEvent {
|
|
219
|
-
type: WatchEventType;
|
|
220
|
-
path: string;
|
|
221
|
-
filename: string;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// ===== 媒体服务类型 =====
|
|
225
|
-
|
|
226
|
-
/** 媒体转码方式 */
|
|
227
|
-
export type TranscodeMethod = 'direct' | 'remux' | 'transcode';
|
|
228
|
-
|
|
229
|
-
/** 媒体转码状态 */
|
|
230
|
-
export type TranscodeStatus = 'idle' | 'checking' | 'transcoding' | 'ready' | 'error';
|
|
231
|
-
|
|
232
|
-
/** 媒体转码信息 */
|
|
233
|
-
export interface TranscodeInfo {
|
|
234
|
-
type: 'video' | 'audio';
|
|
235
|
-
needsTranscode: boolean;
|
|
236
|
-
method: TranscodeMethod;
|
|
237
|
-
estimatedTime?: number;
|
|
238
|
-
targetFormat?: string;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/** 媒体转码进度 */
|
|
242
|
-
export interface MediaTranscodeProgress {
|
|
243
|
-
percent: number;
|
|
244
|
-
time?: number;
|
|
245
|
-
duration?: number;
|
|
246
|
-
speed?: string;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/** 媒体元数据 */
|
|
250
|
-
export interface MediaMetadata {
|
|
251
|
-
filePath: string;
|
|
252
|
-
type: 'video' | 'audio';
|
|
253
|
-
duration: number;
|
|
254
|
-
title?: string;
|
|
255
|
-
artist?: string;
|
|
256
|
-
album?: string;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* 右键菜单项
|
|
261
|
-
*/
|
|
262
|
-
export interface ContextMenuItem {
|
|
263
|
-
id: string;
|
|
264
|
-
label: string;
|
|
265
|
-
icon?: string;
|
|
266
|
-
shortcut?: string;
|
|
267
|
-
disabled?: boolean;
|
|
268
|
-
separator?: boolean;
|
|
269
|
-
danger?: boolean; // 危险操作标记(如删除)
|
|
270
|
-
checked?: boolean; // 勾选状态(显示在右侧)
|
|
271
|
-
action?: () => void;
|
|
272
|
-
children?: ContextMenuItem[];
|
|
273
|
-
}
|
|
274
|
-
|