prozilla-os 1.3.12 → 1.3.15

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 CHANGED
@@ -1,3 +1,6 @@
1
+ import { Context } from 'react';
2
+ import { Dispatch } from 'react';
3
+ import { EventEmitter as EventEmitter_2 } from '@prozilla-os/shared';
1
4
  import { FC } from 'react';
2
5
  import { HTMLAttributeAnchorTarget } from 'react';
3
6
  import { IconProp } from '@fortawesome/fontawesome-svg-core';
@@ -9,20 +12,28 @@ import { NamedExoticComponent } from 'react';
9
12
  import { ReactElement } from 'react';
10
13
  import { ReactNode } from 'react';
11
14
  import { Ref } from 'react';
15
+ import { SetStateAction } from 'react';
12
16
  import { UaEventOptions } from 'react-ga4/types/ga4';
13
17
  import { default as utilStyles } from './utils.module.css';
14
18
 
15
- declare interface ActionProps {
19
+ export declare interface ActionProps {
20
+ /** ID of the action */
16
21
  actionId?: string;
22
+ /** Label of the action */
17
23
  label?: string;
24
+ /** Icon for the action */
18
25
  icon?: string | object;
26
+ /** Keyboard shortcut for the action */
19
27
  shortcut?: string[];
28
+ /** Function that handles the trigger event for the action */
20
29
  onTrigger?: (event?: Event, triggerParams?: unknown, ...args: unknown[]) => void;
21
30
  children?: ReactNode;
31
+ /** Whether the action should be disabled */
22
32
  disabled?: boolean;
23
33
  }
24
34
 
25
35
  /**
36
+ * Component that renders a collection of actions (e.g., as a context menu or a header menu) and handles keyboard shortcuts
26
37
  * @example
27
38
  * <ClickAction
28
39
  * label="Reload"
@@ -35,20 +46,34 @@ declare interface ActionProps {
35
46
  */
36
47
  export declare function Actions({ children, mode, className, onAnyTrigger, triggerParams, avoidTaskbar }: ActionsProps): ReactElement;
37
48
 
38
- declare interface ActionsProps {
49
+ export declare interface ActionsProps {
39
50
  mode?: string;
51
+ /** `className` prop for the container */
40
52
  className?: string;
53
+ /** Function that handles the trigger event for all actions */
41
54
  onAnyTrigger?: (event: Event, triggerParams: unknown, ...args: unknown[]) => void;
42
55
  children?: ReactNode;
56
+ /** The parameters to pass whenever an action is triggered */
43
57
  triggerParams?: unknown;
58
+ /** Whether the actions should automatically orient themselves to not overlap with the taskbar */
44
59
  avoidTaskbar?: boolean;
45
60
  [key: string]: unknown;
46
61
  }
47
62
 
48
- declare interface AlertParams {
63
+ export declare interface AlertParams {
64
+ /**
65
+ * The title of the alert
66
+ * @default "Alert"
67
+ */
49
68
  title: string;
69
+ /** The body of the alert */
50
70
  text: string;
71
+ /** The URL of the icon of the alert */
51
72
  iconUrl?: string;
73
+ /**
74
+ * The size of the alert modal
75
+ * @default new Vector2(300, 150)
76
+ */
52
77
  size?: Vector2;
53
78
  single?: boolean;
54
79
  }
@@ -71,9 +96,9 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
71
96
  */
72
97
  windowContent: FC<AppProps>;
73
98
  /**
74
- * Default options that get passed to the {@link this.windowContent} component
99
+ * Default options that get passed to the {@link App.windowContent} component
75
100
  */
76
- windowOptions?: Partial<AppProps> & WindowOptions_2;
101
+ windowOptions?: Partial<AppProps> & DefaultWindowOptions;
77
102
  /**
78
103
  * Description of this application
79
104
  */
@@ -116,26 +141,29 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
116
141
  isActive: boolean;
117
142
  isPinned?: boolean;
118
143
  isInstalled: boolean;
119
- constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> & WindowOptions_2);
144
+ constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> & DefaultWindowOptions);
145
+ /**
146
+ * Returns the component that renders the content of a window for this app
147
+ */
120
148
  WindowContent: (props: AppProps) => JSX_2.Element | null;
121
149
  /**
122
- * Set the display name of this application
150
+ * Sets the display name of this application
123
151
  */
124
152
  setName(name: string): this;
125
153
  /**
126
- * Set the description of this application
154
+ * Sets the description of this application
127
155
  */
128
156
  setDescription(description: App["description"]): this;
129
157
  /**
130
- * Set the URL of the icon of this application
158
+ * Sets the URL of the icon of this application
131
159
  */
132
160
  setIconUrl(iconUrl: App["iconUrl"]): this;
133
161
  /**
134
- * Set the role of this application
162
+ * Sets the role of this application
135
163
  */
136
164
  setRole(role: string | null): this;
137
165
  /**
138
- * Set the associated extensions of this application
166
+ * Sets the associated extensions of this application
139
167
  */
140
168
  setAssociatedExtensions(extensions: string[] | null): this;
141
169
  /**
@@ -151,11 +179,11 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
151
179
  */
152
180
  setInstalled(installed: boolean): this;
153
181
  /**
154
- * Changes the category this application belongs to
182
+ * Sets the category this application belongs to
155
183
  */
156
184
  setCategory(category: typeof APP_CATEGORIES[number] | null): this;
157
185
  /**
158
- * Changes the metadata for this application
186
+ * Sets the metadata for this application
159
187
  */
160
188
  setMetadata(metadata: AppMetadata | null): this;
161
189
  /**
@@ -163,16 +191,16 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
163
191
  */
164
192
  setShowDesktopIcon(showDesktopIcon: boolean): this;
165
193
  /**
166
- * Changes the default options for the {@link this.windowContent} component
194
+ * Sets the default options for the {@link App.windowContent} component
167
195
  */
168
- setWindowOptions(windowOptions: Partial<AppProps> & WindowOptions_2): this;
196
+ setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this;
169
197
  }
170
198
 
171
199
  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
200
 
173
201
  export declare const appCenter: App<WindowProps>;
174
202
 
