@prozilla-os/core 1.3.12 → 1.3.14
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/main.d.ts +438 -83
- package/dist/main.js +5861 -5694
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
1
2
|
import { FC } from 'react';
|
|
2
3
|
import { HTMLAttributeAnchorTarget } from 'react';
|
|
3
4
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
@@ -12,17 +13,24 @@ import { Ref } from 'react';
|
|
|
12
13
|
import { UaEventOptions } from 'react-ga4/types/ga4';
|
|
13
14
|
import { default as utilStyles } from './utils.module.css';
|
|
14
15
|
|
|
15
|
-
declare interface ActionProps {
|
|
16
|
+
export declare interface ActionProps {
|
|
17
|
+
/** ID of the action */
|
|
16
18
|
actionId?: string;
|
|
19
|
+
/** Label of the action */
|
|
17
20
|
label?: string;
|
|
21
|
+
/** Icon for the action */
|
|
18
22
|
icon?: string | object;
|
|
23
|
+
/** Keyboard shortcut for the action */
|
|
19
24
|
shortcut?: string[];
|
|
25
|
+
/** Function that handles the trigger event for the action */
|
|
20
26
|
onTrigger?: (event?: Event, triggerParams?: unknown, ...args: unknown[]) => void;
|
|
21
27
|
children?: ReactNode;
|
|
28
|
+
/** Whether the action should be disabled */
|
|
22
29
|
disabled?: boolean;
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
/**
|
|
33
|
+
* Component that renders a collection of actions (e.g., as a context menu or a header menu) and handles keyboard shortcuts
|
|
26
34
|
* @example
|
|
27
35
|
* <ClickAction
|
|
28
36
|
* label="Reload"
|
|
@@ -35,20 +43,34 @@ declare interface ActionProps {
|
|
|
35
43
|
*/
|
|
36
44
|
export declare function Actions({ children, mode, className, onAnyTrigger, triggerParams, avoidTaskbar }: ActionsProps): ReactElement;
|
|
37
45
|
|
|
38
|
-
declare interface ActionsProps {
|
|
46
|
+
export declare interface ActionsProps {
|
|
39
47
|
mode?: string;
|
|
48
|
+
/** `className` prop for the container */
|
|
40
49
|
className?: string;
|
|
50
|
+
/** Function that handles the trigger event for all actions */
|
|
41
51
|
onAnyTrigger?: (event: Event, triggerParams: unknown, ...args: unknown[]) => void;
|
|
42
52
|
children?: ReactNode;
|
|
53
|
+
/** The parameters to pass whenever an action is triggered */
|
|
43
54
|
triggerParams?: unknown;
|
|
55
|
+
/** Whether the actions should automatically orient themselves to not overlap with the taskbar */
|
|
44
56
|
avoidTaskbar?: boolean;
|
|
45
57
|
[key: string]: unknown;
|
|
46
58
|
}
|
|
47
59
|
|
|
48
|
-
declare interface AlertParams {
|
|
60
|
+
export declare interface AlertParams {
|
|
61
|
+
/**
|
|
62
|
+
* The title of the alert
|
|
63
|
+
* @default "Alert"
|
|
64
|
+
*/
|
|
49
65
|
title: string;
|
|
66
|
+
/** The body of the alert */
|
|
50
67
|
text: string;
|
|
68
|
+
/** The URL of the icon of the alert */
|
|
51
69
|
iconUrl?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The size of the alert modal
|
|
72
|
+
* @default new Vector2(300, 150)
|
|
73
|
+
*/
|
|
52
74
|
size?: Vector2;
|
|
53
75
|
single?: boolean;
|
|
54
76
|
}
|
|
@@ -71,9 +93,9 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
|
|
|
71
93
|
*/
|
|
72
94
|
windowContent: FC<AppProps>;
|
|
73
95
|
/**
|
|
74
|
-
* Default options that get passed to the {@link
|
|
96
|
+
* Default options that get passed to the {@link App.windowContent} component
|
|
75
97
|
*/
|
|
76
|
-
windowOptions?: Partial<AppProps> &
|
|
98
|
+
windowOptions?: Partial<AppProps> & DefaultWindowOptions;
|
|
77
99
|
/**
|
|
78
100
|
* Description of this application
|
|
79
101
|
*/
|
|
@@ -116,26 +138,29 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
|
|
|
116
138
|
isActive: boolean;
|
|
117
139
|
isPinned?: boolean;
|
|
118
140
|
isInstalled: boolean;
|
|
119
|
-
constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> &
|
|
141
|
+
constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> & DefaultWindowOptions);
|
|
142
|
+
/**
|
|
143
|
+
* Returns the component that renders the content of a window for this app
|
|
144
|
+
*/
|
|
120
145
|
WindowContent: (props: AppProps) => JSX_2.Element | null;
|
|
121
146
|
/**
|
|
122
|
-
*
|
|
147
|
+
* Sets the display name of this application
|
|
123
148
|
*/
|
|
124
149
|
setName(name: string): this;
|
|
125
150
|
/**
|
|
126
|
-
*
|
|
151
|
+
* Sets the description of this application
|
|
127
152
|
*/
|
|
128
153
|
setDescription(description: App["description"]): this;
|
|
129
154
|
/**
|
|
130
|
-
*
|
|
155
|
+
* Sets the URL of the icon of this application
|
|
131
156
|
*/
|
|
132
157
|
setIconUrl(iconUrl: App["iconUrl"]): this;
|
|
133
158
|
/**
|
|
134
|
-
*
|
|
159
|
+
* Sets the role of this application
|
|
135
160
|
*/
|
|
136
161
|
setRole(role: string | null): this;
|
|
137
162
|
/**
|
|
138
|
-
*
|
|
163
|
+
* Sets the associated extensions of this application
|
|
139
164
|
*/
|
|
140
165
|
setAssociatedExtensions(extensions: string[] | null): this;
|
|
141
166
|
/**
|
|
@@ -151,11 +176,11 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
|
|
|
151
176
|
*/
|
|
152
177
|
setInstalled(installed: boolean): this;
|
|
153
178
|
/**
|
|
154
|
-
*
|
|
179
|
+
* Sets the category this application belongs to
|
|
155
180
|
*/
|
|
156
181
|
setCategory(category: typeof APP_CATEGORIES[number] | null): this;
|
|
157
182
|
/**
|
|
158
|
-
*
|
|
183
|
+
* Sets the metadata for this application
|
|
159
184
|
*/
|
|
160
185
|
setMetadata(metadata: AppMetadata | null): this;
|
|
161
186
|
/**
|
|
@@ -163,14 +188,14 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
|
|
|
163
188
|
*/
|
|
164
189
|
setShowDesktopIcon(showDesktopIcon: boolean): this;
|
|
165
190
|
/**
|
|
166
|
-
*
|
|
191
|
+
* Sets the default options for the {@link App.windowContent} component
|
|
167
192
|
*/
|
|
168
|
-
setWindowOptions(windowOptions: Partial<AppProps> &
|
|
193
|
+
setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this;
|
|
169
194
|
}
|
|
170
195
|
|
|
171
196
|
export declare const APP_CATEGORIES: readonly ["Business", "Developer tools", "Education", "Entertainment", "Food & dining", "Health & fitness", "Kids & family", "Lifestyle", "Media", "Medical", "Multimedia design", "Music", "Navigation & maps", "News & weather", "Personal finance", "Personalization", "Photo & video", "Productivity", "Security", "Shopping", "Social", "Sports", "Travel", "Utilities & tools"];
|
|
172
197
|
|
|
173
|
-
declare interface AppMetadata {
|
|
198
|
+
export declare interface AppMetadata {
|
|
174
199
|
name: string;
|
|
175
200
|
version: `${number}.${number}.${number}`;
|
|
176
201
|
author: string;
|
|
@@ -206,7 +231,7 @@ export declare class AppsConfig {
|
|
|
206
231
|
getAppsByCategory(category: typeof APP_CATEGORIES[number]): App[];
|
|
207
232
|
}
|
|
208
233
|
|
|
209
|
-
declare interface AppsConfigOptions {
|
|
234
|
+
export declare interface AppsConfigOptions {
|
|
210
235
|
/**
|
|
211
236
|
* An array of applications
|
|
212
237
|
*/
|
|
@@ -217,7 +242,7 @@ export declare const AUDIO_EXTENSIONS: string[];
|
|
|
217
242
|
|
|
218
243
|
export declare function Button({ className, href, children, icon, target, ...props }: ButtonProps): JSX_2.Element;
|
|
219
244
|
|
|
220
|
-
declare interface ButtonProps {
|
|
245
|
+
export declare interface ButtonProps {
|
|
221
246
|
className?: string;
|
|
222
247
|
href?: string;
|
|
223
248
|
icon?: IconProp;
|
|
@@ -228,7 +253,7 @@ declare interface ButtonProps {
|
|
|
228
253
|
|
|
229
254
|
export declare const ClickAction: MemoExoticComponent<({ actionId, label, shortcut, disabled, onTrigger, icon }: ClickActionProps) => JSX_2.Element>;
|
|
230
255
|
|
|
231
|
-
declare interface ClickActionProps extends ActionProps {
|
|
256
|
+
export declare interface ClickActionProps extends ActionProps {
|
|
232
257
|
icon?: string | object;
|
|
233
258
|
}
|
|
234
259
|
|
|
@@ -244,6 +269,14 @@ export declare function copyToClipboard(string: string, onSuccess?: (value: void
|
|
|
244
269
|
|
|
245
270
|
export declare function DefaultRoute(): JSX_2.Element;
|
|
246
271
|
|
|
272
|
+
export declare interface DefaultWindowOptions {
|
|
273
|
+
size?: Vector2;
|
|
274
|
+
[key: string]: unknown;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Component that renders the wallpaper and desktop icons
|
|
279
|
+
*/
|
|
247
280
|
export declare const Desktop: MemoExoticComponent<() => JSX_2.Element>;
|
|
248
281
|
|
|
249
282
|
export declare class DesktopConfig {
|
|
@@ -252,12 +285,14 @@ export declare class DesktopConfig {
|
|
|
252
285
|
constructor(options?: Partial<DesktopConfigOptions>);
|
|
253
286
|
}
|
|
254
287
|
|
|
255
|
-
declare interface DesktopConfigOptions {
|
|
288
|
+
export declare interface DesktopConfigOptions {
|
|
256
289
|
/**
|
|
290
|
+
* The default size of the icons
|
|
257
291
|
* @default 1
|
|
258
292
|
*/
|
|
259
293
|
defaultIconSize: 0 | 1 | 2;
|
|
260
294
|
/**
|
|
295
|
+
* The defailt direction of the icons
|
|
261
296
|
* 0: vertical, 1: horizontal
|
|
262
297
|
* @default 0
|
|
263
298
|
* */
|
|
@@ -266,19 +301,33 @@ declare interface DesktopConfigOptions {
|
|
|
266
301
|
|
|
267
302
|
export declare function DialogBox({ modal, params, children, ...props }: ModalProps): JSX_2.Element;
|
|
268
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Component that displays the contents of a directory
|
|
306
|
+
*/
|
|
269
307
|
export declare function DirectoryList({ directory, showHidden, folderClassName, fileClassName, className, onContextMenuFile, onContextMenuFolder, onOpenFile, onOpenFolder, allowMultiSelect, onSelectionChange, ...props }: DirectoryListProps): ReactElement | null;
|
|
270
308
|
|
|
271
|
-
declare interface DirectoryListProps {
|
|
309
|
+
export declare interface DirectoryListProps {
|
|
310
|
+
/** The directory to display */
|
|
272
311
|
directory: VirtualFolder;
|
|
312
|
+
/** Whether to show hidden files and folders */
|
|
273
313
|
showHidden?: boolean;
|
|
314
|
+
/** `className` prop for folders */
|
|
274
315
|
folderClassName?: string;
|
|
316
|
+
/** `className` prop for files */
|
|
275
317
|
fileClassName?: string;
|
|
318
|
+
/** `className` prop for this component */
|
|
276
319
|
className?: string;
|
|
320
|
+
/** Function that handles context menu interactions on files */
|
|
277
321
|
onContextMenuFile?: FileEventHandler;
|
|
322
|
+
/** Function that handles context menu interactions on folders */
|
|
278
323
|
onContextMenuFolder?: FolderEventHandler;
|
|
324
|
+
/** Function that handles file opening events */
|
|
279
325
|
onOpenFile?: FileEventHandler;
|
|
326
|
+
/** Function that handles folder opening events */
|
|
280
327
|
onOpenFolder?: FolderEventHandler;
|
|
328
|
+
/** Whether to allow multiple files and folders to be selected at the same time */
|
|
281
329
|
allowMultiSelect?: boolean;
|
|
330
|
+
/** Function that handles selection changes */
|
|
282
331
|
onSelectionChange?: (params: OnSelectionChangeParams) => void;
|
|
283
332
|
[key: string]: unknown;
|
|
284
333
|
}
|
|
@@ -289,15 +338,21 @@ export declare function downloadUrl(url: string, name: string): void;
|
|
|
289
338
|
|
|
290
339
|
export declare function DropdownAction({ label, icon, children, showOnHover }: DropdownActionProps): ReactElement;
|
|
291
340
|
|
|
292
|
-
declare interface DropdownActionProps extends ActionProps {
|
|
341
|
+
export declare interface DropdownActionProps extends ActionProps {
|
|
293
342
|
showOnHover?: boolean;
|
|
294
343
|
}
|
|
295
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Component that opens a dropdown menu
|
|
347
|
+
*/
|
|
296
348
|
export declare function DropdownButton({ label, options, shortcuts }: DropdownButtonProps): JSX_2.Element;
|
|
297
349
|
|
|
298
|
-
declare interface DropdownButtonProps {
|
|
350
|
+
export declare interface DropdownButtonProps {
|
|
351
|
+
/** The label of the button */
|
|
299
352
|
label: string;
|
|
353
|
+
/** The options in the dropdown menu mapped to the function that handles their selection */
|
|
300
354
|
options: Record<string, () => void>;
|
|
355
|
+
/** The keyboard shortcut for options in the dropdown menu */
|
|
301
356
|
shortcuts: Record<string, string[]>;
|
|
302
357
|
}
|
|
303
358
|
|
|
@@ -307,11 +362,11 @@ declare class EventEmitter<EventMap extends EventNamesMap> {
|
|
|
307
362
|
/**
|
|
308
363
|
* Add event listener for an event
|
|
309
364
|
*/
|
|
310
|
-
on<Key extends keyof EventMap>(eventName: Key, callback:
|
|
365
|
+
on<Key extends keyof EventMap>(eventName: Key, callback: Listener): Listener;
|
|
311
366
|
/**
|
|
312
367
|
* Remove event listener for an event
|
|
313
368
|
*/
|
|
314
|
-
off<Key extends keyof EventMap>(eventName: Key, callback:
|
|
369
|
+
off<Key extends keyof EventMap>(eventName: Key, callback: Listener): void;
|
|
315
370
|
/**
|
|
316
371
|
* Dispatch event
|
|
317
372
|
*/
|
|
@@ -336,9 +391,9 @@ export declare type FolderEventHandler = (event: Event, folder: VirtualFolder) =
|
|
|
336
391
|
*/
|
|
337
392
|
export declare function formatShortcut(shortcut: string[]): string;
|
|
338
393
|
|
|
339
|
-
export declare function generateUrl(options:
|
|
394
|
+
export declare function generateUrl(options: GenerateUrlParams): string;
|
|
340
395
|
|
|
341
|
-
declare interface
|
|
396
|
+
export declare interface GenerateUrlParams {
|
|
342
397
|
appId?: string;
|
|
343
398
|
fullscreen?: boolean;
|
|
344
399
|
standalone?: boolean;
|
|
@@ -346,6 +401,9 @@ declare interface GenerateUrlOptions {
|
|
|
346
401
|
|
|
347
402
|
export declare function getViewportParams(): Record<string, string>;
|
|
348
403
|
|
|
404
|
+
/**
|
|
405
|
+
* Component that shows a header menu at the top of a window
|
|
406
|
+
*/
|
|
349
407
|
export declare function HeaderMenu({ children, ...props }: ActionsProps): JSX_2.Element;
|
|
350
408
|
|
|
351
409
|
declare function Image_2({ className, src, ...props }: ImageProps): JSX_2.Element;
|
|
@@ -355,22 +413,27 @@ export declare const IMAGE_EXTENSIONS: string[];
|
|
|
355
413
|
|
|
356
414
|
export declare function ImagePreview({ source, className, onError, ...props }: ImagePreviewProps): JSX_2.Element;
|
|
357
415
|
|
|
358
|
-
declare interface ImagePreviewProps {
|
|
416
|
+
export declare interface ImagePreviewProps {
|
|
359
417
|
source: string;
|
|
360
418
|
className?: string;
|
|
361
419
|
onError?: () => void;
|
|
362
420
|
}
|
|
363
421
|
|
|
364
|
-
declare interface ImageProps {
|
|
422
|
+
export declare interface ImageProps {
|
|
365
423
|
className?: string;
|
|
366
424
|
src?: string;
|
|
367
425
|
[key: string]: unknown;
|
|
368
426
|
}
|
|
369
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Button component that handles single and double clicks
|
|
430
|
+
*/
|
|
370
431
|
export declare function Interactable({ onClick, onDoubleClick, children, ...props }: InteractableProps): JSX_2.Element;
|
|
371
432
|
|
|
372
|
-
declare interface InteractableProps {
|
|
433
|
+
export declare interface InteractableProps {
|
|
434
|
+
/** Function that handles single clicks */
|
|
373
435
|
onClick?: (event: MouseEvent) => void;
|
|
436
|
+
/** Function that handles double clicks */
|
|
374
437
|
onDoubleClick?: (event: MouseEvent) => void;
|
|
375
438
|
children: ReactNode;
|
|
376
439
|
[key: string]: unknown;
|
|
@@ -378,6 +441,8 @@ declare interface InteractableProps {
|
|
|
378
441
|
|
|
379
442
|
export declare function isValidUrl(string: string): boolean;
|
|
380
443
|
|
|
444
|
+
declare type Listener = (data: unknown) => void;
|
|
445
|
+
|
|
381
446
|
export declare const MEDIA_EXTENSIONS: string[];
|
|
382
447
|
|
|
383
448
|
export declare class MiscConfig {
|
|
@@ -385,7 +450,7 @@ export declare class MiscConfig {
|
|
|
385
450
|
constructor(options?: Partial<MiscConfigOptions>);
|
|
386
451
|
}
|
|
387
452
|
|
|
388
|
-
declare interface MiscConfigOptions {
|
|
453
|
+
export declare interface MiscConfigOptions {
|
|
389
454
|
/**
|
|
390
455
|
* The maximum time between two clicks to register as a double click (in ms)
|
|
391
456
|
* @default 250
|
|
@@ -393,17 +458,49 @@ declare interface MiscConfigOptions {
|
|
|
393
458
|
doubleClickDelay: number;
|
|
394
459
|
}
|
|
395
460
|
|
|
396
|
-
|
|
461
|
+
/**
|
|
462
|
+
* Represents a modal window
|
|
463
|
+
*/
|
|
464
|
+
export declare class Modal {
|
|
465
|
+
/**
|
|
466
|
+
* The size of this modal
|
|
467
|
+
* @default new Vector2(400, 200)
|
|
468
|
+
*/
|
|
397
469
|
size: Vector2;
|
|
470
|
+
/**
|
|
471
|
+
* The position of this modal
|
|
472
|
+
* @default new Vector2(300, 300)
|
|
473
|
+
*/
|
|
398
474
|
position: Vector2;
|
|
475
|
+
/**
|
|
476
|
+
* The icon of this modal
|
|
477
|
+
* @default null
|
|
478
|
+
*/
|
|
399
479
|
icon: string | null;
|
|
480
|
+
/**
|
|
481
|
+
* The title of this modal
|
|
482
|
+
* @default null
|
|
483
|
+
*/
|
|
400
484
|
title: string | null;
|
|
485
|
+
/**
|
|
486
|
+
* The manager that handles all modals
|
|
487
|
+
*/
|
|
401
488
|
modalsManager: ModalsManager | null;
|
|
489
|
+
/**
|
|
490
|
+
* The content of this modal
|
|
491
|
+
* @default null
|
|
492
|
+
*/
|
|
402
493
|
element: FC<ModalProps> | null;
|
|
403
494
|
props: object;
|
|
404
495
|
callback: ((...args: unknown[]) => void) | null;
|
|
496
|
+
/** The ID of this modal */
|
|
405
497
|
id: number | null;
|
|
498
|
+
/**
|
|
499
|
+
* Whether this modal can be dismissed (e.g., by pressing ESC)
|
|
500
|
+
* @default true
|
|
501
|
+
*/
|
|
406
502
|
dismissible: boolean;
|
|
503
|
+
/** Timestamp of the most recent interaction with this modal */
|
|
407
504
|
lastInteraction?: number;
|
|
408
505
|
constructor(element: Modal["element"], callback?: Modal["callback"]);
|
|
409
506
|
setIcon(icon: string): Modal;
|
|
@@ -422,6 +519,7 @@ declare class Modal {
|
|
|
422
519
|
}
|
|
423
520
|
|
|
424
521
|
export declare interface ModalProps {
|
|
522
|
+
/** */
|
|
425
523
|
modal?: Modal;
|
|
426
524
|
params?: {
|
|
427
525
|
appId?: string;
|
|
@@ -445,7 +543,7 @@ export declare class ModalsConfig {
|
|
|
445
543
|
constructor(options?: Partial<ModalsConfigOptions>);
|
|
446
544
|
}
|
|
447
545
|
|
|
448
|
-
declare interface ModalsConfigOptions {
|
|
546
|
+
export declare interface ModalsConfigOptions {
|
|
449
547
|
/**
|
|
450
548
|
* Default size of a dialog box
|
|
451
549
|
* @default new Vector2(400, 200)
|
|
@@ -458,71 +556,126 @@ declare interface ModalsConfigOptions {
|
|
|
458
556
|
defaultFileSelectorSize: Vector2;
|
|
459
557
|
}
|
|
460
558
|
|
|
559
|
+
/**
|
|
560
|
+
* Manages the opening, closing and ordering of modals
|
|
561
|
+
*/
|
|
461
562
|
export declare class ModalsManager {
|
|
563
|
+
/** Maps every modal ID to the corresponding modal */
|
|
462
564
|
modals: Record<string, Modal>;
|
|
463
565
|
containerRef?: MutableRefObject<HTMLElement>;
|
|
566
|
+
/** Function that handles changes to modals */
|
|
464
567
|
updateModals: (modals: ModalsManager["modals"]) => void;
|
|
465
568
|
/**
|
|
569
|
+
* Opens a modal
|
|
466
570
|
* @param single - Set to false to preserve other open modals
|
|
467
571
|
*/
|
|
468
572
|
open(modal: Modal, single?: boolean): void;
|
|
573
|
+
/**
|
|
574
|
+
* Closes a modal
|
|
575
|
+
* @param modalId The ID of the modal to close
|
|
576
|
+
*/
|
|
469
577
|
close(modalId: string | number, sendModalsUpdate?: boolean): void;
|
|
578
|
+
/**
|
|
579
|
+
* Brings a modal into focus
|
|
580
|
+
* @param modalId The ID of the modal to bring into focus
|
|
581
|
+
*/
|
|
470
582
|
focus(modalId: string): void;
|
|
471
583
|
setUpdateModals(updateModals: ModalsManager["updateModals"]): void;
|
|
584
|
+
/**
|
|
585
|
+
* Returns the IDs of all open modals
|
|
586
|
+
*/
|
|
472
587
|
get modalIds(): string[];
|
|
473
588
|
static getModalIconUrl(name: string): string;
|
|
474
589
|
}
|
|
475
590
|
|
|
476
|
-
declare
|
|
591
|
+
export declare const modalsManagerContext: Context<ModalsManagerState>;
|
|
592
|
+
|
|
593
|
+
export declare type ModalsManagerState = ModalsManager | undefined;
|
|
477
594
|
|
|
595
|
+
/**
|
|
596
|
+
* Component that renders all active modals
|
|
597
|
+
*/
|
|
478
598
|
export declare const ModalsView: MemoExoticComponent<() => JSX_2.Element>;
|
|
479
599
|
|
|
480
600
|
export declare function NoRoute(): JSX_2.Element;
|
|
481
601
|
|
|
602
|
+
export declare interface NoRouteProps {
|
|
603
|
+
/**
|
|
604
|
+
* Title of the route
|
|
605
|
+
* @default "404: Not Found"
|
|
606
|
+
*/
|
|
607
|
+
title: string;
|
|
608
|
+
}
|
|
609
|
+
|
|
482
610
|
export declare interface OnSelectionChangeParams {
|
|
611
|
+
/** The selected files */
|
|
483
612
|
files?: string[];
|
|
613
|
+
/** The selected folders */
|
|
484
614
|
folders?: string[];
|
|
615
|
+
/** The directory the selection was made in */
|
|
485
616
|
directory?: VirtualFolder;
|
|
486
617
|
}
|
|
487
618
|
|
|
488
619
|
export declare function openUrl(url: string, target?: HTMLAttributeAnchorTarget): void;
|
|
489
620
|
|
|
490
|
-
declare type OpenWindowedModal = (params: OpenWindowedModalParams) => Modal;
|
|
621
|
+
export declare type OpenWindowedModal = (params: OpenWindowedModalParams) => Modal;
|
|
491
622
|
|
|
492
|
-
declare interface OpenWindowedModalParams {
|
|
623
|
+
export declare interface OpenWindowedModalParams {
|
|
624
|
+
/** The ID of the associated app */
|
|
493
625
|
appId?: string;
|
|
626
|
+
/** The URL of the icon of the modal */
|
|
494
627
|
iconUrl?: string;
|
|
628
|
+
/** The title of the modal */
|
|
495
629
|
title?: string;
|
|
630
|
+
/** The size of the modal */
|
|
496
631
|
size: Vector2;
|
|
632
|
+
/** The modal component */
|
|
497
633
|
Modal: FC<ModalProps>;
|
|
498
634
|
single?: boolean;
|
|
499
635
|
fullscreen?: WindowProps["fullscreen"];
|
|
500
636
|
}
|
|
501
637
|
|
|
502
|
-
declare type OptionalStringProperty = string | null | undefined;
|
|
638
|
+
export declare type OptionalStringProperty = string | null | undefined;
|
|
503
639
|
|
|
640
|
+
/**
|
|
641
|
+
* Component that calls a function when the user clicks outside of it
|
|
642
|
+
*/
|
|
504
643
|
export declare const OutsideClickListener: MemoExoticComponent<({ onOutsideClick, children }: OutsideClickListenerProps) => JSX_2.Element>;
|
|
505
644
|
|
|
506
|
-
declare interface OutsideClickListenerProps {
|
|
645
|
+
export declare interface OutsideClickListenerProps {
|
|
646
|
+
/** Function that handles clicks outside of this component */
|
|
507
647
|
onOutsideClick: (event: Event) => void;
|
|
508
648
|
children: ReactNode;
|
|
509
649
|
}
|
|
510
650
|
|
|
651
|
+
/**
|
|
652
|
+
* Component that renders a progress bar
|
|
653
|
+
*/
|
|
511
654
|
export declare function ProgressBar({ fillPercentage, fillColor, backgroundColor, align, className }: ProgressBarProps): JSX_2.Element;
|
|
512
655
|
|
|
513
|
-
declare interface ProgressBarProps {
|
|
656
|
+
export declare interface ProgressBarProps {
|
|
657
|
+
/** The amount of progress, as a percentage */
|
|
514
658
|
fillPercentage: number;
|
|
659
|
+
/** The CSS color to use for the filled part of the progress bar */
|
|
515
660
|
fillColor?: string;
|
|
661
|
+
/** The CSS background color of the progress bar */
|
|
516
662
|
backgroundColor?: string;
|
|
517
663
|
align?: "left";
|
|
664
|
+
/** `className` prop for the progress bar */
|
|
518
665
|
className?: string;
|
|
519
666
|
}
|
|
520
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Main component that contains everything
|
|
670
|
+
*/
|
|
521
671
|
export declare const ProzillaOS: NamedExoticComponent<ProzillaOSProps>;
|
|
522
672
|
|
|
523
|
-
declare interface ProzillaOSProps {
|
|
673
|
+
export declare interface ProzillaOSProps {
|
|
674
|
+
/** The name of the system */
|
|
524
675
|
systemName?: string;
|
|
676
|
+
/** The tagline/short description of the system */
|
|
525
677
|
tagLine?: string;
|
|
678
|
+
/** The system configuration */
|
|
526
679
|
config?: {
|
|
527
680
|
apps?: Partial<AppsConfigOptions>;
|
|
528
681
|
desktop?: Partial<DesktopConfigOptions>;
|
|
@@ -549,7 +702,7 @@ export declare function RadioAction({ actionId, options, initialIndex, onTrigger
|
|
|
549
702
|
* @param {number} props.initialIndex
|
|
550
703
|
* @param {Function} props.onTrigger
|
|
551
704
|
*/
|
|
552
|
-
declare interface RadioActionProps extends ActionProps {
|
|
705
|
+
export declare interface RadioActionProps extends ActionProps {
|
|
553
706
|
options: {
|
|
554
707
|
label: string;
|
|
555
708
|
shortcut?: string[];
|
|
@@ -568,14 +721,14 @@ export declare function removeUrlProtocol(url: string): string;
|
|
|
568
721
|
|
|
569
722
|
export declare function Router({ path, homePage, fallbackPage, children }: RouterProps): JSX_2.Element;
|
|
570
723
|
|
|
571
|
-
declare interface RouterProps {
|
|
724
|
+
export declare interface RouterProps {
|
|
572
725
|
path?: string;
|
|
573
726
|
homePage?: JSX.Element;
|
|
574
727
|
fallbackPage?: JSX.Element;
|
|
575
728
|
children?: ReactElement;
|
|
576
729
|
}
|
|
577
730
|
|
|
578
|
-
declare class Settings {
|
|
731
|
+
export declare class Settings {
|
|
579
732
|
#private;
|
|
580
733
|
path: string;
|
|
581
734
|
file: VirtualFile;
|
|
@@ -591,10 +744,39 @@ declare class Settings {
|
|
|
591
744
|
*/
|
|
592
745
|
isMissingXmlDoc(): Promise<boolean>;
|
|
593
746
|
/**
|
|
594
|
-
* Gets a value by a given key if it exists
|
|
747
|
+
* Gets a value by a given key if it exists and optionally calls a callback function whenever the value changes
|
|
748
|
+
* @param key The key of the setting
|
|
749
|
+
* @param callback The callback function to call whenever the value changes
|
|
750
|
+
*/
|
|
751
|
+
get(key: string, callback?: (value: string) => void): Promise<{
|
|
752
|
+
value: string | null;
|
|
753
|
+
listener?: Listener;
|
|
754
|
+
}>;
|
|
755
|
+
/**
|
|
756
|
+
* Gets a value by a given key as a boolean
|
|
757
|
+
*/
|
|
758
|
+
getBool(key: string, callback?: (value: boolean) => void): Promise<{
|
|
759
|
+
value: boolean | null;
|
|
760
|
+
listener?: Listener;
|
|
761
|
+
}>;
|
|
762
|
+
/**
|
|
763
|
+
* Gets a value by a given key as an integer
|
|
764
|
+
*/
|
|
765
|
+
getInt(key: string, callback?: (value: number) => void): Promise<{
|
|
766
|
+
value: number | null;
|
|
767
|
+
listener?: Listener;
|
|
768
|
+
}>;
|
|
769
|
+
/**
|
|
770
|
+
* Sets the value associated with a given key
|
|
771
|
+
* @param key The key of the setting
|
|
772
|
+
* @param value The new value
|
|
595
773
|
*/
|
|
596
|
-
get(key: string, callback?: (value: string) => void): Promise<string | null>;
|
|
597
774
|
set(key: string, value: string): Promise<void>;
|
|
775
|
+
/**
|
|
776
|
+
* Removes a listener from the settings file
|
|
777
|
+
* @param listener The listener to remove
|
|
778
|
+
*/
|
|
779
|
+
removeListener(listener: Listener): void;
|
|
598
780
|
}
|
|
599
781
|
|
|
600
782
|
export declare class SettingsManager {
|
|
@@ -606,7 +788,11 @@ export declare class SettingsManager {
|
|
|
606
788
|
getSettings(path: string): Settings;
|
|
607
789
|
}
|
|
608
790
|
|
|
609
|
-
declare
|
|
791
|
+
export declare const SettingsManagerContext: Context<SettingsManagerState>;
|
|
792
|
+
|
|
793
|
+
export declare type SettingsManagerState = SettingsManager | undefined;
|
|
794
|
+
|
|
795
|
+
export declare type SettingsPath = typeof SettingsManager.VIRTUAL_PATHS[string];
|
|
610
796
|
|
|
611
797
|
export declare function setViewportIcon(url: string): void;
|
|
612
798
|
|
|
@@ -691,7 +877,7 @@ declare interface SkinOptions {
|
|
|
691
877
|
|
|
692
878
|
export declare function StandaloneRoute({ app }: StandaloneRouteProps): JSX_2.Element;
|
|
693
879
|
|
|
694
|
-
declare interface StandaloneRouteProps {
|
|
880
|
+
export declare interface StandaloneRouteProps {
|
|
695
881
|
app: App;
|
|
696
882
|
}
|
|
697
883
|
|
|
@@ -707,7 +893,9 @@ export { StorageManager_2 as StorageManager }
|
|
|
707
893
|
|
|
708
894
|
export declare class SystemManager {
|
|
709
895
|
#private;
|
|
896
|
+
/** The name of the system */
|
|
710
897
|
readonly systemName: string;
|
|
898
|
+
/** The tagline/short description of the system */
|
|
711
899
|
readonly tagLine: string;
|
|
712
900
|
readonly skin: Skin;
|
|
713
901
|
readonly appsConfig: AppsConfig;
|
|
@@ -723,7 +911,9 @@ export declare class SystemManager {
|
|
|
723
911
|
getUptime(precision?: number): string;
|
|
724
912
|
}
|
|
725
913
|
|
|
726
|
-
declare
|
|
914
|
+
export declare const SystemManagerContext: Context<SystemManager | undefined>;
|
|
915
|
+
|
|
916
|
+
export declare interface SystemManagerParams {
|
|
727
917
|
systemName: SystemManager["systemName"] | null;
|
|
728
918
|
tagLine: SystemManager["tagLine"] | null;
|
|
729
919
|
skin?: SystemManager["skin"];
|
|
@@ -737,6 +927,9 @@ declare interface SystemManagerParams {
|
|
|
737
927
|
virtualDriveConfig: VirtualDriveConfig;
|
|
738
928
|
}
|
|
739
929
|
|
|
930
|
+
/**
|
|
931
|
+
* Component that renders the start and search menus, pinned applications and various indicators
|
|
932
|
+
*/
|
|
740
933
|
export declare const Taskbar: MemoExoticComponent<() => JSX_2.Element>;
|
|
741
934
|
|
|
742
935
|
export declare class TaskbarConfig {
|
|
@@ -744,7 +937,7 @@ export declare class TaskbarConfig {
|
|
|
744
937
|
constructor(options?: Partial<TaskbarConfigOptions>);
|
|
745
938
|
}
|
|
746
939
|
|
|
747
|
-
declare interface TaskbarConfigOptions {
|
|
940
|
+
export declare interface TaskbarConfigOptions {
|
|
748
941
|
/**
|
|
749
942
|
* Height of the taskbar in CSS pixels
|
|
750
943
|
* @default 3 * 16
|
|
@@ -754,7 +947,7 @@ declare interface TaskbarConfigOptions {
|
|
|
754
947
|
|
|
755
948
|
export declare function TextDisplay({ children }: TextDisplayProps): JSX_2.Element;
|
|
756
949
|
|
|
757
|
-
declare interface TextDisplayProps {
|
|
950
|
+
export declare interface TextDisplayProps {
|
|
758
951
|
children: ReactNode;
|
|
759
952
|
}
|
|
760
953
|
|
|
@@ -781,7 +974,7 @@ export declare class TimeManager {
|
|
|
781
974
|
|
|
782
975
|
export declare function ToggleAction({ actionId, label, shortcut, initialValue, onTrigger }: ToggleActionProps): ReactElement;
|
|
783
976
|
|
|
784
|
-
declare interface ToggleActionProps extends ActionProps {
|
|
977
|
+
export declare interface ToggleActionProps extends ActionProps {
|
|
785
978
|
initialValue: boolean;
|
|
786
979
|
}
|
|
787
980
|
|
|
@@ -791,7 +984,7 @@ export declare class TrackingConfig {
|
|
|
791
984
|
constructor(options?: Partial<TrackingConfigOptions>);
|
|
792
985
|
}
|
|
793
986
|
|
|
794
|
-
declare interface TrackingConfigOptions {
|
|
987
|
+
export declare interface TrackingConfigOptions {
|
|
795
988
|
/**
|
|
796
989
|
* Enable tracking
|
|
797
990
|
* @default true
|
|
@@ -809,65 +1002,132 @@ export declare class TrackingManager {
|
|
|
809
1002
|
event(options: UaEventOptions | string): void;
|
|
810
1003
|
}
|
|
811
1004
|
|
|
812
|
-
declare
|
|
1005
|
+
export declare const TrackingManagerContext: Context<TrackingManagerState>;
|
|
813
1006
|
|
|
1007
|
+
export declare type TrackingManagerState = TrackingManager | undefined;
|
|
1008
|
+
|
|
1009
|
+
/** Returns a function that opens an alert modal */
|
|
814
1010
|
export declare function useAlert(): {
|
|
815
|
-
alert: (
|
|
1011
|
+
alert: (params: AlertParams) => void;
|
|
816
1012
|
};
|
|
817
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* Returns the folder associated with a given app
|
|
1016
|
+
*/
|
|
818
1017
|
export declare function useAppFolder(app?: App): VirtualFolder | null;
|
|
819
1018
|
|
|
1019
|
+
/**
|
|
1020
|
+
* Returns the boolean value of a setting and a function to update it
|
|
1021
|
+
* @param path The path of the settings file
|
|
1022
|
+
* @param key The key of the setting
|
|
1023
|
+
* @param defaultValue The default value of the setting
|
|
1024
|
+
* @returns The boolean value of a setting and a function to update it
|
|
1025
|
+
*/
|
|
1026
|
+
export declare function useBoolSetting(path: SettingsPath, key: string, defaultValue?: boolean): [boolean, (value: string | boolean) => void];
|
|
1027
|
+
|
|
820
1028
|
/**
|
|
821
1029
|
* Combine class names and an optional static class name
|
|
822
1030
|
*/
|
|
823
1031
|
export declare function useClassNames(classNames: (string | undefined)[], block?: string, element?: string, modifier?: string | string[]): string;
|
|
824
1032
|
|
|
1033
|
+
/**
|
|
1034
|
+
* Creates a function that handles the opening of a custom context menu and a component that listens for keyboard shortcuts
|
|
1035
|
+
*/
|
|
825
1036
|
export declare function useContextMenu({ Actions }: UseContextMenuParams): {
|
|
826
1037
|
onContextMenu: (event: MouseEvent_2<HTMLElement, MouseEvent_2>, params?: object) => Modal;
|
|
827
1038
|
ShortcutsListener: () => JSX_2.Element;
|
|
828
1039
|
};
|
|
829
1040
|
|
|
830
|
-
declare interface UseContextMenuParams {
|
|
1041
|
+
export declare interface UseContextMenuParams {
|
|
1042
|
+
/** The component with the actions of the context menu */
|
|
831
1043
|
Actions: FC<ActionsProps>;
|
|
832
1044
|
}
|
|
833
1045
|
|
|
1046
|
+
/**
|
|
1047
|
+
* Returns an object that handles stateful history with undo and redo methods
|
|
1048
|
+
*/
|
|
834
1049
|
export declare function useHistory<Type>(initialState: Type): {
|
|
1050
|
+
/** The entries of the history */
|
|
835
1051
|
history: Type[];
|
|
1052
|
+
/** The index of the active entry in list of entries */
|
|
836
1053
|
stateIndex: number;
|
|
1054
|
+
/** Adds a new entry to the history */
|
|
837
1055
|
pushState: (state: Type) => void;
|
|
1056
|
+
/** Moves backwards in the history */
|
|
838
1057
|
undo: () => void;
|
|
1058
|
+
/** Moves forwards in the history */
|
|
839
1059
|
redo: () => void;
|
|
840
1060
|
undoAvailable: boolean;
|
|
841
1061
|
redoAvailable: boolean;
|
|
842
1062
|
};
|
|
843
1063
|
|
|
1064
|
+
/**
|
|
1065
|
+
* Returns the integer value of a setting and a function to update it
|
|
1066
|
+
* @param path The path of the settings file
|
|
1067
|
+
* @param key The key of the setting
|
|
1068
|
+
* @param defaultValue The default value of the setting
|
|
1069
|
+
* @returns The integer value of a setting and a function to update it
|
|
1070
|
+
*/
|
|
1071
|
+
export declare function useIntSetting(path: SettingsPath, key: string, defaultValue?: number): [number, (value: string | number) => void];
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Creates listeners for `"keydown"` and `"keyup"` events
|
|
1075
|
+
*/
|
|
844
1076
|
export declare function useKeyboardListener({ onKeyDown, onKeyUp }: UseKeyboardListenerParams): void;
|
|
845
1077
|
|
|
846
|
-
declare interface UseKeyboardListenerParams {
|
|
1078
|
+
export declare interface UseKeyboardListenerParams {
|
|
1079
|
+
/** Function that handles `"keydown"` events */
|
|
847
1080
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
1081
|
+
/** Function that handles `"keyup"` events */
|
|
848
1082
|
onKeyUp?: (event: KeyboardEvent) => void;
|
|
849
1083
|
}
|
|
850
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* Returns the items of a list value of a setting and a function to update it
|
|
1087
|
+
* @param path The path of the settings file
|
|
1088
|
+
* @param key The key of the setting
|
|
1089
|
+
* @param defaultValue The default value of the setting
|
|
1090
|
+
* @returns The items of a list value of a setting and a function to update it
|
|
1091
|
+
*/
|
|
1092
|
+
export declare function useListSetting(path: SettingsPath, key: string, defaultValue?: string[]): [string[], (value: string | string[]) => void];
|
|
1093
|
+
|
|
851
1094
|
export declare function useModalsManager(): ModalsManagerState;
|
|
852
1095
|
|
|
1096
|
+
/**
|
|
1097
|
+
* Creates listeners for `"mousedown"`, `"mouseup"`, `"click"` and `"contextmenu"` events
|
|
1098
|
+
*/
|
|
853
1099
|
export declare function useMouseListener({ onMouseDown, onMouseUp, onClick, onContextMenu }: UseMouseListenerParams): void;
|
|
854
1100
|
|
|
855
|
-
declare interface UseMouseListenerParams {
|
|
1101
|
+
export declare interface UseMouseListenerParams {
|
|
1102
|
+
/** Function that handles `"mousedown"` events */
|
|
856
1103
|
onMouseDown: EventListener;
|
|
1104
|
+
/** Function that handles `"mouseup"` events */
|
|
857
1105
|
onMouseUp: EventListener;
|
|
1106
|
+
/** Function that handles `"click"` events */
|
|
858
1107
|
onClick: EventListener;
|
|
1108
|
+
/** Function that handles `"contextmenu"` events */
|
|
859
1109
|
onContextMenu: EventListener;
|
|
860
1110
|
}
|
|
861
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* Returns the ideal orientation of an element so that it does not go outside of the screen
|
|
1114
|
+
*/
|
|
862
1115
|
export declare function useScreenBounds({ avoidTaskbar }: {
|
|
1116
|
+
/** Whether to avoid the task bar */
|
|
863
1117
|
avoidTaskbar: boolean;
|
|
864
1118
|
}): {
|
|
1119
|
+
/** The React ref of the element */
|
|
865
1120
|
ref: Ref<HTMLElement>;
|
|
866
1121
|
initiated: boolean;
|
|
1122
|
+
/** Whether the element should align to the left (`true`) or right (`false`) */
|
|
867
1123
|
alignLeft: boolean;
|
|
1124
|
+
/** Whether the element should align to the top (`true`) or bottom (`false`) */
|
|
868
1125
|
alignTop: boolean;
|
|
869
1126
|
};
|
|
870
1127
|
|
|
1128
|
+
/**
|
|
1129
|
+
* Returns the width and height of the element with ID "root"
|
|
1130
|
+
*/
|
|
871
1131
|
export declare function useScreenDimensions(): [screenWidth: number | null, screenHeight: number | null];
|
|
872
1132
|
|
|
873
1133
|
export declare function useScrollWithShadow(params: UseScrollWithShadowParams): {
|
|
@@ -877,7 +1137,7 @@ export declare function useScrollWithShadow(params: UseScrollWithShadowParams):
|
|
|
877
1137
|
}) => void;
|
|
878
1138
|
};
|
|
879
1139
|
|
|
880
|
-
declare interface UseScrollWithShadowParams {
|
|
1140
|
+
export declare interface UseScrollWithShadowParams {
|
|
881
1141
|
ref?: MutableRefObject<HTMLElement>;
|
|
882
1142
|
horizontal?: boolean;
|
|
883
1143
|
dynamicOffset?: boolean;
|
|
@@ -895,14 +1155,25 @@ declare interface UseScrollWithShadowParams {
|
|
|
895
1155
|
};
|
|
896
1156
|
}
|
|
897
1157
|
|
|
1158
|
+
/**
|
|
1159
|
+
* Returns the value of a setting and a function to update it
|
|
1160
|
+
* @param path The path of the settings file
|
|
1161
|
+
* @param key The key of the setting
|
|
1162
|
+
* @param defaultValue The default value of the setting
|
|
1163
|
+
* @param parse A function that converts a string to a value
|
|
1164
|
+
* @param stringify A function that converts a value to a string
|
|
1165
|
+
* @returns The value of a setting and a function to update it
|
|
1166
|
+
*/
|
|
1167
|
+
export declare function useSetting<Type = string>(path: SettingsPath, key: string, defaultValue: Type, parse: (value: string) => Type, stringify?: (value: Type) => string): [Type, (value: Type | string) => void];
|
|
1168
|
+
|
|
898
1169
|
export declare function useSettingsManager(): SettingsManagerState;
|
|
899
1170
|
|
|
900
1171
|
/**
|
|
901
|
-
*
|
|
1172
|
+
* Creates listeners for keyboard shortcuts
|
|
902
1173
|
*/
|
|
903
1174
|
export declare function useShortcuts({ options, shortcuts, useCategories }: UseShortcutsParams): void;
|
|
904
1175
|
|
|
905
|
-
declare interface UseShortcutsParams {
|
|
1176
|
+
export declare interface UseShortcutsParams {
|
|
906
1177
|
options: Record<string, Record<string, (event: KeyboardEvent) => void>> | Record<string, (event: KeyboardEvent) => void>;
|
|
907
1178
|
shortcuts?: Record<string, Record<string, string[]>> | Record<string, string[]>;
|
|
908
1179
|
useCategories?: boolean;
|
|
@@ -913,6 +1184,15 @@ declare interface UseShortcutsParams {
|
|
|
913
1184
|
*/
|
|
914
1185
|
export declare function useStaticClassName(block?: string, element?: string, modifier?: string | string[]): string | null;
|
|
915
1186
|
|
|
1187
|
+
/**
|
|
1188
|
+
* Returns the value of a setting and a function to update it
|
|
1189
|
+
* @param path The path of the settings file
|
|
1190
|
+
* @param key The key of the setting
|
|
1191
|
+
* @param defaultValue The default value of the setting
|
|
1192
|
+
* @returns The value of a setting and a function to update it
|
|
1193
|
+
*/
|
|
1194
|
+
export declare function useStringSetting(path: SettingsPath, key: string, defaultValue?: string | null): [string | null, (value: string | null) => void];
|
|
1195
|
+
|
|
916
1196
|
export declare function useSystemManager(): SystemManager;
|
|
917
1197
|
|
|
918
1198
|
export declare function useTrackingManager(): TrackingManagerState;
|
|
@@ -927,7 +1207,7 @@ export declare function useWindowsManager(): WindowsManagerState;
|
|
|
927
1207
|
|
|
928
1208
|
export declare function useZIndex({ groupIndex, index }: UseZIndexParams): number;
|
|
929
1209
|
|
|
930
|
-
declare interface UseZIndexParams {
|
|
1210
|
+
export declare interface UseZIndexParams {
|
|
931
1211
|
groupIndex: number;
|
|
932
1212
|
index: number;
|
|
933
1213
|
}
|
|
@@ -955,16 +1235,27 @@ export declare class Vector2 {
|
|
|
955
1235
|
export declare const VIDEO_EXTENSIONS: string[];
|
|
956
1236
|
|
|
957
1237
|
declare class VirtualBase extends EventEmitter<EventNamesMap> {
|
|
1238
|
+
/** The name of this item */
|
|
958
1239
|
name: string;
|
|
1240
|
+
/** The alias of this item */
|
|
959
1241
|
alias: string | undefined | null;
|
|
1242
|
+
/** The folder this item is in */
|
|
960
1243
|
parent: VirtualFolder | undefined | null;
|
|
1244
|
+
/** Whether this item is protected from changes */
|
|
961
1245
|
isProtected: boolean | undefined | null;
|
|
1246
|
+
/** The URL of the icon of this item */
|
|
962
1247
|
iconUrl: string | undefined | null;
|
|
1248
|
+
/** The file this item links to */
|
|
963
1249
|
linkedFile: VirtualFile | undefined | null;
|
|
1250
|
+
/** The folder this item links to */
|
|
964
1251
|
linkedFolder: VirtualFolder | undefined | null;
|
|
1252
|
+
/** Whether this item has been edited by the user */
|
|
965
1253
|
editedByUser: boolean | undefined | null;
|
|
1254
|
+
/** Whether this item is the root folder */
|
|
966
1255
|
isRoot: boolean | undefined | null;
|
|
1256
|
+
/** The root folder */
|
|
967
1257
|
root: VirtualRoot | undefined | null;
|
|
1258
|
+
/** Whether this item has been deleted */
|
|
968
1259
|
isDeleted: boolean;
|
|
969
1260
|
static EVENT_NAMES: {
|
|
970
1261
|
update: string;
|
|
@@ -978,9 +1269,18 @@ declare class VirtualBase extends EventEmitter<EventNamesMap> {
|
|
|
978
1269
|
setIconUrl(iconUrl: string | null): this;
|
|
979
1270
|
getIconUrl(): string;
|
|
980
1271
|
getType(): string;
|
|
1272
|
+
/**
|
|
1273
|
+
* Tries to delete this item
|
|
1274
|
+
*/
|
|
981
1275
|
delete(): void;
|
|
982
1276
|
confirmChanges(root?: VirtualRoot): void;
|
|
1277
|
+
/**
|
|
1278
|
+
* Opens this item in the appropriate application
|
|
1279
|
+
*/
|
|
983
1280
|
open(..._args: unknown[]): unknown;
|
|
1281
|
+
/**
|
|
1282
|
+
* Returns the path of this item
|
|
1283
|
+
*/
|
|
984
1284
|
get path(): string;
|
|
985
1285
|
/**
|
|
986
1286
|
* Returns path without using this item's alias
|
|
@@ -994,6 +1294,9 @@ declare class VirtualBase extends EventEmitter<EventNamesMap> {
|
|
|
994
1294
|
* Returns whether this can be edited in its current state
|
|
995
1295
|
*/
|
|
996
1296
|
get canBeEdited(): boolean;
|
|
1297
|
+
/**
|
|
1298
|
+
* Returns the root folder
|
|
1299
|
+
*/
|
|
997
1300
|
getRoot(): VirtualRoot;
|
|
998
1301
|
isFile(): boolean;
|
|
999
1302
|
isFolder(): boolean;
|
|
@@ -1012,7 +1315,7 @@ export declare class VirtualDriveConfig {
|
|
|
1012
1315
|
constructor(options?: Partial<VirtualDriveConfigOptions>);
|
|
1013
1316
|
}
|
|
1014
1317
|
|
|
1015
|
-
declare interface VirtualDriveConfigOptions {
|
|
1318
|
+
export declare interface VirtualDriveConfigOptions {
|
|
1016
1319
|
/**
|
|
1017
1320
|
* Enables persistent storage of the virtual drive
|
|
1018
1321
|
* @default true
|
|
@@ -1055,8 +1358,11 @@ declare interface VirtualDriveConfigOptions {
|
|
|
1055
1358
|
* A virtual file that can be stored inside a folder
|
|
1056
1359
|
*/
|
|
1057
1360
|
export declare class VirtualFile extends VirtualBase {
|
|
1361
|
+
/** The extension of this file */
|
|
1058
1362
|
extension: OptionalStringProperty;
|
|
1363
|
+
/** The URL of the source of this file */
|
|
1059
1364
|
source: OptionalStringProperty;
|
|
1365
|
+
/** The content of this file */
|
|
1060
1366
|
content: OptionalStringProperty;
|
|
1061
1367
|
static NON_TEXT_EXTENSIONS: string[];
|
|
1062
1368
|
static EVENT_NAMES: {
|
|
@@ -1092,7 +1398,7 @@ export declare class VirtualFile extends VirtualBase {
|
|
|
1092
1398
|
static removeFileScheme(source: string): string;
|
|
1093
1399
|
}
|
|
1094
1400
|
|
|
1095
|
-
declare interface VirtualFileJson extends VirtualBaseJson {
|
|
1401
|
+
export declare interface VirtualFileJson extends VirtualBaseJson {
|
|
1096
1402
|
ext?: string;
|
|
1097
1403
|
cnt?: string;
|
|
1098
1404
|
src?: string;
|
|
@@ -1117,7 +1423,7 @@ export declare class VirtualFileLink extends VirtualFile {
|
|
|
1117
1423
|
getIconUrl(...args: Parameters<VirtualFile["getIconUrl"]>): ReturnType<VirtualFile["getIconUrl"]>;
|
|
1118
1424
|
}
|
|
1119
1425
|
|
|
1120
|
-
declare interface VirtualFileLinkJson extends VirtualFileJson {
|
|
1426
|
+
export declare interface VirtualFileLinkJson extends VirtualFileJson {
|
|
1121
1427
|
lnk: string;
|
|
1122
1428
|
}
|
|
1123
1429
|
|
|
@@ -1125,8 +1431,14 @@ declare interface VirtualFileLinkJson extends VirtualFileJson {
|
|
|
1125
1431
|
* A virtual folder that can contains files and sub-folders
|
|
1126
1432
|
*/
|
|
1127
1433
|
export declare class VirtualFolder extends VirtualBase {
|
|
1434
|
+
/** The folders inside this folder */
|
|
1128
1435
|
subFolders: (VirtualFolder | VirtualFolderLink)[];
|
|
1436
|
+
/** The files inside this folder */
|
|
1129
1437
|
files: (VirtualFile | VirtualFileLink)[];
|
|
1438
|
+
/**
|
|
1439
|
+
* The type of this folder
|
|
1440
|
+
* @default VirtualFolder.TYPE.general
|
|
1441
|
+
*/
|
|
1130
1442
|
type: number | undefined;
|
|
1131
1443
|
static TYPE: {
|
|
1132
1444
|
general: number;
|
|
@@ -1223,7 +1535,7 @@ export declare class VirtualFolder extends VirtualBase {
|
|
|
1223
1535
|
toJSON(): VirtualFolderJson | null;
|
|
1224
1536
|
}
|
|
1225
1537
|
|
|
1226
|
-
declare interface VirtualFolderJson extends VirtualBaseJson {
|
|
1538
|
+
export declare interface VirtualFolderJson extends VirtualBaseJson {
|
|
1227
1539
|
fls?: VirtualFileJson[];
|
|
1228
1540
|
fds?: VirtualFolderJson[];
|
|
1229
1541
|
}
|
|
@@ -1254,7 +1566,7 @@ export declare class VirtualFolderLink extends VirtualFolder {
|
|
|
1254
1566
|
getItemCount(...args: Parameters<VirtualFolder["getItemCount"]>): ReturnType<VirtualFolder["getItemCount"]>;
|
|
1255
1567
|
}
|
|
1256
1568
|
|
|
1257
|
-
declare interface VirtualFolderLinkJson extends VirtualFolderJson {
|
|
1569
|
+
export declare interface VirtualFolderLinkJson extends VirtualFolderJson {
|
|
1258
1570
|
lnk: string;
|
|
1259
1571
|
}
|
|
1260
1572
|
|
|
@@ -1262,6 +1574,7 @@ declare interface VirtualFolderLinkJson extends VirtualFolderJson {
|
|
|
1262
1574
|
* A virtual folder that serves as the root folder
|
|
1263
1575
|
*/
|
|
1264
1576
|
export declare class VirtualRoot extends VirtualFolder {
|
|
1577
|
+
/** Aliases for files and folders */
|
|
1265
1578
|
shortcuts: Record<string, VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink>;
|
|
1266
1579
|
initiated: boolean;
|
|
1267
1580
|
loadedDefaultData: boolean;
|
|
@@ -1278,7 +1591,7 @@ export declare class VirtualRoot extends VirtualFolder {
|
|
|
1278
1591
|
*/
|
|
1279
1592
|
saveData(): void;
|
|
1280
1593
|
/**
|
|
1281
|
-
*
|
|
1594
|
+
* Initializes this root by loading the default data and then the user's data on top
|
|
1282
1595
|
*/
|
|
1283
1596
|
init(): VirtualRoot;
|
|
1284
1597
|
/**
|
|
@@ -1289,34 +1602,47 @@ export declare class VirtualRoot extends VirtualFolder {
|
|
|
1289
1602
|
* Tells the storage manager to clear all data and reloads the window
|
|
1290
1603
|
*/
|
|
1291
1604
|
reset(): void;
|
|
1292
|
-
static isValidName(_name: string):
|
|
1293
|
-
static isValidFileName(_name: string):
|
|
1294
|
-
static isValidFolderName(_name: string):
|
|
1605
|
+
static isValidName(_name: string): boolean;
|
|
1606
|
+
static isValidFileName(_name: string): boolean;
|
|
1607
|
+
static isValidFolderName(_name: string): boolean;
|
|
1295
1608
|
get path(): string;
|
|
1296
1609
|
get displayPath(): string;
|
|
1297
1610
|
toJSON(): VirtualRootJson | null;
|
|
1298
1611
|
toString(): string | null;
|
|
1299
1612
|
}
|
|
1300
1613
|
|
|
1301
|
-
declare
|
|
1614
|
+
export declare const VirtualRootContext: Context<VirtualRootState>;
|
|
1615
|
+
|
|
1616
|
+
export declare interface VirtualRootJson extends VirtualFolderJson {
|
|
1302
1617
|
scs: Record<string, string>;
|
|
1303
1618
|
}
|
|
1304
1619
|
|
|
1305
|
-
declare type VirtualRootState = VirtualRoot | undefined;
|
|
1620
|
+
export declare type VirtualRootState = VirtualRoot | undefined;
|
|
1306
1621
|
|
|
1622
|
+
/**
|
|
1623
|
+
* Component that renders an external application inside an iframe
|
|
1624
|
+
*/
|
|
1307
1625
|
export declare const WebView: FC<WebViewProps>;
|
|
1308
1626
|
|
|
1309
|
-
declare interface WebViewProps extends WindowProps {
|
|
1627
|
+
export declare interface WebViewProps extends WindowProps {
|
|
1628
|
+
/** The URL of the external application */
|
|
1310
1629
|
source?: string;
|
|
1311
1630
|
title?: string;
|
|
1312
1631
|
}
|
|
1313
1632
|
|
|
1314
1633
|
export declare function WindowedModal({ modal, params, children, ...props }: ModalProps): JSX_2.Element;
|
|
1315
1634
|
|
|
1316
|
-
declare interface WindowOptions {
|
|
1635
|
+
export declare interface WindowOptions {
|
|
1636
|
+
/** The ID of the window */
|
|
1317
1637
|
id?: string;
|
|
1638
|
+
/** The app associated with the window */
|
|
1318
1639
|
app?: App;
|
|
1640
|
+
/**
|
|
1641
|
+
* The size of the window
|
|
1642
|
+
* @default new Vector2(700, 400)
|
|
1643
|
+
*/
|
|
1319
1644
|
size?: Vector2;
|
|
1645
|
+
/** The position of the window */
|
|
1320
1646
|
position?: Vector2;
|
|
1321
1647
|
fullscreen?: boolean | string;
|
|
1322
1648
|
options?: object;
|
|
@@ -1326,22 +1652,31 @@ declare interface WindowOptions {
|
|
|
1326
1652
|
[key: string]: unknown;
|
|
1327
1653
|
}
|
|
1328
1654
|
|
|
1329
|
-
declare interface WindowOptions_2 {
|
|
1330
|
-
size?: Vector2;
|
|
1331
|
-
[key: string]: unknown;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
1655
|
export declare interface WindowProps extends WindowOptions {
|
|
1656
|
+
/**
|
|
1657
|
+
* Whether to start the window in fullscreen mode
|
|
1658
|
+
* @default false
|
|
1659
|
+
*/
|
|
1335
1660
|
fullscreen?: boolean;
|
|
1661
|
+
/** Function that handles interactions with the window */
|
|
1336
1662
|
onInteract?: () => void;
|
|
1663
|
+
/** Function that sets the title of the window */
|
|
1337
1664
|
setTitle?: React.Dispatch<React.SetStateAction<string>>;
|
|
1665
|
+
/** Function that sets the icon URL of the window */
|
|
1338
1666
|
setIconUrl?: React.Dispatch<React.SetStateAction<string>>;
|
|
1667
|
+
/** Function that closes the window */
|
|
1339
1668
|
close?: (event?: Event) => void;
|
|
1669
|
+
/** Function that brings the window in focus */
|
|
1340
1670
|
focus?: (event: Event, force?: boolean) => void;
|
|
1671
|
+
/** Whether the window is currently focused and should allow interactions */
|
|
1341
1672
|
active?: boolean;
|
|
1673
|
+
/** Whether to start the window in minimized mode */
|
|
1342
1674
|
minimized?: boolean;
|
|
1675
|
+
/** Function that toggles the minimized mode of the window */
|
|
1343
1676
|
toggleMinimized?: (event?: Event) => void;
|
|
1677
|
+
/** The depth value of the window */
|
|
1344
1678
|
index?: number;
|
|
1679
|
+
/** Whether the window is in standalone mode */
|
|
1345
1680
|
standalone?: boolean;
|
|
1346
1681
|
}
|
|
1347
1682
|
|
|
@@ -1352,12 +1687,14 @@ export declare class WindowsConfig {
|
|
|
1352
1687
|
constructor(options?: Partial<WindowsConfigOptions>);
|
|
1353
1688
|
}
|
|
1354
1689
|
|
|
1355
|
-
declare interface WindowsConfigOptions {
|
|
1690
|
+
export declare interface WindowsConfigOptions {
|
|
1356
1691
|
/**
|
|
1692
|
+
* The margin around windows that are not maximized, in pixels
|
|
1357
1693
|
* @default 32
|
|
1358
1694
|
*/
|
|
1359
1695
|
screenMargin: number;
|
|
1360
1696
|
/**
|
|
1697
|
+
* The separator to use in window titles
|
|
1361
1698
|
* @default "-"
|
|
1362
1699
|
*/
|
|
1363
1700
|
titleSeparator: string;
|
|
@@ -1368,16 +1705,21 @@ declare interface WindowsConfigOptions {
|
|
|
1368
1705
|
minScreenSize: Vector2;
|
|
1369
1706
|
}
|
|
1370
1707
|
|
|
1708
|
+
/**
|
|
1709
|
+
* Manages the states of windows
|
|
1710
|
+
*/
|
|
1371
1711
|
export declare class WindowsManager {
|
|
1372
1712
|
#private;
|
|
1373
1713
|
windows: {
|
|
1374
1714
|
[id: string]: WindowOptions;
|
|
1375
1715
|
};
|
|
1716
|
+
/** Function that handles changes to the open windows */
|
|
1376
1717
|
updateWindows: (window: WindowsManager["windows"]) => void;
|
|
1377
1718
|
startupComplete: boolean;
|
|
1378
1719
|
constructor(systemManager: SystemManager, trackingManager: TrackingManager);
|
|
1379
1720
|
/**
|
|
1380
|
-
*
|
|
1721
|
+
* Opens a window for an application
|
|
1722
|
+
* @param appId The ID of the app
|
|
1381
1723
|
*/
|
|
1382
1724
|
open(appId: string, options?: WindowOptions | null): object | null;
|
|
1383
1725
|
/**
|
|
@@ -1423,11 +1765,24 @@ export declare class WindowsManager {
|
|
|
1423
1765
|
get windowIds(): string[];
|
|
1424
1766
|
}
|
|
1425
1767
|
|
|
1426
|
-
declare
|
|
1768
|
+
export declare const WindowsManagerContext: Context<WindowsManagerState>;
|
|
1427
1769
|
|
|
1770
|
+
export declare type WindowsManagerState = WindowsManager | undefined;
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* Component that renders the windows for all currently active applications
|
|
1774
|
+
*/
|
|
1428
1775
|
export declare const WindowsView: FC;
|
|
1429
1776
|
|
|
1430
|
-
|
|
1777
|
+
/**
|
|
1778
|
+
* Component that renders the window for an application
|
|
1779
|
+
*/
|
|
1780
|
+
export declare const WindowView: FC<WindowProps>;
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* Represents a group of HTML elements whose z-index is automatically calculated based on a given order
|
|
1784
|
+
*/
|
|
1785
|
+
export declare class ZIndexGroup {
|
|
1431
1786
|
length: number;
|
|
1432
1787
|
offset: number;
|
|
1433
1788
|
groupIndex: number;
|