@fde-desktop/fde-core 0.3.7 → 0.3.8
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.cjs +6392 -0
- package/dist/index.d.cts +1457 -0
- package/dist/index.d.ts +1457 -11
- package/dist/index.js +6132 -6546
- package/package.json +13 -9
- package/dist/apps/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -12
- package/dist/domain/index.d.ts +0 -5
- package/dist/fc-D_a-n3yF.js +0 -20204
- package/dist/fi-DwZ_MW7F.js +0 -9993
- package/dist/hooks/index.d.ts +0 -28
- package/dist/i18n/index.d.ts +0 -2
- package/dist/iconBase-B764UN-4.js +0 -108
- package/dist/infrastructure/index.d.ts +0 -6
- package/dist/interfaces/index.d.ts +0 -11
- package/dist/stores/index.d.ts +0 -8
- package/dist/types/index.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -14
- package/dist/vsc-CeA30gcb.js +0 -9574
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1457 @@
|
|
|
1
|
+
import * as zustand_middleware from 'zustand/middleware';
|
|
2
|
+
import * as zustand from 'zustand';
|
|
3
|
+
import * as framer_motion from 'framer-motion';
|
|
4
|
+
import { Transition, TargetAndTransition, Variants } from 'framer-motion';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import { MouseEvent, RefObject, ReactNode, FC } from 'react';
|
|
7
|
+
import { IconType } from 'react-icons';
|
|
8
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
9
|
+
import { MantineThemeOverride } from '@mantine/core';
|
|
10
|
+
export { default as i18n } from 'i18next';
|
|
11
|
+
export { v4 as uuidv4 } from 'uuid';
|
|
12
|
+
|
|
13
|
+
interface AppEntry {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
fcIcon?: string;
|
|
18
|
+
iconUrl?: string;
|
|
19
|
+
iconColor?: string;
|
|
20
|
+
defaultWidth?: number;
|
|
21
|
+
defaultHeight?: number;
|
|
22
|
+
minWidth?: number | false;
|
|
23
|
+
minHeight?: number | false;
|
|
24
|
+
canMaximize?: boolean;
|
|
25
|
+
alwaysOnTop?: boolean;
|
|
26
|
+
autoLoad?: {
|
|
27
|
+
url: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
};
|
|
30
|
+
hasContextMenu?: boolean;
|
|
31
|
+
multipleWindow?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare const DEFAULT_WINDOW_DIMENSIONS: {
|
|
35
|
+
readonly defaultWidth: 800;
|
|
36
|
+
readonly defaultHeight: 600;
|
|
37
|
+
readonly minWidth: 640;
|
|
38
|
+
readonly minHeight: 480;
|
|
39
|
+
};
|
|
40
|
+
declare const FilesApp: AppEntry;
|
|
41
|
+
declare const SettingsApp: AppEntry;
|
|
42
|
+
declare const NotepadApp: AppEntry;
|
|
43
|
+
declare const ImageViewerApp: AppEntry;
|
|
44
|
+
declare const PdfApp: AppEntry;
|
|
45
|
+
declare const UploaderApp: AppEntry;
|
|
46
|
+
declare const MenuEditApp: AppEntry;
|
|
47
|
+
declare const DeviceInfoApp: AppEntry;
|
|
48
|
+
declare const CalendarApp: AppEntry;
|
|
49
|
+
declare const CORE_APPS: AppEntry[];
|
|
50
|
+
declare const CORE_APP_IDS: string[];
|
|
51
|
+
|
|
52
|
+
interface CreateFolderOptions {
|
|
53
|
+
iconName?: string;
|
|
54
|
+
iconColor?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface FolderNode extends FileSystemNode {
|
|
58
|
+
type: 'folder';
|
|
59
|
+
children: string[];
|
|
60
|
+
iconName?: string;
|
|
61
|
+
iconColor?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type FileSystemNodeType = 'file' | 'folder';
|
|
65
|
+
type FSNode = FileNode | FolderNode;
|
|
66
|
+
|
|
67
|
+
interface FileSystemNode {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
type: FileSystemNodeType;
|
|
71
|
+
parentId: string | null;
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt: Date;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface FileNode extends FileSystemNode {
|
|
77
|
+
type: 'file';
|
|
78
|
+
content: string;
|
|
79
|
+
mimeType?: string;
|
|
80
|
+
url?: string;
|
|
81
|
+
iconName?: string;
|
|
82
|
+
iconColor?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface FsManifestFile {
|
|
86
|
+
name: string;
|
|
87
|
+
folder: string;
|
|
88
|
+
mimeType: string;
|
|
89
|
+
url: string;
|
|
90
|
+
}
|
|
91
|
+
interface FsManifest {
|
|
92
|
+
folders: string[];
|
|
93
|
+
files: FsManifestFile[];
|
|
94
|
+
}
|
|
95
|
+
interface IFileSystem {
|
|
96
|
+
initialize(): Promise<void>;
|
|
97
|
+
reinitialize(): Promise<void>;
|
|
98
|
+
isReady(): boolean;
|
|
99
|
+
isEmpty(): boolean;
|
|
100
|
+
getNode(id: string): FSNode | undefined;
|
|
101
|
+
getChildren(folderId: string): FSNode[];
|
|
102
|
+
getRootNodes(): FSNode[];
|
|
103
|
+
getAllNodes(): FSNode[];
|
|
104
|
+
createFile(name: string, content: string, parentId: string | null, url?: string): Promise<FileNode>;
|
|
105
|
+
createFolder(name: string, parentId: string | null, iconName?: string, iconColor?: string): Promise<FolderNode>;
|
|
106
|
+
updateFile(id: string, content: string): Promise<FileNode>;
|
|
107
|
+
move(id: string, newParentId: string | null): Promise<FSNode>;
|
|
108
|
+
delete(id: string): Promise<void>;
|
|
109
|
+
readFile(path: string): Promise<string>;
|
|
110
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
111
|
+
saveBlob(blob: Blob): Promise<string>;
|
|
112
|
+
/** url: `idb://{hash}` for IndexedDB, `/api/fs?action=file&path=...` for Docker */
|
|
113
|
+
getBlob(url: string): Promise<Blob | null>;
|
|
114
|
+
toBlobUrl(url: string): Promise<string | null>;
|
|
115
|
+
seed(manifest: FsManifest): Promise<void>;
|
|
116
|
+
mergeSeed(manifest: FsManifest): Promise<void>;
|
|
117
|
+
getManifestSha(): Promise<string | null>;
|
|
118
|
+
saveManifestSha(sha: string): Promise<void>;
|
|
119
|
+
clearAll(): Promise<void>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare class IndexedDBFileSystem implements IFileSystem {
|
|
123
|
+
private db;
|
|
124
|
+
private nodes;
|
|
125
|
+
private ready;
|
|
126
|
+
private initPromise;
|
|
127
|
+
private persistQueue;
|
|
128
|
+
private persistScheduled;
|
|
129
|
+
initialize(): Promise<void>;
|
|
130
|
+
private doInitialize;
|
|
131
|
+
private openDatabase;
|
|
132
|
+
private loadNodes;
|
|
133
|
+
private migrateFromLocalStorage;
|
|
134
|
+
isReady(): boolean;
|
|
135
|
+
reinitialize(): Promise<void>;
|
|
136
|
+
private persistAllNodes;
|
|
137
|
+
private schedulePersist;
|
|
138
|
+
private flushPersistQueue;
|
|
139
|
+
private persistNode;
|
|
140
|
+
private deleteNodeFromPersist;
|
|
141
|
+
saveBlob(blob: Blob): Promise<string>;
|
|
142
|
+
/** Accepts the full URL returned by saveBlob (e.g. `idb://{hash}`) */
|
|
143
|
+
getBlob(url: string): Promise<Blob | null>;
|
|
144
|
+
toBlobUrl(url: string): Promise<string | null>;
|
|
145
|
+
clearBlobs(): Promise<void>;
|
|
146
|
+
readFile(_path: string): Promise<string>;
|
|
147
|
+
writeFile(_path: string, _content: string): Promise<void>;
|
|
148
|
+
getNode(id: string): FSNode | undefined;
|
|
149
|
+
getChildren(folderId: string): FSNode[];
|
|
150
|
+
getRootNodes(): FSNode[];
|
|
151
|
+
getAllNodes(): FSNode[];
|
|
152
|
+
isEmpty(): boolean;
|
|
153
|
+
createFile(name: string, content: string, parentId: string | null, url?: string): Promise<FileNode>;
|
|
154
|
+
createFolder(name: string, parentId: string | null, iconName?: string, iconColor?: string): Promise<FolderNode>;
|
|
155
|
+
updateFile(id: string, content: string): Promise<FileNode>;
|
|
156
|
+
move(id: string, newParentId: string | null): Promise<FSNode>;
|
|
157
|
+
delete(id: string): Promise<void>;
|
|
158
|
+
getManifestSha(): Promise<string | null>;
|
|
159
|
+
saveManifestSha(sha: string): Promise<void>;
|
|
160
|
+
clearAll(): Promise<void>;
|
|
161
|
+
seed(manifest: FsManifest): Promise<void>;
|
|
162
|
+
mergeSeed(manifest: FsManifest): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Builds a folderPath → FolderNode map from a manifest, creating all intermediate
|
|
165
|
+
* subfolders (e.g. "Documents/docker") as children of their parent folders.
|
|
166
|
+
* @param mergeMode - when true, reuse existing nodes from this.nodes instead of creating new ones
|
|
167
|
+
*/
|
|
168
|
+
private buildFolderMapFromManifest;
|
|
169
|
+
private addChildToFolder;
|
|
170
|
+
private removeChildFromParent;
|
|
171
|
+
private deleteRecursive;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare class DockerFileSystemAdapter implements IFileSystem {
|
|
175
|
+
private nodes;
|
|
176
|
+
private pathToId;
|
|
177
|
+
private ready;
|
|
178
|
+
private rootFolderId;
|
|
179
|
+
private initPromise;
|
|
180
|
+
constructor();
|
|
181
|
+
initialize(): Promise<void>;
|
|
182
|
+
private doInitialize;
|
|
183
|
+
reinitialize(): Promise<void>;
|
|
184
|
+
isReady(): boolean;
|
|
185
|
+
isEmpty(): boolean;
|
|
186
|
+
getNode(id: string): FSNode | undefined;
|
|
187
|
+
getChildren(folderId: string): FSNode[];
|
|
188
|
+
getRootNodes(): FSNode[];
|
|
189
|
+
getAllNodes(): FSNode[];
|
|
190
|
+
createFile(name: string, content: string, parentId: string | null, url?: string): Promise<FileNode>;
|
|
191
|
+
createFolder(name: string, parentId: string | null, iconName?: string, iconColor?: string): Promise<FolderNode>;
|
|
192
|
+
updateFile(id: string, content: string): Promise<FileNode>;
|
|
193
|
+
move(id: string, newParentId: string | null): Promise<FSNode>;
|
|
194
|
+
delete(id: string): Promise<void>;
|
|
195
|
+
readFile(path: string): Promise<string>;
|
|
196
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
197
|
+
saveBlob(blob: Blob): Promise<string>;
|
|
198
|
+
getBlob(url: string): Promise<Blob | null>;
|
|
199
|
+
toBlobUrl(url: string): Promise<string | null>;
|
|
200
|
+
getManifestSha(): Promise<string | null>;
|
|
201
|
+
saveManifestSha(_sha: string): Promise<void>;
|
|
202
|
+
seed(_manifest: FsManifest): Promise<void>;
|
|
203
|
+
mergeSeed(_manifest: FsManifest): Promise<void>;
|
|
204
|
+
clearAll(): Promise<void>;
|
|
205
|
+
private getMimeType;
|
|
206
|
+
private getPathFromId;
|
|
207
|
+
private deleteRecursive;
|
|
208
|
+
private syncFromEntries;
|
|
209
|
+
private fetchReaddir;
|
|
210
|
+
private writeFileToServer;
|
|
211
|
+
private createDirOnServer;
|
|
212
|
+
private deleteFromServer;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface WindowEntity {
|
|
216
|
+
id: string;
|
|
217
|
+
title: string;
|
|
218
|
+
content: string;
|
|
219
|
+
x: number;
|
|
220
|
+
y: number;
|
|
221
|
+
width: number;
|
|
222
|
+
height: number;
|
|
223
|
+
minWidth?: number;
|
|
224
|
+
minHeight?: number;
|
|
225
|
+
isOpen: boolean;
|
|
226
|
+
state: WindowState;
|
|
227
|
+
zIndex: number;
|
|
228
|
+
icon?: string;
|
|
229
|
+
fcIcon?: string;
|
|
230
|
+
iconUrl?: string;
|
|
231
|
+
iconColor?: string;
|
|
232
|
+
canMaximize?: boolean;
|
|
233
|
+
alwaysOnTop?: boolean;
|
|
234
|
+
contentData?: Record<string, unknown>;
|
|
235
|
+
closeInterceptor?: () => boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
type WindowState = 'normal' | 'minimized' | 'maximized';
|
|
239
|
+
type WindowInput = Omit<WindowEntity, 'id' | 'isOpen' | 'state' | 'zIndex'>;
|
|
240
|
+
|
|
241
|
+
interface DesktopIconEntity {
|
|
242
|
+
id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
icon: string;
|
|
245
|
+
iconName?: string;
|
|
246
|
+
iconColor?: string;
|
|
247
|
+
x: number;
|
|
248
|
+
y: number;
|
|
249
|
+
appId: string;
|
|
250
|
+
nodeId?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
type DesktopIconInput = Omit<DesktopIconEntity, 'id'>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Sorts an array of filesystem nodes: folders first, then files, each group
|
|
257
|
+
* sorted alphabetically by name (locale-aware, case-insensitive).
|
|
258
|
+
*/
|
|
259
|
+
declare const sortNodes: (nodes: FSNode[]) => FSNode[];
|
|
260
|
+
type DesktopSortMode = 'default' | 'name-asc' | 'name-desc' | 'type';
|
|
261
|
+
/**
|
|
262
|
+
* Sorts desktop icons by DESKTOP_APPS_ORDER (apps first, then folders, then files).
|
|
263
|
+
*/
|
|
264
|
+
declare const sortDesktopIcons: (icons: DesktopIconEntity[]) => DesktopIconEntity[];
|
|
265
|
+
/**
|
|
266
|
+
* Sorts desktop icons by the specified mode.
|
|
267
|
+
*/
|
|
268
|
+
declare const sortDesktopIconsByMode: (icons: DesktopIconEntity[], mode: DesktopSortMode) => DesktopIconEntity[];
|
|
269
|
+
|
|
270
|
+
interface LauncherFolder {
|
|
271
|
+
id: string;
|
|
272
|
+
name: string;
|
|
273
|
+
fcIcon: string;
|
|
274
|
+
appIds: string[];
|
|
275
|
+
isExpanded: boolean;
|
|
276
|
+
isPredefined: boolean;
|
|
277
|
+
order: number;
|
|
278
|
+
}
|
|
279
|
+
interface LauncherFolderInput {
|
|
280
|
+
name: string;
|
|
281
|
+
fcIcon: string;
|
|
282
|
+
appIds?: string[];
|
|
283
|
+
isExpanded?: boolean;
|
|
284
|
+
isPredefined?: boolean;
|
|
285
|
+
order?: number;
|
|
286
|
+
}
|
|
287
|
+
declare const createLauncherFolder: (input: LauncherFolderInput) => LauncherFolder;
|
|
288
|
+
declare const updateLauncherFolder: (folder: LauncherFolder, updates: Partial<Omit<LauncherFolder, "id" | "isPredefined">>) => LauncherFolder;
|
|
289
|
+
|
|
290
|
+
interface CustomAppManifest {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
version: string;
|
|
294
|
+
icon: string;
|
|
295
|
+
iconUrl?: string;
|
|
296
|
+
entry: string;
|
|
297
|
+
window: {
|
|
298
|
+
defaultWidth?: number;
|
|
299
|
+
defaultHeight?: number;
|
|
300
|
+
minWidth?: number | false;
|
|
301
|
+
minHeight?: number | false;
|
|
302
|
+
canMaximize?: boolean;
|
|
303
|
+
alwaysOnTop?: boolean;
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
type ClipboardAction = 'copy' | 'cut' | null;
|
|
308
|
+
interface ClipboardState {
|
|
309
|
+
content: FSNode[];
|
|
310
|
+
action: ClipboardAction;
|
|
311
|
+
}
|
|
312
|
+
interface DesktopState {
|
|
313
|
+
windows: WindowEntity[];
|
|
314
|
+
openWindow: (input: WindowInput) => void;
|
|
315
|
+
closeWindow: (id: string) => void;
|
|
316
|
+
minimizeWindow: (id: string) => void;
|
|
317
|
+
maximizeWindow: (id: string) => void;
|
|
318
|
+
restoreWindow: (id: string) => void;
|
|
319
|
+
focusWindow: (id: string) => void;
|
|
320
|
+
moveWindow: (id: string, x: number, y: number) => void;
|
|
321
|
+
resizeWindow: (id: string, width: number, height: number) => void;
|
|
322
|
+
icons: DesktopIconEntity[];
|
|
323
|
+
addIcon: (input: DesktopIconInput) => void;
|
|
324
|
+
removeIcon: (id: string) => void;
|
|
325
|
+
fsNodes: FSNode[];
|
|
326
|
+
desktopFolderId: string | null;
|
|
327
|
+
isFsReady: boolean;
|
|
328
|
+
createFile: (name: string, content: string, parentId: string | null, url?: string) => Promise<FileNode>;
|
|
329
|
+
createFolder: (name: string, parentId: string | null, iconName?: string, iconColor?: string) => Promise<FolderNode>;
|
|
330
|
+
initFs: () => Promise<void>;
|
|
331
|
+
updateFile: (id: string, content: string) => Promise<void>;
|
|
332
|
+
deleteNode: (id: string) => Promise<void>;
|
|
333
|
+
moveNode: (id: string, newParentId: string | null) => Promise<void>;
|
|
334
|
+
setFsNodes: (nodes: FSNode[]) => void;
|
|
335
|
+
syncIcons: () => void;
|
|
336
|
+
clipboard: ClipboardState;
|
|
337
|
+
copyToClipboard: (nodes: FSNode[]) => void;
|
|
338
|
+
cutToClipboard: (nodes: FSNode[]) => void;
|
|
339
|
+
clearClipboard: () => void;
|
|
340
|
+
contextMenu: {
|
|
341
|
+
x: number;
|
|
342
|
+
y: number;
|
|
343
|
+
owner: string | null;
|
|
344
|
+
targetNodeId?: string;
|
|
345
|
+
};
|
|
346
|
+
openContextMenu: (x: number, y: number, owner: string, targetNodeId?: string) => void;
|
|
347
|
+
closeContextMenu: () => void;
|
|
348
|
+
filesCurrentFolderId: string | null;
|
|
349
|
+
setFilesCurrentFolderId: (id: string | null) => void;
|
|
350
|
+
mergeSeed: (manifest: FsManifest) => Promise<void>;
|
|
351
|
+
mergeDesktopApps: (appIds: readonly string[]) => void;
|
|
352
|
+
reorderDesktopApps: (appIds: readonly string[]) => void;
|
|
353
|
+
notifications: NotificationItem[];
|
|
354
|
+
addNotification: (item: NotificationItem) => void;
|
|
355
|
+
removeNotification: (id: string) => void;
|
|
356
|
+
viewportWidth: number;
|
|
357
|
+
viewportHeight: number;
|
|
358
|
+
isViewportInitialized: boolean;
|
|
359
|
+
setViewportSize: (width: number, height: number) => void;
|
|
360
|
+
desktopSortMode: DesktopSortMode;
|
|
361
|
+
filesSortMode: DesktopSortMode;
|
|
362
|
+
setDesktopSortMode: (mode: DesktopSortMode) => void;
|
|
363
|
+
setFilesSortMode: (mode: DesktopSortMode) => void;
|
|
364
|
+
launcherFolders: LauncherFolder[];
|
|
365
|
+
setLauncherFolders: (folders: LauncherFolder[]) => void;
|
|
366
|
+
createLauncherFolder: (input: LauncherFolderInput) => LauncherFolder;
|
|
367
|
+
updateLauncherFolder: (id: string, updates: Partial<Omit<LauncherFolder, 'id' | 'isPredefined'>>) => void;
|
|
368
|
+
deleteLauncherFolder: (id: string) => void;
|
|
369
|
+
moveLauncherFolder: (id: string, newOrder: number) => void;
|
|
370
|
+
addAppToFolder: (appId: string, folderId: string) => void;
|
|
371
|
+
removeAppFromFolder: (appId: string, folderId: string) => void;
|
|
372
|
+
customApps: CustomAppManifest[];
|
|
373
|
+
setCustomApps: (apps: CustomAppManifest[]) => void;
|
|
374
|
+
handleCustomAppRegistered: (manifest: CustomAppManifest) => void;
|
|
375
|
+
handleCustomAppUnregistered: (appId: string) => void;
|
|
376
|
+
}
|
|
377
|
+
interface NotificationItem {
|
|
378
|
+
id: string;
|
|
379
|
+
title: string;
|
|
380
|
+
message: string;
|
|
381
|
+
onClose?: () => void;
|
|
382
|
+
fcIcon?: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare const fileSystem: IndexedDBFileSystem | DockerFileSystemAdapter;
|
|
386
|
+
/** Sync reset for tests — clears in-memory state immediately, async DB flush follows. */
|
|
387
|
+
declare const resetFileSystem: () => void;
|
|
388
|
+
declare const resetWindowManager: () => void;
|
|
389
|
+
declare const useDesktopStore: zustand.UseBoundStore<Omit<zustand.StoreApi<DesktopState>, "setState" | "persist"> & {
|
|
390
|
+
setState(partial: DesktopState | Partial<DesktopState> | ((state: DesktopState) => DesktopState | Partial<DesktopState>), replace?: false | undefined): unknown;
|
|
391
|
+
setState(state: DesktopState | ((state: DesktopState) => DesktopState), replace: true): unknown;
|
|
392
|
+
persist: {
|
|
393
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<DesktopState, unknown, unknown>>) => void;
|
|
394
|
+
clearStorage: () => void;
|
|
395
|
+
rehydrate: () => Promise<void> | void;
|
|
396
|
+
hasHydrated: () => boolean;
|
|
397
|
+
onHydrate: (fn: (state: DesktopState) => void) => () => void;
|
|
398
|
+
onFinishHydration: (fn: (state: DesktopState) => void) => () => void;
|
|
399
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<DesktopState, unknown, unknown>>;
|
|
400
|
+
};
|
|
401
|
+
}>;
|
|
402
|
+
|
|
403
|
+
type ThemeMode = 'light' | 'dark';
|
|
404
|
+
interface Theme {
|
|
405
|
+
mode: ThemeMode;
|
|
406
|
+
desktop: string;
|
|
407
|
+
taskbar: string;
|
|
408
|
+
window: string;
|
|
409
|
+
accent: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
declare const SUPPORTED_LANGUAGES: readonly ["en", "es"];
|
|
413
|
+
type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number];
|
|
414
|
+
|
|
415
|
+
interface CustomThemeColors {
|
|
416
|
+
taskbar: string;
|
|
417
|
+
window: string;
|
|
418
|
+
accent: string;
|
|
419
|
+
}
|
|
420
|
+
interface ISettingsState {
|
|
421
|
+
wallpaper: string | null;
|
|
422
|
+
wallpaperModule: string;
|
|
423
|
+
launcherIcon: string;
|
|
424
|
+
font: string;
|
|
425
|
+
downloadedFonts: string[];
|
|
426
|
+
fontSize: number;
|
|
427
|
+
animationDuration: number;
|
|
428
|
+
theme: Theme;
|
|
429
|
+
themeSetManually: boolean;
|
|
430
|
+
customThemeColors: CustomThemeColors | null;
|
|
431
|
+
language: SupportedLanguage;
|
|
432
|
+
setWallpaper: (url: string | null) => void;
|
|
433
|
+
setWallpaperModule: (module: string) => void;
|
|
434
|
+
setLauncherIcon: (icon: string) => void;
|
|
435
|
+
setFont: (font: string) => void;
|
|
436
|
+
markFontDownloaded: (fontName: string) => void;
|
|
437
|
+
setFontSize: (size: number) => void;
|
|
438
|
+
setAnimationDuration: (duration: number) => void;
|
|
439
|
+
setThemeMode: (mode: ThemeMode) => void;
|
|
440
|
+
toggleTheme: () => void;
|
|
441
|
+
setThemeAutomatic: () => void;
|
|
442
|
+
applySystemTheme: (mode: ThemeMode) => void;
|
|
443
|
+
setCustomThemeColors: (colors: CustomThemeColors | null) => void;
|
|
444
|
+
setLanguage: (lang: SupportedLanguage) => void;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
declare const useSettingsStore: zustand.UseBoundStore<Omit<zustand.StoreApi<ISettingsState>, "setState" | "persist"> & {
|
|
448
|
+
setState(partial: ISettingsState | Partial<ISettingsState> | ((state: ISettingsState) => ISettingsState | Partial<ISettingsState>), replace?: false | undefined): unknown;
|
|
449
|
+
setState(state: ISettingsState | ((state: ISettingsState) => ISettingsState), replace: true): unknown;
|
|
450
|
+
persist: {
|
|
451
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<ISettingsState, unknown, unknown>>) => void;
|
|
452
|
+
clearStorage: () => void;
|
|
453
|
+
rehydrate: () => Promise<void> | void;
|
|
454
|
+
hasHydrated: () => boolean;
|
|
455
|
+
onHydrate: (fn: (state: ISettingsState) => void) => () => void;
|
|
456
|
+
onFinishHydration: (fn: (state: ISettingsState) => void) => () => void;
|
|
457
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<ISettingsState, unknown, unknown>>;
|
|
458
|
+
};
|
|
459
|
+
}>;
|
|
460
|
+
|
|
461
|
+
interface MountedAppState {
|
|
462
|
+
isLoaded: boolean;
|
|
463
|
+
isLoading: boolean;
|
|
464
|
+
isReady: boolean;
|
|
465
|
+
hasError: boolean;
|
|
466
|
+
error?: string;
|
|
467
|
+
mountedAt: number;
|
|
468
|
+
instance?: unknown;
|
|
469
|
+
}
|
|
470
|
+
interface CustomAppState {
|
|
471
|
+
mountedApps: Record<string, MountedAppState>;
|
|
472
|
+
registeredApps: Record<string, CustomAppManifest>;
|
|
473
|
+
hmrConnected: boolean;
|
|
474
|
+
hmrError: string | null;
|
|
475
|
+
devServerOffline: boolean;
|
|
476
|
+
hmrRetryCount: number;
|
|
477
|
+
setAppLoading: (appId: string) => void;
|
|
478
|
+
setAppLoaded: (appId: string) => void;
|
|
479
|
+
setAppReady: (appId: string, instance?: unknown) => void;
|
|
480
|
+
setAppError: (appId: string, error: string) => void;
|
|
481
|
+
clearApp: (appId: string) => void;
|
|
482
|
+
registerApp: (manifest: CustomAppManifest) => void;
|
|
483
|
+
unregisterApp: (appId: string) => void;
|
|
484
|
+
setHmrConnected: (connected: boolean) => void;
|
|
485
|
+
setHmrError: (error: string | null) => void;
|
|
486
|
+
setDevServerOffline: (offline: boolean) => void;
|
|
487
|
+
incrementHmrRetry: () => void;
|
|
488
|
+
resetHmrRetry: () => void;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare const useCustomAppStore: zustand.UseBoundStore<zustand.StoreApi<CustomAppState>>;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Store for temporary snapshots used by the `useIsDirty` hook.
|
|
495
|
+
* Each app (identified by a unique string id) can store its own snapshot.
|
|
496
|
+
* Snapshots are persisted to `localStorage` so they survive page reloads.
|
|
497
|
+
*/
|
|
498
|
+
interface AppTempMemoryState {
|
|
499
|
+
/** Mapping of appId → snapshot (any serializable value) */
|
|
500
|
+
snapshots: Record<string, unknown>;
|
|
501
|
+
/** Set a snapshot for a given appId */
|
|
502
|
+
setSnapshot: (appId: string, snapshot: unknown) => void;
|
|
503
|
+
/** Retrieve a snapshot for a given appId */
|
|
504
|
+
getSnapshot: (appId: string) => unknown | null;
|
|
505
|
+
/** Clear the snapshot for a given appId */
|
|
506
|
+
clearSnapshot: (appId: string) => void;
|
|
507
|
+
}
|
|
508
|
+
declare const useAppTempMemoryStore: zustand.UseBoundStore<Omit<zustand.StoreApi<AppTempMemoryState>, "setState" | "persist"> & {
|
|
509
|
+
setState(partial: AppTempMemoryState | Partial<AppTempMemoryState> | ((state: AppTempMemoryState) => AppTempMemoryState | Partial<AppTempMemoryState>), replace?: false | undefined): unknown;
|
|
510
|
+
setState(state: AppTempMemoryState | ((state: AppTempMemoryState) => AppTempMemoryState), replace: true): unknown;
|
|
511
|
+
persist: {
|
|
512
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<AppTempMemoryState, unknown, unknown>>) => void;
|
|
513
|
+
clearStorage: () => void;
|
|
514
|
+
rehydrate: () => Promise<void> | void;
|
|
515
|
+
hasHydrated: () => boolean;
|
|
516
|
+
onHydrate: (fn: (state: AppTempMemoryState) => void) => () => void;
|
|
517
|
+
onFinishHydration: (fn: (state: AppTempMemoryState) => void) => () => void;
|
|
518
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<AppTempMemoryState, unknown, unknown>>;
|
|
519
|
+
};
|
|
520
|
+
}>;
|
|
521
|
+
|
|
522
|
+
type OpenAppOptions$1 = {
|
|
523
|
+
/** Extra data passed to the window's content component. */
|
|
524
|
+
contentData?: Record<string, unknown>;
|
|
525
|
+
/** Override position (e.g. for the initial seed window). */
|
|
526
|
+
position?: {
|
|
527
|
+
x: number;
|
|
528
|
+
y: number;
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* Returns a stable `openApp(appId, options?)` callback that looks up app
|
|
533
|
+
* metadata from static or custom apps, picks a random desktop position
|
|
534
|
+
* (unless overridden) and calls `openWindow` on the desktop store.
|
|
535
|
+
*
|
|
536
|
+
* If `multipleWindow: true` on the app, always opens a new window.
|
|
537
|
+
* Otherwise, focuses existing window if one is already open.
|
|
538
|
+
*/
|
|
539
|
+
declare const useOpenApp: () => (appId: string, { contentData, position }?: OpenAppOptions$1) => void;
|
|
540
|
+
|
|
541
|
+
interface OpenAppOptions {
|
|
542
|
+
title?: string;
|
|
543
|
+
icon?: string;
|
|
544
|
+
contentData?: Record<string, unknown>;
|
|
545
|
+
position?: {
|
|
546
|
+
x?: number;
|
|
547
|
+
y?: number;
|
|
548
|
+
};
|
|
549
|
+
size?: {
|
|
550
|
+
width?: number;
|
|
551
|
+
height?: number;
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
interface FileDialogOptions {
|
|
555
|
+
acceptedMimeTypes?: string[];
|
|
556
|
+
multiple?: boolean;
|
|
557
|
+
defaultPath?: string;
|
|
558
|
+
}
|
|
559
|
+
interface SaveDialogOptions {
|
|
560
|
+
defaultName?: string;
|
|
561
|
+
defaultPath?: string;
|
|
562
|
+
acceptedMimeTypes?: string[];
|
|
563
|
+
}
|
|
564
|
+
interface NotificationOptions {
|
|
565
|
+
title: string;
|
|
566
|
+
message: string;
|
|
567
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
568
|
+
duration?: number;
|
|
569
|
+
}
|
|
570
|
+
type FdeEventType = 'window-opened' | 'window-closed' | 'window-focused' | 'window-minimized' | 'window-maximized' | 'file-opened' | 'file-saved' | 'theme-changed' | 'notification-shown';
|
|
571
|
+
interface FdeEventPayloads {
|
|
572
|
+
'window-opened': {
|
|
573
|
+
windowId: string;
|
|
574
|
+
content: string;
|
|
575
|
+
};
|
|
576
|
+
'window-closed': {
|
|
577
|
+
windowId: string;
|
|
578
|
+
};
|
|
579
|
+
'window-focused': {
|
|
580
|
+
windowId: string;
|
|
581
|
+
};
|
|
582
|
+
'window-minimized': {
|
|
583
|
+
windowId: string;
|
|
584
|
+
};
|
|
585
|
+
'window-maximized': {
|
|
586
|
+
windowId: string;
|
|
587
|
+
};
|
|
588
|
+
'file-opened': {
|
|
589
|
+
path: string;
|
|
590
|
+
appId?: string;
|
|
591
|
+
};
|
|
592
|
+
'file-saved': {
|
|
593
|
+
path: string;
|
|
594
|
+
success: boolean;
|
|
595
|
+
};
|
|
596
|
+
'theme-changed': {
|
|
597
|
+
theme: string;
|
|
598
|
+
};
|
|
599
|
+
'notification-shown': {
|
|
600
|
+
notificationId: string;
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
interface FdeDesktopAPI {
|
|
604
|
+
openApp: (appId: string, options?: OpenAppOptions) => void;
|
|
605
|
+
closeWindow: (windowId?: string) => void;
|
|
606
|
+
minimizeWindow: (windowId?: string) => void;
|
|
607
|
+
maximizeWindow: (windowId?: string) => void;
|
|
608
|
+
restoreWindow: (windowId?: string) => void;
|
|
609
|
+
focusWindow: (windowId?: string) => void;
|
|
610
|
+
openFile: (path: string, appId?: string) => void;
|
|
611
|
+
openFileDialog: (options?: FileDialogOptions) => Promise<string | null>;
|
|
612
|
+
saveFile: (content: string, options?: SaveDialogOptions) => Promise<boolean>;
|
|
613
|
+
saveFileDialog: (options?: SaveDialogOptions) => Promise<string | null>;
|
|
614
|
+
getTheme: () => Record<string, unknown>;
|
|
615
|
+
setTheme: (theme: Record<string, unknown>) => void;
|
|
616
|
+
showNotification: (options: NotificationOptions) => string;
|
|
617
|
+
hideNotification: (notificationId: string) => void;
|
|
618
|
+
getWindows: () => WindowEntity[];
|
|
619
|
+
getActiveWindow: () => WindowEntity | null;
|
|
620
|
+
getWindowById: (windowId: string) => WindowEntity | null;
|
|
621
|
+
fs: IFileSystem;
|
|
622
|
+
on: <T extends FdeEventType>(event: T, callback: (data: FdeEventPayloads[T]) => void) => () => void;
|
|
623
|
+
off: <T extends FdeEventType>(event: T, callback: (data: FdeEventPayloads[T]) => void) => void;
|
|
624
|
+
appReady: (appId: string) => void;
|
|
625
|
+
registerAppInstance: (appId: string, instance: unknown) => void;
|
|
626
|
+
}
|
|
627
|
+
declare global {
|
|
628
|
+
interface Window {
|
|
629
|
+
__FDE_API__?: FdeDesktopAPI;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
declare function useFdeApi(): FdeDesktopAPI | null;
|
|
634
|
+
|
|
635
|
+
declare const useNotifications: () => {
|
|
636
|
+
notifications: NotificationItem[];
|
|
637
|
+
notify: (title: string, message: string, options?: {
|
|
638
|
+
fcIcon?: string;
|
|
639
|
+
onClose?: () => void;
|
|
640
|
+
}) => string;
|
|
641
|
+
dismiss: (id: string) => void;
|
|
642
|
+
addNotification: (item: NotificationItem) => void;
|
|
643
|
+
removeNotification: (id: string) => void;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
declare const useSystemTheme: () => void;
|
|
647
|
+
|
|
648
|
+
declare const useAnimationDuration: () => {
|
|
649
|
+
duration: number;
|
|
650
|
+
windowVariants: framer_motion.Variants;
|
|
651
|
+
panelVariants: {
|
|
652
|
+
initial: {
|
|
653
|
+
opacity: number;
|
|
654
|
+
y: number;
|
|
655
|
+
scale: number;
|
|
656
|
+
};
|
|
657
|
+
animate: {
|
|
658
|
+
opacity: number;
|
|
659
|
+
y: number;
|
|
660
|
+
scale: number;
|
|
661
|
+
transition: framer_motion.Transition;
|
|
662
|
+
};
|
|
663
|
+
exit: {
|
|
664
|
+
opacity: number;
|
|
665
|
+
y: number;
|
|
666
|
+
scale: number;
|
|
667
|
+
transition: framer_motion.Transition;
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
minimizeVariant: (deltaX: number, deltaY: number) => framer_motion.TargetAndTransition;
|
|
671
|
+
restoreVariant: (deltaX: number, deltaY: number) => framer_motion.TargetAndTransition;
|
|
672
|
+
maximizeTransition: framer_motion.Transition;
|
|
673
|
+
easeIn: framer_motion.Transition;
|
|
674
|
+
easeOut: framer_motion.Transition;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
declare function useAppName(appId: string | undefined): string;
|
|
678
|
+
|
|
679
|
+
declare const useClock: () => string;
|
|
680
|
+
|
|
681
|
+
declare function useCollapsible(initialExpanded?: Set<string>): {
|
|
682
|
+
expanded: Set<string>;
|
|
683
|
+
toggle: (id: string) => void;
|
|
684
|
+
expand: (id: string) => void;
|
|
685
|
+
collapse: (id: string) => void;
|
|
686
|
+
expandAll: (ids: string[]) => void;
|
|
687
|
+
collapseAll: () => void;
|
|
688
|
+
reset: () => void;
|
|
689
|
+
isExpanded: (id: string) => boolean;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
interface MenuPosition {
|
|
693
|
+
x: number;
|
|
694
|
+
y: number;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
interface UseContextMenuReturn {
|
|
698
|
+
opened: boolean;
|
|
699
|
+
position: MenuPosition;
|
|
700
|
+
open: (e: MouseEvent, offsetY?: number) => void;
|
|
701
|
+
close: () => void;
|
|
702
|
+
}
|
|
703
|
+
declare const useContextMenu: (offsetY?: number, appId?: string) => UseContextMenuReturn;
|
|
704
|
+
|
|
705
|
+
interface DeviceInfo {
|
|
706
|
+
isMobile: boolean;
|
|
707
|
+
isTablet: boolean;
|
|
708
|
+
isDesktop: boolean;
|
|
709
|
+
isPortrait: boolean;
|
|
710
|
+
shouldShowWarning: boolean;
|
|
711
|
+
screenWidth: number;
|
|
712
|
+
screenHeight: number;
|
|
713
|
+
}
|
|
714
|
+
declare function useDeviceDetection(): DeviceInfo;
|
|
715
|
+
|
|
716
|
+
type DownloadStatus = 'idle' | 'downloading' | 'done' | 'error';
|
|
717
|
+
interface DownloadState {
|
|
718
|
+
status: DownloadStatus;
|
|
719
|
+
/** Bytes received so far */
|
|
720
|
+
loaded: number;
|
|
721
|
+
/** Total bytes, or null if Content-Length is not available */
|
|
722
|
+
total: number | null;
|
|
723
|
+
/** 0–100, or null when total is unknown */
|
|
724
|
+
percent: number | null;
|
|
725
|
+
error: string | null;
|
|
726
|
+
}
|
|
727
|
+
interface UseDownloadReturn extends DownloadState {
|
|
728
|
+
download: (url: string) => Promise<string | null>;
|
|
729
|
+
reset: () => void;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Hook for tracking streamed HTTP downloads with real-time progress.
|
|
733
|
+
* Returns a `download(url)` function that resolves with the response text
|
|
734
|
+
* (or null on error) and updates progress state as data arrives.
|
|
735
|
+
*/
|
|
736
|
+
declare const useDownload: () => UseDownloadReturn;
|
|
737
|
+
|
|
738
|
+
type IconLibrary = 'fi' | 'fc' | 'vsc';
|
|
739
|
+
declare const useDynamicIcon: (name: string, library: IconLibrary) => IconType | null;
|
|
740
|
+
declare const useFiIcon: (name: string) => IconType | null;
|
|
741
|
+
declare const useFcIcon: (name: string) => IconType | null;
|
|
742
|
+
declare const useVscIcon: (name: string) => IconType | null;
|
|
743
|
+
|
|
744
|
+
declare function useFolderName(folder: {
|
|
745
|
+
id: string;
|
|
746
|
+
name: string;
|
|
747
|
+
isPredefined: boolean;
|
|
748
|
+
}): string;
|
|
749
|
+
|
|
750
|
+
interface UseIsDirtyOptions<T> {
|
|
751
|
+
/** Mutable ref that holds the snapshot (used internally). */
|
|
752
|
+
snapshotRef: React.MutableRefObject<T | null>;
|
|
753
|
+
/** Function that returns the current state of the app. */
|
|
754
|
+
getCurrentState: () => T;
|
|
755
|
+
/** Optional initial snapshot – used when no stored snapshot exists. */
|
|
756
|
+
initialSnapshot?: T;
|
|
757
|
+
/** Optional callback invoked when the dirty flag changes. */
|
|
758
|
+
onChange?: (isDirty: boolean) => void;
|
|
759
|
+
/** Unique identifier for the app – used to persist the snapshot in the global store. */
|
|
760
|
+
appId?: string;
|
|
761
|
+
}
|
|
762
|
+
declare function useIsDirty<T>({ snapshotRef, getCurrentState, initialSnapshot, onChange, appId, }: UseIsDirtyOptions<T>): {
|
|
763
|
+
isDirty: boolean;
|
|
764
|
+
takeSnapshot: () => void;
|
|
765
|
+
reset: () => void;
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
interface UseJsDosOptions {
|
|
769
|
+
autoLoad?: {
|
|
770
|
+
url: string;
|
|
771
|
+
name?: string;
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
interface UseJsDosReturn {
|
|
775
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
776
|
+
isRunning: boolean;
|
|
777
|
+
isPaused: boolean;
|
|
778
|
+
isMuted: boolean;
|
|
779
|
+
volume: number;
|
|
780
|
+
isLoading: boolean;
|
|
781
|
+
error: string | null;
|
|
782
|
+
bundleName: string | null;
|
|
783
|
+
loadBundle: (url: string, name?: string) => Promise<void>;
|
|
784
|
+
exit: () => Promise<void>;
|
|
785
|
+
restart: () => Promise<void>;
|
|
786
|
+
pause: () => void;
|
|
787
|
+
resume: () => void;
|
|
788
|
+
mute: () => void;
|
|
789
|
+
unmute: () => void;
|
|
790
|
+
setVolume: (level: number) => void;
|
|
791
|
+
}
|
|
792
|
+
declare function useJsDos(options?: UseJsDosOptions): UseJsDosReturn;
|
|
793
|
+
|
|
794
|
+
declare function useLanguageSync(): void;
|
|
795
|
+
|
|
796
|
+
declare function useResolvedUrl(url: string | undefined): string | undefined;
|
|
797
|
+
|
|
798
|
+
declare function useSearchFilter<T>(items: T[], searchQuery: string, getSearchableText: (item: T) => string | string[]): T[];
|
|
799
|
+
|
|
800
|
+
declare const useTaskbarHeight: (opened: boolean) => {
|
|
801
|
+
menuRef: react.RefObject<HTMLDivElement | null>;
|
|
802
|
+
menuHeight: number;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
type TaskbarMenuType = 'window' | 'panel' | 'launcher' | null;
|
|
806
|
+
interface UseTaskbarContextMenuReturn {
|
|
807
|
+
activeMenu: TaskbarMenuType;
|
|
808
|
+
position: MenuPosition;
|
|
809
|
+
targetWindowId: string | null;
|
|
810
|
+
windowMenuOpened: boolean;
|
|
811
|
+
panelMenuOpened: boolean;
|
|
812
|
+
launcherMenuOpened: boolean;
|
|
813
|
+
openWindowMenu: (e: React.MouseEvent, windowId: string) => void;
|
|
814
|
+
openPanelMenu: (e: React.MouseEvent) => void;
|
|
815
|
+
openLauncherMenu: (e: React.MouseEvent) => void;
|
|
816
|
+
closeMenu: () => void;
|
|
817
|
+
}
|
|
818
|
+
declare const useTaskbarContextMenu: () => UseTaskbarContextMenuReturn;
|
|
819
|
+
|
|
820
|
+
interface RegistryContextValue {
|
|
821
|
+
register: (id: string, rect: DOMRect) => void;
|
|
822
|
+
unregister: (id: string) => void;
|
|
823
|
+
getRect: (id: string) => DOMRect | undefined;
|
|
824
|
+
}
|
|
825
|
+
declare const useWindowButtonRegistry: () => RegistryContextValue;
|
|
826
|
+
|
|
827
|
+
declare const AVAILABLE_FONTS: {
|
|
828
|
+
value: string;
|
|
829
|
+
label: string;
|
|
830
|
+
stack: string;
|
|
831
|
+
}[];
|
|
832
|
+
declare const FONT_STACKS: Record<string, string>;
|
|
833
|
+
declare const GOOGLE_FONTS_HREF: Record<string, string>;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Applies the currently selected font stack to the document root.
|
|
837
|
+
* Also re-injects <link> tags for all previously downloaded fonts on mount.
|
|
838
|
+
*/
|
|
839
|
+
declare const useApplyFont: () => void;
|
|
840
|
+
|
|
841
|
+
interface FontDownloadProgress {
|
|
842
|
+
status: 'idle' | 'downloading' | 'done' | 'error';
|
|
843
|
+
loaded: number;
|
|
844
|
+
total: number | null;
|
|
845
|
+
percent: number | null;
|
|
846
|
+
error: string | null;
|
|
847
|
+
}
|
|
848
|
+
interface FontDownloadResult {
|
|
849
|
+
font: string;
|
|
850
|
+
success: boolean;
|
|
851
|
+
}
|
|
852
|
+
declare const useFontDownload: (font: string | null) => {
|
|
853
|
+
progress: FontDownloadProgress;
|
|
854
|
+
isDownloaded: boolean;
|
|
855
|
+
reset: () => void;
|
|
856
|
+
data: FontDownloadResult;
|
|
857
|
+
error: Error;
|
|
858
|
+
isError: true;
|
|
859
|
+
isPending: false;
|
|
860
|
+
isLoading: false;
|
|
861
|
+
isLoadingError: false;
|
|
862
|
+
isRefetchError: true;
|
|
863
|
+
isSuccess: false;
|
|
864
|
+
isPlaceholderData: false;
|
|
865
|
+
status: "error";
|
|
866
|
+
dataUpdatedAt: number;
|
|
867
|
+
errorUpdatedAt: number;
|
|
868
|
+
failureCount: number;
|
|
869
|
+
failureReason: Error | null;
|
|
870
|
+
errorUpdateCount: number;
|
|
871
|
+
isFetched: boolean;
|
|
872
|
+
isFetchedAfterMount: boolean;
|
|
873
|
+
isFetching: boolean;
|
|
874
|
+
isInitialLoading: boolean;
|
|
875
|
+
isPaused: boolean;
|
|
876
|
+
isRefetching: boolean;
|
|
877
|
+
isStale: boolean;
|
|
878
|
+
isEnabled: boolean;
|
|
879
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
880
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
881
|
+
promise: Promise<FontDownloadResult>;
|
|
882
|
+
} | {
|
|
883
|
+
progress: FontDownloadProgress;
|
|
884
|
+
isDownloaded: boolean;
|
|
885
|
+
reset: () => void;
|
|
886
|
+
data: FontDownloadResult;
|
|
887
|
+
error: null;
|
|
888
|
+
isError: false;
|
|
889
|
+
isPending: false;
|
|
890
|
+
isLoading: false;
|
|
891
|
+
isLoadingError: false;
|
|
892
|
+
isRefetchError: false;
|
|
893
|
+
isSuccess: true;
|
|
894
|
+
isPlaceholderData: false;
|
|
895
|
+
status: "success";
|
|
896
|
+
dataUpdatedAt: number;
|
|
897
|
+
errorUpdatedAt: number;
|
|
898
|
+
failureCount: number;
|
|
899
|
+
failureReason: Error | null;
|
|
900
|
+
errorUpdateCount: number;
|
|
901
|
+
isFetched: boolean;
|
|
902
|
+
isFetchedAfterMount: boolean;
|
|
903
|
+
isFetching: boolean;
|
|
904
|
+
isInitialLoading: boolean;
|
|
905
|
+
isPaused: boolean;
|
|
906
|
+
isRefetching: boolean;
|
|
907
|
+
isStale: boolean;
|
|
908
|
+
isEnabled: boolean;
|
|
909
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
910
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
911
|
+
promise: Promise<FontDownloadResult>;
|
|
912
|
+
} | {
|
|
913
|
+
progress: FontDownloadProgress;
|
|
914
|
+
isDownloaded: boolean;
|
|
915
|
+
reset: () => void;
|
|
916
|
+
data: undefined;
|
|
917
|
+
error: Error;
|
|
918
|
+
isError: true;
|
|
919
|
+
isPending: false;
|
|
920
|
+
isLoading: false;
|
|
921
|
+
isLoadingError: true;
|
|
922
|
+
isRefetchError: false;
|
|
923
|
+
isSuccess: false;
|
|
924
|
+
isPlaceholderData: false;
|
|
925
|
+
status: "error";
|
|
926
|
+
dataUpdatedAt: number;
|
|
927
|
+
errorUpdatedAt: number;
|
|
928
|
+
failureCount: number;
|
|
929
|
+
failureReason: Error | null;
|
|
930
|
+
errorUpdateCount: number;
|
|
931
|
+
isFetched: boolean;
|
|
932
|
+
isFetchedAfterMount: boolean;
|
|
933
|
+
isFetching: boolean;
|
|
934
|
+
isInitialLoading: boolean;
|
|
935
|
+
isPaused: boolean;
|
|
936
|
+
isRefetching: boolean;
|
|
937
|
+
isStale: boolean;
|
|
938
|
+
isEnabled: boolean;
|
|
939
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
940
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
941
|
+
promise: Promise<FontDownloadResult>;
|
|
942
|
+
} | {
|
|
943
|
+
progress: FontDownloadProgress;
|
|
944
|
+
isDownloaded: boolean;
|
|
945
|
+
reset: () => void;
|
|
946
|
+
data: undefined;
|
|
947
|
+
error: null;
|
|
948
|
+
isError: false;
|
|
949
|
+
isPending: true;
|
|
950
|
+
isLoading: true;
|
|
951
|
+
isLoadingError: false;
|
|
952
|
+
isRefetchError: false;
|
|
953
|
+
isSuccess: false;
|
|
954
|
+
isPlaceholderData: false;
|
|
955
|
+
status: "pending";
|
|
956
|
+
dataUpdatedAt: number;
|
|
957
|
+
errorUpdatedAt: number;
|
|
958
|
+
failureCount: number;
|
|
959
|
+
failureReason: Error | null;
|
|
960
|
+
errorUpdateCount: number;
|
|
961
|
+
isFetched: boolean;
|
|
962
|
+
isFetchedAfterMount: boolean;
|
|
963
|
+
isFetching: boolean;
|
|
964
|
+
isInitialLoading: boolean;
|
|
965
|
+
isPaused: boolean;
|
|
966
|
+
isRefetching: boolean;
|
|
967
|
+
isStale: boolean;
|
|
968
|
+
isEnabled: boolean;
|
|
969
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
970
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
971
|
+
promise: Promise<FontDownloadResult>;
|
|
972
|
+
} | {
|
|
973
|
+
progress: FontDownloadProgress;
|
|
974
|
+
isDownloaded: boolean;
|
|
975
|
+
reset: () => void;
|
|
976
|
+
data: undefined;
|
|
977
|
+
error: null;
|
|
978
|
+
isError: false;
|
|
979
|
+
isPending: true;
|
|
980
|
+
isLoadingError: false;
|
|
981
|
+
isRefetchError: false;
|
|
982
|
+
isSuccess: false;
|
|
983
|
+
isPlaceholderData: false;
|
|
984
|
+
status: "pending";
|
|
985
|
+
dataUpdatedAt: number;
|
|
986
|
+
errorUpdatedAt: number;
|
|
987
|
+
failureCount: number;
|
|
988
|
+
failureReason: Error | null;
|
|
989
|
+
errorUpdateCount: number;
|
|
990
|
+
isFetched: boolean;
|
|
991
|
+
isFetchedAfterMount: boolean;
|
|
992
|
+
isFetching: boolean;
|
|
993
|
+
isLoading: boolean;
|
|
994
|
+
isInitialLoading: boolean;
|
|
995
|
+
isPaused: boolean;
|
|
996
|
+
isRefetching: boolean;
|
|
997
|
+
isStale: boolean;
|
|
998
|
+
isEnabled: boolean;
|
|
999
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
1000
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1001
|
+
promise: Promise<FontDownloadResult>;
|
|
1002
|
+
} | {
|
|
1003
|
+
progress: FontDownloadProgress;
|
|
1004
|
+
isDownloaded: boolean;
|
|
1005
|
+
reset: () => void;
|
|
1006
|
+
data: FontDownloadResult;
|
|
1007
|
+
isError: false;
|
|
1008
|
+
error: null;
|
|
1009
|
+
isPending: false;
|
|
1010
|
+
isLoading: false;
|
|
1011
|
+
isLoadingError: false;
|
|
1012
|
+
isRefetchError: false;
|
|
1013
|
+
isSuccess: true;
|
|
1014
|
+
isPlaceholderData: true;
|
|
1015
|
+
status: "success";
|
|
1016
|
+
dataUpdatedAt: number;
|
|
1017
|
+
errorUpdatedAt: number;
|
|
1018
|
+
failureCount: number;
|
|
1019
|
+
failureReason: Error | null;
|
|
1020
|
+
errorUpdateCount: number;
|
|
1021
|
+
isFetched: boolean;
|
|
1022
|
+
isFetchedAfterMount: boolean;
|
|
1023
|
+
isFetching: boolean;
|
|
1024
|
+
isInitialLoading: boolean;
|
|
1025
|
+
isPaused: boolean;
|
|
1026
|
+
isRefetching: boolean;
|
|
1027
|
+
isStale: boolean;
|
|
1028
|
+
isEnabled: boolean;
|
|
1029
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<FontDownloadResult, Error>>;
|
|
1030
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
1031
|
+
promise: Promise<FontDownloadResult>;
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
interface AdaptiveDimensions {
|
|
1035
|
+
defaultWidth: number;
|
|
1036
|
+
defaultHeight: number;
|
|
1037
|
+
minWidth: number;
|
|
1038
|
+
minHeight: number;
|
|
1039
|
+
}
|
|
1040
|
+
declare function useAdaptiveDimensions(): AdaptiveDimensions;
|
|
1041
|
+
|
|
1042
|
+
type AppReloadCallback = (appId: string) => void;
|
|
1043
|
+
type AppRegisteredCallback = (manifest: CustomAppManifest) => void;
|
|
1044
|
+
type AppUnregisteredCallback = (appId: string) => void;
|
|
1045
|
+
interface HMRCallbacks {
|
|
1046
|
+
onReload: AppReloadCallback;
|
|
1047
|
+
onRegistered?: AppRegisteredCallback;
|
|
1048
|
+
onUnregistered?: AppUnregisteredCallback;
|
|
1049
|
+
}
|
|
1050
|
+
declare function useCustomAppHMR(callbacksArg: HMRCallbacks): void;
|
|
1051
|
+
|
|
1052
|
+
type LoadingState = 'idle' | 'fetching' | 'compiling' | 'loading' | 'ready' | 'error';
|
|
1053
|
+
|
|
1054
|
+
interface MenuItemAction {
|
|
1055
|
+
type: 'item';
|
|
1056
|
+
label: string;
|
|
1057
|
+
icon?: string;
|
|
1058
|
+
onClick: () => void;
|
|
1059
|
+
disabled?: boolean;
|
|
1060
|
+
}
|
|
1061
|
+
interface MenuItemDivider {
|
|
1062
|
+
type: 'divider';
|
|
1063
|
+
}
|
|
1064
|
+
interface MenuItemSlider {
|
|
1065
|
+
type: 'slider';
|
|
1066
|
+
label?: string;
|
|
1067
|
+
min: number;
|
|
1068
|
+
max: number;
|
|
1069
|
+
value: number;
|
|
1070
|
+
onChange: (value: number) => void;
|
|
1071
|
+
labelFormat?: (value: number) => string;
|
|
1072
|
+
}
|
|
1073
|
+
type MenuItem = MenuItemAction | MenuItemDivider | MenuItemSlider;
|
|
1074
|
+
interface AppMenuDropdown {
|
|
1075
|
+
type: 'menu';
|
|
1076
|
+
label: string;
|
|
1077
|
+
icon?: string;
|
|
1078
|
+
items: MenuItem[];
|
|
1079
|
+
rightSection?: ReactNode;
|
|
1080
|
+
}
|
|
1081
|
+
interface AppMenuCombobox {
|
|
1082
|
+
type: 'combobox';
|
|
1083
|
+
label?: string;
|
|
1084
|
+
options: string[];
|
|
1085
|
+
value: string;
|
|
1086
|
+
onChange: (value: string) => void;
|
|
1087
|
+
}
|
|
1088
|
+
interface AppMenuSwitch {
|
|
1089
|
+
type: 'switch';
|
|
1090
|
+
label: string;
|
|
1091
|
+
checked: boolean;
|
|
1092
|
+
onChange: (value: boolean) => void;
|
|
1093
|
+
}
|
|
1094
|
+
interface AppMenuSlider {
|
|
1095
|
+
type: 'slider';
|
|
1096
|
+
label?: string;
|
|
1097
|
+
min: number;
|
|
1098
|
+
max: number;
|
|
1099
|
+
value: number;
|
|
1100
|
+
onChange: (value: number) => void;
|
|
1101
|
+
marks?: {
|
|
1102
|
+
value: number;
|
|
1103
|
+
label?: string;
|
|
1104
|
+
}[];
|
|
1105
|
+
labelFormat?: (value: number) => string;
|
|
1106
|
+
}
|
|
1107
|
+
interface AppMenuTextInput {
|
|
1108
|
+
type: 'text-input';
|
|
1109
|
+
placeholder?: string;
|
|
1110
|
+
value: string;
|
|
1111
|
+
onChange: (value: string) => void;
|
|
1112
|
+
}
|
|
1113
|
+
interface AppMenuNumberInput {
|
|
1114
|
+
type: 'number-input';
|
|
1115
|
+
label?: string;
|
|
1116
|
+
value: number;
|
|
1117
|
+
onChange: (value: number) => void;
|
|
1118
|
+
min?: number;
|
|
1119
|
+
max?: number;
|
|
1120
|
+
step?: number;
|
|
1121
|
+
placeholder?: string;
|
|
1122
|
+
}
|
|
1123
|
+
interface AppMenuSelect {
|
|
1124
|
+
type: 'select';
|
|
1125
|
+
label?: string;
|
|
1126
|
+
options: {
|
|
1127
|
+
value: string;
|
|
1128
|
+
label: string;
|
|
1129
|
+
}[];
|
|
1130
|
+
value: string;
|
|
1131
|
+
onChange: (value: string) => void;
|
|
1132
|
+
}
|
|
1133
|
+
interface AppMenuDirtyIndicator {
|
|
1134
|
+
type: 'dirty-indicator';
|
|
1135
|
+
}
|
|
1136
|
+
type AppMenuElement = AppMenuDropdown | AppMenuCombobox | AppMenuSwitch | AppMenuSlider | AppMenuTextInput | AppMenuNumberInput | AppMenuSelect | AppMenuDirtyIndicator;
|
|
1137
|
+
|
|
1138
|
+
interface WindowContentProps {
|
|
1139
|
+
window?: WindowEntity;
|
|
1140
|
+
notifyReady?: (contentData?: Record<string, unknown>) => void;
|
|
1141
|
+
}
|
|
1142
|
+
type AppComponent = FC<WindowContentProps>;
|
|
1143
|
+
type MenuBarBuilder = (window: WindowEntity) => AppMenuElement[] | undefined;
|
|
1144
|
+
interface MenuBarComponentProps {
|
|
1145
|
+
windowId: string;
|
|
1146
|
+
onExit: () => void;
|
|
1147
|
+
contentData?: Record<string, unknown>;
|
|
1148
|
+
}
|
|
1149
|
+
type MenuBarComponent = FC<MenuBarComponentProps>;
|
|
1150
|
+
interface AppRegistration {
|
|
1151
|
+
component: AppComponent;
|
|
1152
|
+
buildMenuBar?: MenuBarBuilder;
|
|
1153
|
+
MenuBarComponent?: MenuBarComponent;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
type Runtime = 'browser' | 'docker' | 'electron';
|
|
1157
|
+
/**
|
|
1158
|
+
* Detects the current runtime environment.
|
|
1159
|
+
* - browser: Standard web browser
|
|
1160
|
+
* - docker: Running inside Docker container (detected via injected flag)
|
|
1161
|
+
* - electron: Electron desktop app
|
|
1162
|
+
*/
|
|
1163
|
+
declare function getRuntime(): Runtime;
|
|
1164
|
+
declare function isDocker(): boolean;
|
|
1165
|
+
declare function isElectron(): boolean;
|
|
1166
|
+
declare function isBrowser(): boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Detects if running in development mode.
|
|
1169
|
+
* - Checks window.__IS_DEV__ flag (injected by Docker entrypoint)
|
|
1170
|
+
* - Falls back to hostname detection for local development
|
|
1171
|
+
*/
|
|
1172
|
+
declare function isDev(): boolean;
|
|
1173
|
+
|
|
1174
|
+
declare function generateUUID(): string;
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Waits for a DOM element with the given ID to appear in the document.
|
|
1178
|
+
* Uses polling with 1 second intervals.
|
|
1179
|
+
*
|
|
1180
|
+
* @param containerId - The ID of the container element to wait for (without #)
|
|
1181
|
+
* @param timeout - Maximum time to wait in milliseconds (default: 5000)
|
|
1182
|
+
* @returns Promise that resolves with the container element
|
|
1183
|
+
* @throws Error if container is not found within timeout
|
|
1184
|
+
*/
|
|
1185
|
+
declare function waitForContainer(containerId: string, timeout?: number): Promise<HTMLElement>;
|
|
1186
|
+
|
|
1187
|
+
declare function getBaseUrl(): string;
|
|
1188
|
+
declare function resolveUrl(relativeUrl: string): string;
|
|
1189
|
+
|
|
1190
|
+
declare function formatBytes(bytes: number): string;
|
|
1191
|
+
|
|
1192
|
+
declare function hashBlob(blob: Blob): Promise<string>;
|
|
1193
|
+
|
|
1194
|
+
declare function getAppIdForMime(mimeType: string | undefined): string;
|
|
1195
|
+
declare function getAppIdForMime(node: FileNode): {
|
|
1196
|
+
appId: string;
|
|
1197
|
+
contentData: Record<string, unknown>;
|
|
1198
|
+
} | null;
|
|
1199
|
+
|
|
1200
|
+
declare function getMimeTypeFromExtension(filename: string): string | undefined;
|
|
1201
|
+
|
|
1202
|
+
declare const getFileExtension: (name: string) => string;
|
|
1203
|
+
|
|
1204
|
+
declare function getFourRandomColors(count?: number): string[];
|
|
1205
|
+
|
|
1206
|
+
type Breadcrumb = {
|
|
1207
|
+
id: string | null;
|
|
1208
|
+
name: string;
|
|
1209
|
+
};
|
|
1210
|
+
/**
|
|
1211
|
+
* Builds a breadcrumb trail from the root to the given folder.
|
|
1212
|
+
* Always starts with `{ id: null, name: 'Home' }`.
|
|
1213
|
+
*/
|
|
1214
|
+
declare const buildBreadcrumbs: (currentFolderId: string | null, fsNodes: FSNode[]) => Breadcrumb[];
|
|
1215
|
+
|
|
1216
|
+
declare const isNewerVersion: (latest: string, current: string) => boolean;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Clears all browser data: Service Workers, Cache API, IndexedDB, localStorage, sessionStorage.
|
|
1220
|
+
* Useful for tests and for the reset settings feature.
|
|
1221
|
+
*/
|
|
1222
|
+
interface ClearBrowserDataOptions {
|
|
1223
|
+
/** If true, keep IndexedDB databases (user files) */
|
|
1224
|
+
keepIndexedDB?: boolean;
|
|
1225
|
+
/** If true, keep Service Workers registered */
|
|
1226
|
+
keepServiceWorker?: boolean;
|
|
1227
|
+
/** If true, keep localStorage */
|
|
1228
|
+
keepLocalStorage?: boolean;
|
|
1229
|
+
/** If true, keep sessionStorage */
|
|
1230
|
+
keepSessionStorage?: boolean;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Clears all browser data with configurable options.
|
|
1234
|
+
*
|
|
1235
|
+
* @param options - Configuration options for what to keep
|
|
1236
|
+
*
|
|
1237
|
+
* @example
|
|
1238
|
+
* // Clear everything (full reset)
|
|
1239
|
+
* await clearBrowserData();
|
|
1240
|
+
*
|
|
1241
|
+
* @example
|
|
1242
|
+
* // Keep user files (IndexedDB)
|
|
1243
|
+
* await clearBrowserData({ keepIndexedDB: true });
|
|
1244
|
+
*
|
|
1245
|
+
* @example
|
|
1246
|
+
* // Keep everything except cache
|
|
1247
|
+
* await clearBrowserData({ keepIndexedDB: true, keepServiceWorker: true, keepLocalStorage: true });
|
|
1248
|
+
*/
|
|
1249
|
+
declare function clearBrowserData(options?: ClearBrowserDataOptions): Promise<void>;
|
|
1250
|
+
|
|
1251
|
+
declare const WelcomeApp: AppEntry;
|
|
1252
|
+
declare const StorybookApp: AppEntry;
|
|
1253
|
+
declare const LinkedinApp: AppEntry;
|
|
1254
|
+
declare const GithubApp: AppEntry;
|
|
1255
|
+
declare const TerminalApp: AppEntry;
|
|
1256
|
+
declare const CodeServerApp: AppEntry;
|
|
1257
|
+
declare const DosEmulatorApp: AppEntry;
|
|
1258
|
+
declare const DoomApp: AppEntry;
|
|
1259
|
+
declare const EXTRA_APPS: AppEntry[];
|
|
1260
|
+
declare const EXTRA_APP_IDS: string[];
|
|
1261
|
+
|
|
1262
|
+
declare const APPS: AppEntry[];
|
|
1263
|
+
declare const DESKTOP_APPS_ORDER: string[];
|
|
1264
|
+
declare function registerCustomApps(apps: AppEntry[]): void;
|
|
1265
|
+
declare function registerDesktopApps(appIds: string[]): void;
|
|
1266
|
+
|
|
1267
|
+
declare const APP_IDS: {
|
|
1268
|
+
readonly WELCOME: "welcome";
|
|
1269
|
+
readonly NOTEPAD: "notepad";
|
|
1270
|
+
readonly UPLOADER: "uploader";
|
|
1271
|
+
readonly FILES: "files";
|
|
1272
|
+
readonly SETTINGS: "settings";
|
|
1273
|
+
readonly PDF: "pdf";
|
|
1274
|
+
readonly CALENDAR: "calendar";
|
|
1275
|
+
readonly STORYBOOK: "storybook";
|
|
1276
|
+
readonly LINKEDIN: "linkedin";
|
|
1277
|
+
readonly GITHUB: "github";
|
|
1278
|
+
readonly IMAGE_VIEWER: "image-viewer";
|
|
1279
|
+
readonly DOS_EMULATOR: "dos-emulator";
|
|
1280
|
+
readonly DOOM: "doom";
|
|
1281
|
+
readonly TERMINAL: "terminal";
|
|
1282
|
+
readonly CODE_SERVER: "code-server";
|
|
1283
|
+
readonly DEVICE_INFO: "device-info";
|
|
1284
|
+
readonly MENUEDIT: "menuedit";
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1287
|
+
declare const CUSTOM_APPS_FOLDER_ID = "launcher-folder-custom-apps";
|
|
1288
|
+
declare const DEFAULT_LAUNCHER_FOLDERS: LauncherFolder[];
|
|
1289
|
+
|
|
1290
|
+
declare const BREAKPOINTS: {
|
|
1291
|
+
readonly MOBILE: 768;
|
|
1292
|
+
readonly TABLET: 1024;
|
|
1293
|
+
readonly DESKTOP: 1280;
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
declare const TASKBAR_HEIGHT = 48;
|
|
1297
|
+
declare const ICON_COLUMN_WIDTH = 80;
|
|
1298
|
+
declare const ICON_ROW_HEIGHT = 80;
|
|
1299
|
+
declare const ICON_MARGIN = 20;
|
|
1300
|
+
declare const DEFAULT_VIEWPORT_WIDTH: 1280;
|
|
1301
|
+
declare const DEFAULT_VIEWPORT_HEIGHT: 800;
|
|
1302
|
+
|
|
1303
|
+
declare const DEFAULT_THEME_COLORS: Record<ThemeMode, Theme>;
|
|
1304
|
+
|
|
1305
|
+
declare const PRESET_COLORS: string[];
|
|
1306
|
+
|
|
1307
|
+
declare const PRESET_ICONS: string[];
|
|
1308
|
+
|
|
1309
|
+
declare const ANIMATION_DURATION = 0.3;
|
|
1310
|
+
declare const createEaseIn: (duration: number) => Transition;
|
|
1311
|
+
declare const createEaseOut: (duration: number) => Transition;
|
|
1312
|
+
declare const createWindowVariants: (duration: number) => Variants;
|
|
1313
|
+
declare const createPanelVariants: (duration: number) => {
|
|
1314
|
+
initial: {
|
|
1315
|
+
opacity: number;
|
|
1316
|
+
y: number;
|
|
1317
|
+
scale: number;
|
|
1318
|
+
};
|
|
1319
|
+
animate: {
|
|
1320
|
+
opacity: number;
|
|
1321
|
+
y: number;
|
|
1322
|
+
scale: number;
|
|
1323
|
+
transition: Transition;
|
|
1324
|
+
};
|
|
1325
|
+
exit: {
|
|
1326
|
+
opacity: number;
|
|
1327
|
+
y: number;
|
|
1328
|
+
scale: number;
|
|
1329
|
+
transition: Transition;
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
declare const createMinimizeVariant: (duration: number) => (deltaX: number, deltaY: number) => TargetAndTransition;
|
|
1333
|
+
declare const createRestoreVariant: (duration: number) => (deltaX: number, deltaY: number) => TargetAndTransition;
|
|
1334
|
+
declare const createMaximizeTransition: (duration: number) => Transition;
|
|
1335
|
+
declare const EASE_IN: Transition;
|
|
1336
|
+
declare const EASE_OUT: Transition;
|
|
1337
|
+
declare const windowVariants: Variants;
|
|
1338
|
+
declare const panelVariants: {
|
|
1339
|
+
initial: {
|
|
1340
|
+
opacity: number;
|
|
1341
|
+
y: number;
|
|
1342
|
+
scale: number;
|
|
1343
|
+
};
|
|
1344
|
+
animate: {
|
|
1345
|
+
opacity: number;
|
|
1346
|
+
y: number;
|
|
1347
|
+
scale: number;
|
|
1348
|
+
transition: Transition;
|
|
1349
|
+
};
|
|
1350
|
+
exit: {
|
|
1351
|
+
opacity: number;
|
|
1352
|
+
y: number;
|
|
1353
|
+
scale: number;
|
|
1354
|
+
transition: Transition;
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
declare const minimizeVariant: (deltaX: number, deltaY: number) => TargetAndTransition;
|
|
1358
|
+
declare const restoreVariant: (deltaX: number, deltaY: number) => TargetAndTransition;
|
|
1359
|
+
declare const openVariants: {
|
|
1360
|
+
readonly scale: {
|
|
1361
|
+
readonly hidden: {
|
|
1362
|
+
readonly opacity: 0;
|
|
1363
|
+
readonly scale: 0.92;
|
|
1364
|
+
readonly y: 12;
|
|
1365
|
+
};
|
|
1366
|
+
readonly visible: {
|
|
1367
|
+
readonly opacity: 1;
|
|
1368
|
+
readonly scale: 1;
|
|
1369
|
+
readonly y: 0;
|
|
1370
|
+
readonly transition: Transition;
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
readonly slide: {
|
|
1374
|
+
readonly hidden: {
|
|
1375
|
+
readonly opacity: 0;
|
|
1376
|
+
readonly y: 40;
|
|
1377
|
+
};
|
|
1378
|
+
readonly visible: {
|
|
1379
|
+
readonly opacity: 1;
|
|
1380
|
+
readonly y: 0;
|
|
1381
|
+
readonly transition: Transition;
|
|
1382
|
+
};
|
|
1383
|
+
};
|
|
1384
|
+
readonly fade: {
|
|
1385
|
+
readonly hidden: {
|
|
1386
|
+
readonly opacity: 0;
|
|
1387
|
+
};
|
|
1388
|
+
readonly visible: {
|
|
1389
|
+
readonly opacity: 1;
|
|
1390
|
+
readonly transition: Transition;
|
|
1391
|
+
};
|
|
1392
|
+
};
|
|
1393
|
+
};
|
|
1394
|
+
declare const maximizeTransition: Transition;
|
|
1395
|
+
declare const randomWindowPosition: () => {
|
|
1396
|
+
x: number;
|
|
1397
|
+
y: number;
|
|
1398
|
+
};
|
|
1399
|
+
declare const centerWindowPosition: (viewportWidth: number, viewportHeight: number, windowWidth: number, windowHeight: number) => {
|
|
1400
|
+
x: number;
|
|
1401
|
+
y: number;
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
declare const createWindow: (input: WindowInput) => WindowEntity;
|
|
1405
|
+
|
|
1406
|
+
declare const createDesktopIcon: (input: DesktopIconInput) => DesktopIconEntity;
|
|
1407
|
+
|
|
1408
|
+
declare function initializeFdeApi(): void;
|
|
1409
|
+
declare function isFdeApiInitialized(): boolean;
|
|
1410
|
+
|
|
1411
|
+
interface IWindowManager {
|
|
1412
|
+
getAll(): WindowEntity[];
|
|
1413
|
+
getById(id: string): WindowEntity | undefined;
|
|
1414
|
+
open(input: WindowInput): WindowEntity;
|
|
1415
|
+
close(id: string): void;
|
|
1416
|
+
minimize(id: string): void;
|
|
1417
|
+
maximize(id: string): void;
|
|
1418
|
+
restore(id: string): void;
|
|
1419
|
+
focus(id: string): void;
|
|
1420
|
+
move(id: string, x: number, y: number): void;
|
|
1421
|
+
resize(id: string, width: number, height: number): void;
|
|
1422
|
+
loadWindows(windows: WindowEntity[]): void;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
declare class WindowManagerAdapter implements IWindowManager {
|
|
1426
|
+
private windows;
|
|
1427
|
+
private nextZIndex;
|
|
1428
|
+
private assignZIndex;
|
|
1429
|
+
reset(): void;
|
|
1430
|
+
/**
|
|
1431
|
+
* Restores persisted windows into the adapter and synchronizes the
|
|
1432
|
+
* nextZIndex counter so that subsequent focus/open calls always produce
|
|
1433
|
+
* a value strictly higher than any already-persisted zIndex.
|
|
1434
|
+
*/
|
|
1435
|
+
loadWindows(windows: WindowEntity[]): void;
|
|
1436
|
+
getAll(): WindowEntity[];
|
|
1437
|
+
getById(id: string): WindowEntity | undefined;
|
|
1438
|
+
open(input: WindowInput): WindowEntity;
|
|
1439
|
+
close(id: string): void;
|
|
1440
|
+
minimize(id: string): void;
|
|
1441
|
+
maximize(id: string): void;
|
|
1442
|
+
restore(id: string): void;
|
|
1443
|
+
focus(id: string): void;
|
|
1444
|
+
move(id: string, x: number, y: number): void;
|
|
1445
|
+
resize(id: string, width: number, height: number): void;
|
|
1446
|
+
private updateWindow;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
declare const toMantineTheme: (theme: Theme) => MantineThemeOverride;
|
|
1450
|
+
|
|
1451
|
+
type AppLoader = () => Promise<unknown>;
|
|
1452
|
+
declare function prefetchApps(apps: Array<{
|
|
1453
|
+
id: string;
|
|
1454
|
+
loader: AppLoader;
|
|
1455
|
+
}>): void;
|
|
1456
|
+
|
|
1457
|
+
export { ANIMATION_DURATION, APPS, APP_IDS, AVAILABLE_FONTS, type AppComponent, type AppEntry, type AppMenuElement, type AppRegistration, BREAKPOINTS, CORE_APPS, CORE_APP_IDS, CUSTOM_APPS_FOLDER_ID, CalendarApp, type ClipboardAction, type ClipboardState, CodeServerApp, type CreateFolderOptions, type CustomAppState, type CustomThemeColors, DEFAULT_LAUNCHER_FOLDERS, DEFAULT_THEME_COLORS, DEFAULT_VIEWPORT_HEIGHT, DEFAULT_VIEWPORT_WIDTH, DEFAULT_WINDOW_DIMENSIONS, DESKTOP_APPS_ORDER, type DesktopIconInput, type DesktopState, DeviceInfoApp, DockerFileSystemAdapter, DoomApp, DosEmulatorApp, EASE_IN, EASE_OUT, EXTRA_APPS, EXTRA_APP_IDS, FONT_STACKS, type FSNode, type FileNode, FilesApp, type FolderNode, type FsManifest, type FsManifestFile, GOOGLE_FONTS_HREF, GithubApp, ICON_COLUMN_WIDTH, ICON_MARGIN, ICON_ROW_HEIGHT, type IFileSystem, type ISettingsState, ImageViewerApp, IndexedDBFileSystem, LinkedinApp, type LoadingState, type MenuBarBuilder, type MenuBarComponent, type MenuBarComponentProps, MenuEditApp, type MenuPosition, type MountedAppState, NotepadApp, type NotificationItem, PRESET_COLORS, PRESET_ICONS, PdfApp, SettingsApp, StorybookApp, TASKBAR_HEIGHT, TerminalApp, UploaderApp, WelcomeApp, type WindowContentProps, type WindowEntity, type WindowInput, WindowManagerAdapter, type WindowState, buildBreadcrumbs, centerWindowPosition, clearBrowserData, createDesktopIcon, createEaseIn, createEaseOut, createLauncherFolder, createMaximizeTransition, createMinimizeVariant, createPanelVariants, createRestoreVariant, createWindow, createWindowVariants, fileSystem, formatBytes, generateUUID, getAppIdForMime, getBaseUrl, getFileExtension, getFourRandomColors, getMimeTypeFromExtension, getRuntime, hashBlob, initializeFdeApi, isBrowser, isDev, isDocker, isElectron, isFdeApiInitialized, isNewerVersion, maximizeTransition, minimizeVariant, openVariants, panelVariants, prefetchApps, randomWindowPosition, registerCustomApps, registerDesktopApps, resetFileSystem, resetWindowManager, resolveUrl, restoreVariant, sortDesktopIcons, sortDesktopIconsByMode, sortNodes, toMantineTheme, updateLauncherFolder, useAdaptiveDimensions, useAnimationDuration, useAppName, useAppTempMemoryStore, useApplyFont, useClock, useCollapsible, useContextMenu, useCustomAppHMR, useCustomAppStore, useDesktopStore, useDeviceDetection, useDownload, useDynamicIcon, useFcIcon, useFdeApi, useFiIcon, useFolderName, useFontDownload, useIsDirty, useJsDos, useLanguageSync, useNotifications, useOpenApp, useResolvedUrl, useSearchFilter, useSettingsStore, useSystemTheme, useTaskbarContextMenu, useTaskbarHeight, useVscIcon, useWindowButtonRegistry, waitForContainer, windowVariants };
|