175
- declare interface AppMetadata {
203
+ export declare interface AppMetadata {
176
204
  name: string;
177
205
  version: `${number}.${number}.${number}`;
178
206
  author: string;
@@ -208,7 +236,7 @@ export declare class AppsConfig {
208
236
  getAppsByCategory(category: typeof APP_CATEGORIES[number]): App[];
209
237
  }
210
238
 
211
- declare interface AppsConfigOptions {
239
+ export declare interface AppsConfigOptions {
212
240
  /**
213
241
  * An array of applications
214
242
  */
@@ -225,7 +253,7 @@ declare interface BrowserProps extends WindowProps {
225
253
 
226
254
  export declare function Button({ className, href, children, icon, target, ...props }: ButtonProps): JSX_2.Element;
227
255
 
228
- declare interface ButtonProps {
256
+ export declare interface ButtonProps {
229
257
  className?: string;
230
258
  href?: string;
231
259
  icon?: IconProp;
@@ -238,7 +266,7 @@ export declare const calculator: App<WindowProps>;
238
266
 
239
267
  export declare const ClickAction: MemoExoticComponent<({ actionId, label, shortcut, disabled, onTrigger, icon }: ClickActionProps) => JSX_2.Element>;
240
268
 
241
- declare interface ClickActionProps extends ActionProps {
269
+ export declare interface ClickActionProps extends ActionProps {
242
270
  icon?: string | object;
243
271
  }
244
272
 
@@ -250,10 +278,47 @@ export declare function closeViewport(requireConfirmation: boolean | undefined,
250
278
 
251
279
  export declare const CODE_EXTENSIONS: string[];
252
280
 
281
+ export declare class Command {
282
+ #private;
283
+ options: Option_2[];
284
+ manual?: Manual;
285
+ requireArgs?: boolean;
286
+ requireOptions?: boolean;
287
+ execute: Execute;
288
+ setName(name?: string): Command;
289
+ get name(): string;
290
+ setExecute(execute: Execute): Command;
291
+ setRequireArgs(value: boolean): Command;
292
+ setRequireOptions(value: boolean): Command;
293
+ setManual({ purpose, usage, description, options }: Manual): Command;
294
+ addOption({ short, long, isInput }: Option_2): Command;
295
+ getOption(key: string): Option_2 | null;
296
+ }
297
+
298
+ export declare type CommandResponse = string | {
299
+ blank: boolean;
300
+ } | void | Stream;
301
+
302
+ export declare class CommandsManager {
303
+ static COMMANDS: Command[];
304
+ static addCommand(command: Command): void;
305
+ static find(name: string): Command | null;
306
+ static search(pattern: string): Command[];
307
+ static reload(): void;
308
+ }
309
+
253
310
  export declare function copyToClipboard(string: string, onSuccess?: (value: void) => void, onFail?: (value: void) => void): void;
254
311
 
255
312
  export declare function DefaultRoute(): JSX_2.Element;
256
313
 
314
+ export declare interface DefaultWindowOptions {
315
+ size?: Vector2;
316
+ [key: string]: unknown;
317
+ }
318
+
319
+ /**
320
+ * Component that renders the wallpaper and desktop icons
321
+ */
257
322
  export declare const Desktop: MemoExoticComponent<() => JSX_2.Element>;
258
323
 
259
324
  export declare class DesktopConfig {
@@ -262,12 +327,14 @@ export declare class DesktopConfig {
262
327
  constructor(options?: Partial<DesktopConfigOptions>);
263
328
  }
264
329
 
265
- declare interface DesktopConfigOptions {
330
+ export declare interface DesktopConfigOptions {
266
331
  /**
332
+ * The default size of the icons
267
333
  * @default 1
268
334
  */
269
335
  defaultIconSize: 0 | 1 | 2;
270
336
  /**
337
+ * The defailt direction of the icons
271
338
  * 0: vertical, 1: horizontal
272
339
  * @default 0
273
340
  * */
@@ -276,19 +343,33 @@ declare interface DesktopConfigOptions {
276
343
 
277
344
  export declare function DialogBox({ modal, params, children, ...props }: ModalProps): JSX_2.Element;
278
345
 
346
+ /**
347
+ * Component that displays the contents of a directory
348
+ */
279
349
  export declare function DirectoryList({ directory, showHidden, folderClassName, fileClassName, className, onContextMenuFile, onContextMenuFolder, onOpenFile, onOpenFolder, allowMultiSelect, onSelectionChange, ...props }: DirectoryListProps): ReactElement | null;
280
350
 
281
- declare interface DirectoryListProps {
351
+ export declare interface DirectoryListProps {
352
+ /** The directory to display */
282
353
  directory: VirtualFolder;
354
+ /** Whether to show hidden files and folders */
283
355
  showHidden?: boolean;
356
+ /** `className` prop for folders */
284
357
  folderClassName?: string;
358
+ /** `className` prop for files */
285
359
  fileClassName?: string;
360
+ /** `className` prop for this component */
286
361
  className?: string;
362
+ /** Function that handles context menu interactions on files */
287
363
  onContextMenuFile?: FileEventHandler;
364
+ /** Function that handles context menu interactions on folders */
288
365
  onContextMenuFolder?: FolderEventHandler;
366
+ /** Function that handles file opening events */
289
367
  onOpenFile?: FileEventHandler;
368
+ /** Function that handles folder opening events */
290
369
  onOpenFolder?: FolderEventHandler;
370
+ /** Whether to allow multiple files and folders to be selected at the same time */
291
371
  allowMultiSelect?: boolean;
372
+ /** Function that handles selection changes */
292
373
  onSelectionChange?: (params: OnSelectionChangeParams) => void;
293
374
  [key: string]: unknown;
294
375
  }
@@ -299,15 +380,21 @@ export declare function downloadUrl(url: string, name: string): void;
299
380
 
300
381
  export declare function DropdownAction({ label, icon, children, showOnHover }: DropdownActionProps): ReactElement;
301
382
 
302
- declare interface DropdownActionProps extends ActionProps {
383
+ export declare interface DropdownActionProps extends ActionProps {
303
384
  showOnHover?: boolean;
304
385
  }
305
386
 
387
+ /**
388
+ * Component that opens a dropdown menu
389
+ */
306
390
  export declare function DropdownButton({ label, options, shortcuts }: DropdownButtonProps): JSX_2.Element;
307
391
 
308
- declare interface DropdownButtonProps {
392
+ export declare interface DropdownButtonProps {
393
+ /** The label of the button */
309
394
  label: string;
395
+ /** The options in the dropdown menu mapped to the function that handles their selection */
310
396
  options: Record<string, () => void>;
397
+ /** The keyboard shortcut for options in the dropdown menu */
311
398
  shortcuts: Record<string, string[]>;
312
399
  }
313
400
 
@@ -317,11 +404,11 @@ declare class EventEmitter<EventMap extends EventNamesMap> {
317
404
  /**
318
405
  * Add event listener for an event
319
406
  */
320
- on<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void): void;
407
+ on<Key extends keyof EventMap>(eventName: Key, callback: Listener): Listener;
321
408
  /**
322
409
  * Remove event listener for an event
323
410
  */
324
- off<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void): void;
411
+ off<Key extends keyof EventMap>(eventName: Key, callback: Listener): void;
325
412
  /**
326
413
  * Dispatch event
327
414
  */
@@ -330,6 +417,26 @@ declare class EventEmitter<EventMap extends EventNamesMap> {
330
417
 
331
418
  declare type EventNamesMap = Record<string, string>;
332
419
 
420
+ declare type Execute = (args?: string[], params?: ExecuteParams) => CommandResponse | Promise<CommandResponse>;
421
+
422
+ export declare type ExecuteParams = {
423
+ promptOutput?: (text: string) => void;
424
+ pushHistory?: (entry: HistoryEntry) => void;
425
+ virtualRoot?: VirtualRoot;
426
+ currentDirectory: VirtualFolder;
427
+ setCurrentDirectory?: Dispatch<SetStateAction<VirtualFolder>>;
428
+ username?: string;
429
+ hostname?: string;
430
+ rawInputValue?: string;
431
+ options?: string[];
432
+ exit?: () => void;
433
+ inputs?: Record<string, string>;
434
+ timestamp: number;
435
+ settingsManager: SettingsManager;
436
+ systemManager: SystemManager;
437
+ app: App;
438
+ };
439
+
333
440
  export declare const FILE_SCHEMES: {
334
441
  external: string;
335
442
  app: string;
@@ -362,9 +469,9 @@ export declare type FolderEventHandler = (event: Event, folder: VirtualFolder) =
362
469
  */
363
470
  export declare function formatShortcut(shortcut: string[]): string;
364
471
 
365
- export declare function generateUrl(options: GenerateUrlOptions): string;
472
+ export declare function generateUrl(options: GenerateUrlParams): string;
366
473
 
367
- declare interface GenerateUrlOptions {
474
+ export declare interface GenerateUrlParams {
368
475
  appId?: string;
369
476
  fullscreen?: boolean;
370
477
  standalone?: boolean;
@@ -372,8 +479,18 @@ declare interface GenerateUrlOptions {
372
479
 
373
480
  export declare function getViewportParams(): Record<string, string>;
374
481
 
482
+ /**
483
+ * Component that shows a header menu at the top of a window
484
+ */
375
485
  export declare function HeaderMenu({ children, ...props }: ActionsProps): JSX_2.Element;
376
486
 
487
+ declare interface HistoryEntry {
488
+ text?: string;
489
+ isInput: boolean;
490
+ value?: string;
491
+ clear?: boolean;
492
+ }
493
+
377
494
  declare function Image_2({ className, src, ...props }: ImageProps): JSX_2.Element;
378
495
  export { Image_2 as Image }
379
496
 
@@ -381,22 +498,27 @@ export declare const IMAGE_EXTENSIONS: string[];
381
498
 
382
499
  export declare function ImagePreview({ source, className, onError, ...props }: ImagePreviewProps): JSX_2.Element;
383
500
 
384
- declare interface ImagePreviewProps {
501
+ export declare interface ImagePreviewProps {
385
502
  source: string;
386
503
  className?: string;
387
504
  onError?: () => void;
388
505
  }
389
506
 
390
- declare interface ImageProps {
507
+ export declare interface ImageProps {
391
508
  className?: string;
392
509
  src?: string;
393
510
  [key: string]: unknown;
394
511
  }
395
512
 
513
+ /**
514
+ * Button component that handles single and double clicks
515
+ */
396
516
  export declare function Interactable({ onClick, onDoubleClick, children, ...props }: InteractableProps): JSX_2.Element;
397
517
 
398
- declare interface InteractableProps {
518
+ export declare interface InteractableProps {
519
+ /** Function that handles single clicks */
399
520
  onClick?: (event: MouseEvent) => void;
521
+ /** Function that handles double clicks */
400
522
  onDoubleClick?: (event: MouseEvent) => void;
401
523
  children: ReactNode;
402
524
  [key: string]: unknown;
@@ -404,6 +526,15 @@ declare interface InteractableProps {
404
526
 
405
527
  export declare function isValidUrl(string: string): boolean;
406
528
 
529
+ declare type Listener = (data: unknown) => void;
530
+
531
+ declare type Manual = {
532
+ purpose?: string;
533
+ usage?: string;
534
+ description?: string;
535
+ options?: object;
536
+ };
537
+
407
538
  export declare const MEDIA_EXTENSIONS: string[];
408
539
 
409
540
  export declare const mediaViewer: App<MediaViewerProps>;
@@ -417,7 +548,7 @@ export declare class MiscConfig {
417
548
  constructor(options?: Partial<MiscConfigOptions>);
418
549
  }
419
550
 
420
- declare interface MiscConfigOptions {
551
+ export declare interface MiscConfigOptions {
421
552
  /**
422
553
  * The maximum time between two clicks to register as a double click (in ms)
423
554
  * @default 250
@@ -425,17 +556,49 @@ declare interface MiscConfigOptions {
425
556
  doubleClickDelay: number;
426
557
  }
427
558
 
428
- declare class Modal {
559
+ /**
560
+ * Represents a modal window
561
+ */
562
+ export declare class Modal {
563
+ /**
564
+ * The size of this modal
565
+ * @default new Vector2(400, 200)
566
+ */
429
567
  size: Vector2;
568
+ /**
569
+ * The position of this modal
570
+ * @default new Vector2(300, 300)
571
+ */
430
572
  position: Vector2;
573
+ /**
574
+ * The icon of this modal
575
+ * @default null
576
+ */
431
577
  icon: string | null;
578
+ /**
579
+ * The title of this modal
580
+ * @default null
581
+ */
432
582
  title: string | null;
583
+ /**
584
+ * The manager that handles all modals
585
+ */
433
586
  modalsManager: ModalsManager | null;
587
+ /**
588
+ * The content of this modal
589
+ * @default null
590
+ */
434
591
  element: FC<ModalProps> | null;
435
592
  props: object;
436
593
  callback: ((...args: unknown[]) => void) | null;
594
+ /** The ID of this modal */
437
595
  id: number | null;
596
+ /**
597
+ * Whether this modal can be dismissed (e.g., by pressing ESC)
598
+ * @default true
599
+ */
438
600
  dismissible: boolean;
601
+ /** Timestamp of the most recent interaction with this modal */
439
602
  lastInteraction?: number;
440
603
  constructor(element: Modal["element"], callback?: Modal["callback"]);
441
604
  setIcon(icon: string): Modal;
@@ -454,6 +617,7 @@ declare class Modal {
454
617
  }
455
618
 
456
619
  export declare interface ModalProps {
620
+ /** */
457
621
  modal?: Modal;
458
622
  params?: {
459
623
  appId?: string;
@@ -477,7 +641,7 @@ export declare class ModalsConfig {
477
641
  constructor(options?: Partial<ModalsConfigOptions>);
478
642
  }
479
643
 
480
- declare interface ModalsConfigOptions {
644
+ export declare interface ModalsConfigOptions {
481
645
  /**
482
646
  * Default size of a dialog box
483
647
  * @default new Vector2(400, 200)
@@ -490,71 +654,132 @@ declare interface ModalsConfigOptions {
490
654
  defaultFileSelectorSize: Vector2;
491
655
  }
492
656
 
657
+ /**
658
+ * Manages the opening, closing and ordering of modals
659
+ */
493
660
  export declare class ModalsManager {
661
+ /** Maps every modal ID to the corresponding modal */
494
662
  modals: Record<string, Modal>;
495
663
  containerRef?: MutableRefObject<HTMLElement>;
664
+ /** Function that handles changes to modals */
496
665
  updateModals: (modals: ModalsManager["modals"]) => void;
497
666
  /**
667
+ * Opens a modal
498
668
  * @param single - Set to false to preserve other open modals
499
669
  */
500
670
  open(modal: Modal, single?: boolean): void;
671
+ /**
672
+ * Closes a modal
673
+ * @param modalId The ID of the modal to close
674
+ */
501
675
  close(modalId: string | number, sendModalsUpdate?: boolean): void;
676
+ /**
677
+ * Brings a modal into focus
678
+ * @param modalId The ID of the modal to bring into focus
679
+ */
502
680
  focus(modalId: string): void;
503
681
  setUpdateModals(updateModals: ModalsManager["updateModals"]): void;
682
+ /**
683
+ * Returns the IDs of all open modals
684
+ */
504
685
  get modalIds(): string[];
505
686
  static getModalIconUrl(name: string): string;
506
687
  }
507
688
 
508
- declare type ModalsManagerState = ModalsManager | undefined;
689
+ export declare const modalsManagerContext: Context<ModalsManagerState>;
509
690
 
691
+ export declare type ModalsManagerState = ModalsManager | undefined;
692
+
693
+ /**
694
+ * Component that renders all active modals
695
+ */
510
696
  export declare const ModalsView: MemoExoticComponent<() => JSX_2.Element>;
511
697
 
512
698
  export declare function NoRoute(): JSX_2.Element;
513
699
 
700
+ export declare interface NoRouteProps {
701
+ /**
702
+ * Title of the route
703
+ * @default "404: Not Found"
704
+ */
705
+ title: string;
706
+ }
707
+
514
708
  export declare interface OnSelectionChangeParams {
709
+ /** The selected files */
515
710
  files?: string[];
711
+ /** The selected folders */
516
712
  folders?: string[];
713
+ /** The directory the selection was made in */
517
714
  directory?: VirtualFolder;
518
715
  }
519
716
 
520
717
  export declare function openUrl(url: string, target?: HTMLAttributeAnchorTarget): void;
521
718
 
522
- declare type OpenWindowedModal = (params: OpenWindowedModalParams) => Modal;
719
+ export declare type OpenWindowedModal = (params: OpenWindowedModalParams) => Modal;
523
720
 
524
- declare interface OpenWindowedModalParams {
721
+ export declare interface OpenWindowedModalParams {
722
+ /** The ID of the associated app */
525
723
  appId?: string;
724
+ /** The URL of the icon of the modal */
526
725
  iconUrl?: string;
726
+ /** The title of the modal */
527
727
  title?: string;
728
+ /** The size of the modal */
528
729
  size: Vector2;
730
+ /** The modal component */
529
731
  Modal: FC<ModalProps>;
530
732
  single?: boolean;
531
733
  fullscreen?: WindowProps["fullscreen"];
532
734
  }
533
735
 
534
- declare type OptionalStringProperty = string | null | undefined;
736
+ declare type Option_2 = {
737
+ long: string;
738
+ short: string;
739
+ isInput: boolean;
740
+ };
741
+
742
+ export declare type OptionalStringProperty = string | null | undefined;
535
743
 
744
+ /**
745
+ * Component that calls a function when the user clicks outside of it
746
+ */
536
747
  export declare const OutsideClickListener: MemoExoticComponent<({ onOutsideClick, children }: OutsideClickListenerProps) => JSX_2.Element>;
537
748
 
538
- declare interface OutsideClickListenerProps {
749
+ export declare interface OutsideClickListenerProps {
750
+ /** Function that handles clicks outside of this component */
539
751
  onOutsideClick: (event: Event) => void;
540
752
  children: ReactNode;
541
753
  }
542
754
 
755
+ /**
756
+ * Component that renders a progress bar
757
+ */
543
758
  export declare function ProgressBar({ fillPercentage, fillColor, backgroundColor, align, className }: ProgressBarProps): JSX_2.Element;
544
759
 
545
- declare interface ProgressBarProps {
760
+ export declare interface ProgressBarProps {
761
+ /** The amount of progress, as a percentage */
546
762
  fillPercentage: number;
763
+ /** The CSS color to use for the filled part of the progress bar */
547
764
  fillColor?: string;
765
+ /** The CSS background color of the progress bar */
548
766
  backgroundColor?: string;
549
767
  align?: "left";
768
+ /** `className` prop for the progress bar */
550
769
  className?: string;
551
770
  }
552
771
 
772
+ /**
773
+ * Main component that contains everything
774
+ */
553
775
  export declare const ProzillaOS: NamedExoticComponent<ProzillaOSProps>;
554
776
 
555
- declare interface ProzillaOSProps {
777
+ export declare interface ProzillaOSProps {
778
+ /** The name of the system */
556
779
  systemName?: string;
780
+ /** The tagline/short description of the system */
557
781
  tagLine?: string;
782
+ /** The system configuration */
558
783
  config?: {
559
784
  apps?: Partial<AppsConfigOptions>;
560
785
  desktop?: Partial<DesktopConfigOptions>;
@@ -581,7 +806,7 @@ export declare function RadioAction({ actionId, options, initialIndex, onTrigger
581
806
  * @param {number} props.initialIndex
582
807
  * @param {Function} props.onTrigger
583
808
  */
584
- declare interface RadioActionProps extends ActionProps {
809
+ export declare interface RadioActionProps extends ActionProps {
585
810
  options: {
586
811
  label: string;
587
812
  shortcut?: string[];
@@ -600,14 +825,14 @@ export declare function removeUrlProtocol(url: string): string;
600
825
 
601
826
  export declare function Router({ path, homePage, fallbackPage, children }: RouterProps): JSX_2.Element;
602
827
 
603
- declare interface RouterProps {
828
+ export declare interface RouterProps {
604
829
  path?: string;
605
830
  homePage?: JSX.Element;
606
831
  fallbackPage?: JSX.Element;
607
832
  children?: ReactElement;
608
833
  }
609
834
 
610
- declare class Settings {
835
+ export declare class Settings {
611
836
  #private;
612
837
  path: string;
613
838
  file: VirtualFile;
@@ -623,10 +848,39 @@ declare class Settings {
623
848
  */
624
849
  isMissingXmlDoc(): Promise<boolean>;
625
850
  /**
626
- * Gets a value by a given key if it exists or calls a callback function whenever the value changes
851
+ * Gets a value by a given key if it exists and optionally calls a callback function whenever the value changes
852
+ * @param key The key of the setting
853
+ * @param callback The callback function to call whenever the value changes
854
+ */
855
+ get(key: string, callback?: (value: string) => void): Promise<{
856
+ value: string | null;
857
+ listener?: Listener;
858
+ }>;
859
+ /**
860
+ * Gets a value by a given key as a boolean
861
+ */
862
+ getBool(key: string, callback?: (value: boolean) => void): Promise<{
863
+ value: boolean | null;
864
+ listener?: Listener;
865
+ }>;
866
+ /**
867
+ * Gets a value by a given key as an integer
868
+ */
869
+ getInt(key: string, callback?: (value: number) => void): Promise<{
870
+ value: number | null;
871
+ listener?: Listener;
872
+ }>;
873
+ /**
874
+ * Sets the value associated with a given key
875
+ * @param key The key of the setting
876
+ * @param value The new value
627
877
  */
628
- get(key: string, callback?: (value: string) => void): Promise<string | null>;
629
878
  set(key: string, value: string): Promise<void>;
879
+ /**
880
+ * Removes a listener from the settings file
881
+ * @param listener The listener to remove
882
+ */
883
+ removeListener(listener: Listener): void;
630
884
  }
631
885
 
632
886
  export declare const settings: App<SettingsProps>;
@@ -640,7 +894,11 @@ export declare class SettingsManager {
640
894
  getSettings(path: string): Settings;
641
895
  }
642
896
 
643
- declare type SettingsManagerState = SettingsManager | undefined;
897
+ export declare const SettingsManagerContext: Context<SettingsManagerState>;
898
+
899
+ export declare type SettingsManagerState = SettingsManager | undefined;
900
+
901
+ export declare type SettingsPath = typeof SettingsManager.VIRTUAL_PATHS[string];
644
902
 
645
903
  declare interface SettingsProps extends WindowProps {
646
904
  tab?: number;
@@ -729,7 +987,7 @@ declare interface SkinOptions {
729
987
 
730
988
  export declare function StandaloneRoute({ app }: StandaloneRouteProps): JSX_2.Element;
731
989
 
732
- declare interface StandaloneRouteProps {
990
+ export declare interface StandaloneRouteProps {
733
991
  app: App;
734
992
  }
735
993
 
@@ -743,9 +1001,29 @@ declare class StorageManager_2 {
743
1001
  }
744
1002
  export { StorageManager_2 as StorageManager }
745
1003
 
1004
+ export declare class Stream extends EventEmitter_2<typeof StreamEvents> {
1005
+ static EVENT_NAMES: {
1006
+ readonly new: "new";
1007
+ readonly start: "start";
1008
+ readonly stop: "stop";
1009
+ };
1010
+ enabled: boolean;
1011
+ start(callback?: (stream: this) => void): Stream;
1012
+ stop(): Stream;
1013
+ send(text: string): Stream;
1014
+ }
1015
+
1016
+ declare const StreamEvents: {
1017
+ readonly new: "new";
1018
+ readonly start: "start";
1019
+ readonly stop: "stop";
1020
+ };
1021
+
746
1022
  export declare class SystemManager {
747
1023
  #private;
1024
+ /** The name of the system */
748
1025
  readonly systemName: string;
1026
+ /** The tagline/short description of the system */
749
1027
  readonly tagLine: string;
750
1028
  readonly skin: Skin;
751
1029
  readonly appsConfig: AppsConfig;
@@ -761,7 +1039,9 @@ export declare class SystemManager {
761
1039
  getUptime(precision?: number): string;
762
1040
  }
763
1041
 
764
- declare interface SystemManagerParams {
1042
+ export declare const SystemManagerContext: Context<SystemManager | undefined>;
1043
+
1044
+ export declare interface SystemManagerParams {
765
1045
  systemName: SystemManager["systemName"] | null;
766
1046
  tagLine: SystemManager["tagLine"] | null;
767
1047
  skin?: SystemManager["skin"];
@@ -775,6 +1055,9 @@ declare interface SystemManagerParams {
775
1055
  virtualDriveConfig: VirtualDriveConfig;
776
1056
  }
777
1057
 
1058
+ /**
1059
+ * Component that renders the start and search menus, pinned applications and various indicators
1060
+ */
778
1061
  export declare const Taskbar: MemoExoticComponent<() => JSX_2.Element>;
779
1062
 
780
1063
  export declare class TaskbarConfig {
@@ -782,7 +1065,7 @@ export declare class TaskbarConfig {
782
1065
  constructor(options?: Partial<TaskbarConfigOptions>);
783
1066
  }
784
1067
 
785
- declare interface TaskbarConfigOptions {
1068
+ export declare interface TaskbarConfigOptions {
786
1069
  /**
787
1070
  * Height of the taskbar in CSS pixels
788
1071
  * @default 3 * 16
@@ -790,7 +1073,13 @@ declare interface TaskbarConfigOptions {
790
1073
  height: number;
791
1074
  }
792
1075
 
793
- export declare const terminal: App<TerminalProps>;
1076
+ export declare const terminal: TerminalApp;
1077
+
1078
+ export declare class TerminalApp extends App<TerminalProps> {
1079
+ constructor();
1080
+ addCommands(commands: Command[]): this;
1081
+ addCommand(command: Command): this;
1082
+ }
794
1083
 
795
1084
  declare interface TerminalProps extends WindowProps {
796
1085
  path?: string;
@@ -799,7 +1088,7 @@ declare interface TerminalProps extends WindowProps {
799
1088
 
800
1089
  export declare function TextDisplay({ children }: TextDisplayProps): JSX_2.Element;
801
1090
 
802
- declare interface TextDisplayProps {
1091
+ export declare interface TextDisplayProps {
803
1092
  children: ReactNode;
804
1093
  }
805
1094
 
@@ -834,7 +1123,7 @@ export declare class TimeManager {
834
1123
 
835
1124
  export declare function ToggleAction({ actionId, label, shortcut, initialValue, onTrigger }: ToggleActionProps): ReactElement;
836
1125
 
837
- declare interface ToggleActionProps extends ActionProps {
1126
+ export declare interface ToggleActionProps extends ActionProps {
838
1127
  initialValue: boolean;
839
1128
  }
840
1129
 
@@ -844,7 +1133,7 @@ export declare class TrackingConfig {
844
1133
  constructor(options?: Partial<TrackingConfigOptions>);
845
1134
  }
846
1135
 
847
- declare interface TrackingConfigOptions {
1136
+ export declare interface TrackingConfigOptions {
848
1137
  /**
849
1138
  * Enable tracking
850
1139
  * @default true
@@ -862,65 +1151,132 @@ export declare class TrackingManager {
862
1151
  event(options: UaEventOptions | string): void;
863
1152
  }
864
1153
 
865
- declare type TrackingManagerState = TrackingManager | undefined;
1154
+ export declare const TrackingManagerContext: Context<TrackingManagerState>;
1155
+
1156
+ export declare type TrackingManagerState = TrackingManager | undefined;
866
1157
 
1158
+ /** Returns a function that opens an alert modal */
867
1159
  export declare function useAlert(): {
868
- alert: ({ title, text, iconUrl, size, single }: AlertParams) => void;
1160
+ alert: (params: AlertParams) => void;
869
1161
  };
870
1162
 
1163
+ /**
1164
+ * Returns the folder associated with a given app
1165
+ */
871
1166
  export declare function useAppFolder(app?: App): VirtualFolder | null;
872
1167
 
1168
+ /**
1169
+ * Returns the boolean value of a setting and a function to update it
1170
+ * @param path The path of the settings file
1171
+ * @param key The key of the setting
1172
+ * @param defaultValue The default value of the setting
1173
+ * @returns The boolean value of a setting and a function to update it
1174
+ */
1175
+ export declare function useBoolSetting(path: SettingsPath, key: string, defaultValue?: boolean): [boolean, (value: string | boolean) => void];
1176
+
873
1177
  /**
874
1178
  * Combine class names and an optional static class name
875
1179
  */
876
1180
  export declare function useClassNames(classNames: (string | undefined)[], block?: string, element?: string, modifier?: string | string[]): string;
877
1181
 
1182
+ /**
1183
+ * Creates a function that handles the opening of a custom context menu and a component that listens for keyboard shortcuts
1184
+ */
878
1185
  export declare function useContextMenu({ Actions }: UseContextMenuParams): {
879
1186
  onContextMenu: (event: MouseEvent_2<HTMLElement, MouseEvent_2>, params?: object) => Modal;
880
1187
  ShortcutsListener: () => JSX_2.Element;
881
1188
  };
882
1189
 
883
- declare interface UseContextMenuParams {
1190
+ export declare interface UseContextMenuParams {
1191
+ /** The component with the actions of the context menu */
884
1192
  Actions: FC<ActionsProps>;
885
1193
  }
886
1194
 
1195
+ /**
1196
+ * Returns an object that handles stateful history with undo and redo methods
1197
+ */
887
1198
  export declare function useHistory<Type>(initialState: Type): {
1199
+ /** The entries of the history */
888
1200
  history: Type[];
1201
+ /** The index of the active entry in list of entries */
889
1202
  stateIndex: number;
1203
+ /** Adds a new entry to the history */
890
1204
  pushState: (state: Type) => void;
1205
+ /** Moves backwards in the history */
891
1206
  undo: () => void;
1207
+ /** Moves forwards in the history */
892
1208
  redo: () => void;
893
1209
  undoAvailable: boolean;
894
1210
  redoAvailable: boolean;
895
1211
  };
896
1212
 
1213
+ /**
1214
+ * Returns the integer value of a setting and a function to update it
1215
+ * @param path The path of the settings file
1216
+ * @param key The key of the setting
1217
+ * @param defaultValue The default value of the setting
1218
+ * @returns The integer value of a setting and a function to update it
1219
+ */
1220
+ export declare function useIntSetting(path: SettingsPath, key: string, defaultValue?: number): [number, (value: string | number) => void];
1221
+
1222
+ /**
1223
+ * Creates listeners for `"keydown"` and `"keyup"` events
1224
+ */
897
1225
  export declare function useKeyboardListener({ onKeyDown, onKeyUp }: UseKeyboardListenerParams): void;
898
1226
 
899
- declare interface UseKeyboardListenerParams {
1227
+ export declare interface UseKeyboardListenerParams {
1228
+ /** Function that handles `"keydown"` events */
900
1229
  onKeyDown?: (event: KeyboardEvent) => void;
1230
+ /** Function that handles `"keyup"` events */
901
1231
  onKeyUp?: (event: KeyboardEvent) => void;
902
1232
  }
903
1233
 
1234
+ /**
1235
+ * Returns the items of a list value of a setting and a function to update it
1236
+ * @param path The path of the settings file
1237
+ * @param key The key of the setting
1238
+ * @param defaultValue The default value of the setting
1239
+ * @returns The items of a list value of a setting and a function to update it
1240
+ */
1241
+ export declare function useListSetting(path: SettingsPath, key: string, defaultValue?: string[]): [string[], (value: string | string[]) => void];
1242
+
904
1243
  export declare function useModalsManager(): ModalsManagerState;
905
1244
 
1245
+ /**
1246
+ * Creates listeners for `"mousedown"`, `"mouseup"`, `"click"` and `"contextmenu"` events
1247
+ */
906
1248
  export declare function useMouseListener({ onMouseDown, onMouseUp, onClick, onContextMenu }: UseMouseListenerParams): void;
907
1249
 
908
- declare interface UseMouseListenerParams {
1250
+ export declare interface UseMouseListenerParams {
1251
+ /** Function that handles `"mousedown"` events */
909
1252
  onMouseDown: EventListener;
1253
+ /** Function that handles `"mouseup"` events */
910
1254
  onMouseUp: EventListener;
1255
+ /** Function that handles `"click"` events */
911
1256
  onClick: EventListener;
1257
+ /** Function that handles `"contextmenu"` events */
912
1258
  onContextMenu: EventListener;
913
1259
  }
914
1260
 
1261
+ /**
1262
+ * Returns the ideal orientation of an element so that it does not go outside of the screen
1263
+ */
915
1264
  export declare function useScreenBounds({ avoidTaskbar }: {
1265
+ /** Whether to avoid the task bar */
916
1266
  avoidTaskbar: boolean;
917
1267
  }): {
1268
+ /** The React ref of the element */
918
1269
  ref: Ref<HTMLElement>;
919
1270
  initiated: boolean;
1271
+ /** Whether the element should align to the left (`true`) or right (`false`) */
920
1272
  alignLeft: boolean;
1273
+ /** Whether the element should align to the top (`true`) or bottom (`false`) */
921
1274
  alignTop: boolean;
922
1275
  };
923
1276
 
1277
+ /**
1278
+ * Returns the width and height of the element with ID "root"
1279
+ */
924
1280
  export declare function useScreenDimensions(): [screenWidth: number | null, screenHeight: number | null];
925
1281
 
926
1282
  export declare function useScrollWithShadow(params: UseScrollWithShadowParams): {
@@ -930,7 +1286,7 @@ export declare function useScrollWithShadow(params: UseScrollWithShadowParams):
930
1286
  }) => void;
931
1287
  };
932
1288
 
933
- declare interface UseScrollWithShadowParams {
1289
+ export declare interface UseScrollWithShadowParams {
934
1290
  ref?: MutableRefObject<HTMLElement>;
935
1291
  horizontal?: boolean;
936
1292
  dynamicOffset?: boolean;
@@ -948,14 +1304,25 @@ declare interface UseScrollWithShadowParams {
948
1304
  };
949
1305
  }
950
1306
 
1307
+ /**
1308
+ * Returns the value of a setting and a function to update it
1309
+ * @param path The path of the settings file
1310
+ * @param key The key of the setting
1311
+ * @param defaultValue The default value of the setting
1312
+ * @param parse A function that converts a string to a value
1313
+ * @param stringify A function that converts a value to a string
1314
+ * @returns The value of a setting and a function to update it
1315
+ */
1316
+ 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];
1317
+
951
1318
  export declare function useSettingsManager(): SettingsManagerState;
952
1319
 
953
1320
  /**
954
- * TO DO: rewrite to use a global shortcuts manager instead, to allow certain shortcuts to be prioritized and prevent conflicts
1321
+ * Creates listeners for keyboard shortcuts
955
1322
  */
956
1323
  export declare function useShortcuts({ options, shortcuts, useCategories }: UseShortcutsParams): void;
957
1324
 
958
- declare interface UseShortcutsParams {
1325
+ export declare interface UseShortcutsParams {
959
1326
  options: Record<string, Record<string, (event: KeyboardEvent) => void>> | Record<string, (event: KeyboardEvent) => void>;
960
1327
  shortcuts?: Record<string, Record<string, string[]>> | Record<string, string[]>;
961
1328
  useCategories?: boolean;
@@ -966,6 +1333,15 @@ declare interface UseShortcutsParams {
966
1333
  */
967
1334
  export declare function useStaticClassName(block?: string, element?: string, modifier?: string | string[]): string | null;
968
1335
 
1336
+ /**
1337
+ * Returns the value of a setting and a function to update it
1338
+ * @param path The path of the settings file
1339
+ * @param key The key of the setting
1340
+ * @param defaultValue The default value of the setting
1341
+ * @returns The value of a setting and a function to update it
1342
+ */
1343
+ export declare function useStringSetting(path: SettingsPath, key: string, defaultValue?: string | null): [string | null, (value: string | null) => void];
1344
+
969
1345
  export declare function useSystemManager(): SystemManager;
970
1346
 
971
1347
  export declare function useTrackingManager(): TrackingManagerState;
@@ -980,7 +1356,7 @@ export declare function useWindowsManager(): WindowsManagerState;
980
1356
 
981
1357
  export declare function useZIndex({ groupIndex, index }: UseZIndexParams): number;
982
1358
 
983
- declare interface UseZIndexParams {
1359
+ export declare interface UseZIndexParams {
984
1360
  groupIndex: number;
985
1361
  index: number;
986
1362
  }
@@ -1008,16 +1384,27 @@ export declare class Vector2 {
1008
1384
  export declare const VIDEO_EXTENSIONS: string[];
1009
1385
 
1010
1386
  declare class VirtualBase extends EventEmitter<EventNamesMap> {
1387
+ /** The name of this item */
1011
1388
  name: string;
1389
+ /** The alias of this item */
1012
1390
  alias: string | undefined | null;
1391
+ /** The folder this item is in */
1013
1392
  parent: VirtualFolder | undefined | null;
1393
+ /** Whether this item is protected from changes */
1014
1394
  isProtected: boolean | undefined | null;
1395
+ /** The URL of the icon of this item */
1015
1396
  iconUrl: string | undefined | null;
1397
+ /** The file this item links to */
1016
1398
  linkedFile: VirtualFile | undefined | null;
1399
+ /** The folder this item links to */
1017
1400
  linkedFolder: VirtualFolder | undefined | null;
1401
+ /** Whether this item has been edited by the user */
1018
1402
  editedByUser: boolean | undefined | null;
1403
+ /** Whether this item is the root folder */
1019
1404
  isRoot: boolean | undefined | null;
1405
+ /** The root folder */
1020
1406
  root: VirtualRoot | undefined | null;
1407
+ /** Whether this item has been deleted */
1021
1408
  isDeleted: boolean;
1022
1409
  static EVENT_NAMES: {
1023
1410
  update: string;
@@ -1031,9 +1418,18 @@ declare class VirtualBase extends EventEmitter<EventNamesMap> {
1031
1418
  setIconUrl(iconUrl: string | null): this;
1032
1419
  getIconUrl(): string;
1033
1420
  getType(): string;
1421
+ /**
1422
+ * Tries to delete this item
1423
+ */
1034
1424
  delete(): void;
1035
1425
  confirmChanges(root?: VirtualRoot): void;
1426
+ /**
1427
+ * Opens this item in the appropriate application
1428
+ */
1036
1429
  open(..._args: unknown[]): unknown;
1430
+ /**
1431
+ * Returns the path of this item
1432
+ */
1037
1433
  get path(): string;
1038
1434
  /**
1039
1435
  * Returns path without using this item's alias
@@ -1047,6 +1443,9 @@ declare class VirtualBase extends EventEmitter<EventNamesMap> {
1047
1443
  * Returns whether this can be edited in its current state
1048
1444
  */
1049
1445
  get canBeEdited(): boolean;
1446
+ /**
1447
+ * Returns the root folder
1448
+ */
1050
1449
  getRoot(): VirtualRoot;
1051
1450
  isFile(): boolean;
1052
1451
  isFolder(): boolean;
@@ -1065,7 +1464,7 @@ export declare class VirtualDriveConfig {
1065
1464
  constructor(options?: Partial<VirtualDriveConfigOptions>);
1066
1465
  }
1067
1466
 
1068
- declare interface VirtualDriveConfigOptions {
1467
+ export declare interface VirtualDriveConfigOptions {
1069
1468
  /**
1070
1469
  * Enables persistent storage of the virtual drive
1071
1470
  * @default true
@@ -1108,8 +1507,11 @@ declare interface VirtualDriveConfigOptions {
1108
1507
  * A virtual file that can be stored inside a folder
1109
1508
  */
1110
1509
  export declare class VirtualFile extends VirtualBase {
1510
+ /** The extension of this file */
1111
1511
  extension: OptionalStringProperty;
1512
+ /** The URL of the source of this file */
1112
1513
  source: OptionalStringProperty;
1514
+ /** The content of this file */
1113
1515
  content: OptionalStringProperty;
1114
1516
  static NON_TEXT_EXTENSIONS: string[];
1115
1517
  static EVENT_NAMES: {
@@ -1145,7 +1547,7 @@ export declare class VirtualFile extends VirtualBase {
1145
1547
  static removeFileScheme(source: string): string;
1146
1548
  }
1147
1549
 
1148
- declare interface VirtualFileJson extends VirtualBaseJson {
1550
+ export declare interface VirtualFileJson extends VirtualBaseJson {
1149
1551
  ext?: string;
1150
1552
  cnt?: string;
1151
1553
  src?: string;
@@ -1170,7 +1572,7 @@ export declare class VirtualFileLink extends VirtualFile {
1170
1572
  getIconUrl(...args: Parameters<VirtualFile["getIconUrl"]>): ReturnType<VirtualFile["getIconUrl"]>;
1171
1573
  }
1172
1574
 
1173
- declare interface VirtualFileLinkJson extends VirtualFileJson {
1575
+ export declare interface VirtualFileLinkJson extends VirtualFileJson {
1174
1576
  lnk: string;
1175
1577
  }
1176
1578
 
@@ -1178,8 +1580,14 @@ declare interface VirtualFileLinkJson extends VirtualFileJson {
1178
1580
  * A virtual folder that can contains files and sub-folders
1179
1581
  */
1180
1582
  export declare class VirtualFolder extends VirtualBase {
1583
+ /** The folders inside this folder */
1181
1584
  subFolders: (VirtualFolder | VirtualFolderLink)[];
1585
+ /** The files inside this folder */
1182
1586
  files: (VirtualFile | VirtualFileLink)[];
1587
+ /**
1588
+ * The type of this folder
1589
+ * @default VirtualFolder.TYPE.general
1590
+ */
1183
1591
  type: number | undefined;
1184
1592
  static TYPE: {
1185
1593
  general: number;
@@ -1276,7 +1684,7 @@ export declare class VirtualFolder extends VirtualBase {
1276
1684
  toJSON(): VirtualFolderJson | null;
1277
1685
  }
1278
1686
 
1279
- declare interface VirtualFolderJson extends VirtualBaseJson {
1687
+ export declare interface VirtualFolderJson extends VirtualBaseJson {
1280
1688
  fls?: VirtualFileJson[];
1281
1689
  fds?: VirtualFolderJson[];
1282
1690
  }
@@ -1307,7 +1715,7 @@ export declare class VirtualFolderLink extends VirtualFolder {
1307
1715
  getItemCount(...args: Parameters<VirtualFolder["getItemCount"]>): ReturnType<VirtualFolder["getItemCount"]>;
1308
1716
  }
1309
1717
 
1310
- declare interface VirtualFolderLinkJson extends VirtualFolderJson {
1718
+ export declare interface VirtualFolderLinkJson extends VirtualFolderJson {
1311
1719
  lnk: string;
1312
1720
  }
1313
1721
 
@@ -1315,6 +1723,7 @@ declare interface VirtualFolderLinkJson extends VirtualFolderJson {
1315
1723
  * A virtual folder that serves as the root folder
1316
1724
  */
1317
1725
  export declare class VirtualRoot extends VirtualFolder {
1726
+ /** Aliases for files and folders */
1318
1727
  shortcuts: Record<string, VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink>;
1319
1728
  initiated: boolean;
1320
1729
  loadedDefaultData: boolean;
@@ -1331,7 +1740,7 @@ export declare class VirtualRoot extends VirtualFolder {
1331
1740
  */
1332
1741
  saveData(): void;
1333
1742
  /**
1334
- * Initiates this root by loading the default data and then the user's data on top
1743
+ * Initializes this root by loading the default data and then the user's data on top
1335
1744
  */
1336
1745
  init(): VirtualRoot;
1337
1746
  /**
@@ -1342,34 +1751,47 @@ export declare class VirtualRoot extends VirtualFolder {
1342
1751
  * Tells the storage manager to clear all data and reloads the window
1343
1752
  */
1344
1753
  reset(): void;
1345
- static isValidName(_name: string): void;
1346
- static isValidFileName(_name: string): void;
1347
- static isValidFolderName(_name: string): void;
1754
+ static isValidName(_name: string): boolean;
1755
+ static isValidFileName(_name: string): boolean;
1756
+ static isValidFolderName(_name: string): boolean;
1348
1757
  get path(): string;
1349
1758
  get displayPath(): string;
1350
1759
  toJSON(): VirtualRootJson | null;
1351
1760
  toString(): string | null;
1352
1761
  }
1353
1762
 
1354
- declare interface VirtualRootJson extends VirtualFolderJson {
1763
+ export declare const VirtualRootContext: Context<VirtualRootState>;
1764
+
1765
+ export declare interface VirtualRootJson extends VirtualFolderJson {
1355
1766
  scs: Record<string, string>;
1356
1767
  }
1357
1768
 
1358
- declare type VirtualRootState = VirtualRoot | undefined;
1769
+ export declare type VirtualRootState = VirtualRoot | undefined;
1359
1770
 
1771
+ /**
1772
+ * Component that renders an external application inside an iframe
1773
+ */
1360
1774
  export declare const WebView: FC<WebViewProps>;
1361
1775
 
1362
- declare interface WebViewProps extends WindowProps {
1776
+ export declare interface WebViewProps extends WindowProps {
1777
+ /** The URL of the external application */
1363
1778
  source?: string;
1364
1779
  title?: string;
1365
1780
  }
1366
1781
 
1367
1782
  export declare function WindowedModal({ modal, params, children, ...props }: ModalProps): JSX_2.Element;
1368
1783
 
1369
- declare interface WindowOptions {
1784
+ export declare interface WindowOptions {
1785
+ /** The ID of the window */
1370
1786
  id?: string;
1787
+ /** The app associated with the window */
1371
1788
  app?: App;
1789
+ /**
1790
+ * The size of the window
1791
+ * @default new Vector2(700, 400)
1792
+ */
1372
1793
  size?: Vector2;
1794
+ /** The position of the window */
1373
1795
  position?: Vector2;
1374
1796
  fullscreen?: boolean | string;
1375
1797
  options?: object;
@@ -1379,22 +1801,31 @@ declare interface WindowOptions {
1379
1801
  [key: string]: unknown;
1380
1802
  }
1381
1803
 
1382
- declare interface WindowOptions_2 {
1383
- size?: Vector2;
1384
- [key: string]: unknown;
1385
- }
1386
-
1387
1804
  export declare interface WindowProps extends WindowOptions {
1805
+ /**
1806
+ * Whether to start the window in fullscreen mode
1807
+ * @default false
1808
+ */
1388
1809
  fullscreen?: boolean;
1810
+ /** Function that handles interactions with the window */
1389
1811
  onInteract?: () => void;
1812
+ /** Function that sets the title of the window */
1390
1813
  setTitle?: React.Dispatch<React.SetStateAction<string>>;
1814
+ /** Function that sets the icon URL of the window */
1391
1815
  setIconUrl?: React.Dispatch<React.SetStateAction<string>>;
1816
+ /** Function that closes the window */
1392
1817
  close?: (event?: Event) => void;
1818
+ /** Function that brings the window in focus */
1393
1819
  focus?: (event: Event, force?: boolean) => void;
1820
+ /** Whether the window is currently focused and should allow interactions */
1394
1821
  active?: boolean;
1822
+ /** Whether to start the window in minimized mode */
1395
1823
  minimized?: boolean;
1824
+ /** Function that toggles the minimized mode of the window */
1396
1825
  toggleMinimized?: (event?: Event) => void;
1826
+ /** The depth value of the window */
1397
1827
  index?: number;
1828
+ /** Whether the window is in standalone mode */
1398
1829
  standalone?: boolean;
1399
1830
  }
1400
1831
 
@@ -1405,12 +1836,14 @@ export declare class WindowsConfig {
1405
1836
  constructor(options?: Partial<WindowsConfigOptions>);
1406
1837
  }
1407
1838
 
1408
- declare interface WindowsConfigOptions {
1839
+ export declare interface WindowsConfigOptions {
1409
1840
  /**
1841
+ * The margin around windows that are not maximized, in pixels
1410
1842
  * @default 32
1411
1843
  */
1412
1844
  screenMargin: number;
1413
1845
  /**
1846
+ * The separator to use in window titles
1414
1847
  * @default "-"
1415
1848
  */
1416
1849
  titleSeparator: string;
@@ -1421,16 +1854,21 @@ declare interface WindowsConfigOptions {
1421
1854
  minScreenSize: Vector2;
1422
1855
  }
1423
1856
 
1857
+ /**
1858
+ * Manages the states of windows
1859
+ */
1424
1860
  export declare class WindowsManager {
1425
1861
  #private;
1426
1862
  windows: {
1427
1863
  [id: string]: WindowOptions;
1428
1864
  };
1865
+ /** Function that handles changes to the open windows */
1429
1866
  updateWindows: (window: WindowsManager["windows"]) => void;
1430
1867
  startupComplete: boolean;
1431
1868
  constructor(systemManager: SystemManager, trackingManager: TrackingManager);
1432
1869
  /**
1433
- * Open a window for an app
1870
+ * Opens a window for an application
1871
+ * @param appId The ID of the app
1434
1872
  */
1435
1873
  open(appId: string, options?: WindowOptions | null): object | null;
1436
1874
  /**
@@ -1476,11 +1914,24 @@ export declare class WindowsManager {
1476
1914
  get windowIds(): string[];
1477
1915
  }
1478
1916
 
1479
- declare type WindowsManagerState = WindowsManager | undefined;
1917
+ export declare const WindowsManagerContext: Context<WindowsManagerState>;
1918
+
1919
+ export declare type WindowsManagerState = WindowsManager | undefined;
1480
1920
 
1921
+ /**
1922
+ * Component that renders the windows for all currently active applications
1923
+ */
1481
1924
  export declare const WindowsView: FC;
1482
1925
 
1483
- declare class ZIndexGroup {
1926
+ /**
1927
+ * Component that renders the window for an application
1928
+ */
1929
+ export declare const WindowView: FC<WindowProps>;
1930
+
1931
+ /**
1932
+ * Represents a group of HTML elements whose z-index is automatically calculated based on a given order
1933
+ */
1934
+ export declare class ZIndexGroup {
1484
1935
  length: number;
1485
1936
  offset: number;
1486
1937
  groupIndex: number;