@prozilla-os/core 2.1.2 → 3.0.0

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,4 +1,6 @@
1
+ import { ComponentProps } from 'react';
1
2
  import { Context } from 'react';
3
+ import { Dispatch } from 'react';
2
4
  import { EventEmitter } from '@prozilla-os/shared';
3
5
  import { FC } from 'react';
4
6
  import { ForwardRefExoticComponent } from 'react';
@@ -8,6 +10,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
8
10
  import { KeyboardEvent as KeyboardEvent_2 } from 'react';
9
11
  import { Listener } from '@prozilla-os/shared';
10
12
  import { MemoExoticComponent } from 'react';
13
+ import { MergeValues } from '@prozilla-os/shared';
11
14
  import { MouseEvent as MouseEvent_2 } from 'react';
12
15
  import { MutableRefObject } from 'react';
13
16
  import { NamedExoticComponent } from 'react';
@@ -151,6 +154,16 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
151
154
  * @default false
152
155
  */
153
156
  showDesktopIcon: boolean;
157
+ /**
158
+ * Defines the overrides to apply to this app based on the current skin.
159
+ *
160
+ * For each entry, if the key is (a subclass of) the current type of skin, the overrides are applied to this app.
161
+ * If multiple entries match the current skin, they are merged.
162
+ *
163
+ * @see {@link setSkinOverrides}
164
+ * @see {@link addSkinOverride}
165
+ */
166
+ skinOverrides?: Map<typeof Skin, AppSkinOverrides<AppProps>>;
154
167
  isActive: boolean;
155
168
  isPinned?: boolean;
156
169
  isInstalled: boolean;
@@ -207,6 +220,22 @@ export declare class App<AppProps extends WindowProps = WindowProps> {
207
220
  * Sets the default options for the {@link App.windowContent} component.
208
221
  */
209
222
  setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this;
223
+ /**
224
+ * Replaces any existing skin overrides with the given overrides.
225
+ * @param skinOverrides - The skin overrides to assign to this app.
226
+ * @see {@link skinOverrides}
227
+ */
228
+ setSkinOverrides(skinOverrides: App<AppProps>["skinOverrides"]): this;
229
+ /**
230
+ * Adds skin overrides to this app.
231
+ *
232
+ * If there is already an existing entry for the same skin, it is merged with the new overrides.
233
+ *
234
+ * @see {@link skinOverrides}
235
+ */
236
+ addSkinOverride(skin: typeof Skin, overrides: AppSkinOverrides<AppProps>): this;
237
+ applySkin(skin: Skin): void;
238
+ private applySkinOverrides;
210
239
  }
211
240
 
212
241
  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"];
@@ -243,7 +272,7 @@ export declare class AppsConfig extends EventEmitter<AppsConfigEvents> {
243
272
  */
244
273
  get installedApps(): App<WindowProps>[];
245
274
  onAppsChange(listener: () => void): () => void;
246
- addApp(app: App<WindowProps>): void;
275
+ addApp(app: App<WindowProps>, systemManager: SystemManager): void;
247
276
  removeApp(id: string): boolean;
248
277
  /**
249
278
  * Load an app from a URL or npm package and register it in the system.
@@ -252,7 +281,7 @@ export declare class AppsConfig extends EventEmitter<AppsConfigEvents> {
252
281
  * @param target - The npm package name or URL to load the app from.
253
282
  * @returns The loaded (or re-enabled) app.
254
283
  */
255
- installApp(target: string, options?: LoadAppOptions): Promise<App<WindowProps>>;
284
+ installApp(target: string, systemManager: SystemManager, options?: LoadAppOptions): Promise<App<WindowProps>>;
256
285
  uninstallApp(id: string): boolean;
257
286
  /**
258
287
  * @param id - The ID of the app.
@@ -284,6 +313,9 @@ export declare interface AppsConfigOptions {
284
313
  apps: App<WindowProps>[];
285
314
  }
286
315
 
316
+ /** @interface */
317
+ export declare type AppSkinOverrides<AppProps extends WindowProps = WindowProps> = Partial<Pick<App<AppProps>, "name" | "description" | "windowContent" | "windowOptions" | "iconUrl" | "metadata">>;
318
+
287
319
  /**
288
320
  * A sequence of strings and expansion nodes that form a single argument.
289
321
  */
@@ -357,6 +389,34 @@ declare interface AssignmentNode extends BaseNode {
357
389
  value: Argument;
358
390
  }
359
391
 
392
+ /**
393
+ * Attaches slot components to a root component as properties and names them.
394
+ * @param root - The root component.
395
+ * @param slots - The slot components.
396
+ * @param name - The name of the root component. Usually matches the name passed to {@link createSlots}. Defaults to the displayName or the function name of {@link root}.
397
+ * @returns The root component with the slot components attached to it.
398
+ * @example
399
+ * ```tsx
400
+ * const Accordion = attachSlots(AccordionRoot, {
401
+ * Summary: AccordionSummary,
402
+ * Details: AccordionDetails,
403
+ * });
404
+ * ```
405
+ * ### Usage
406
+ * ```tsx
407
+ * <Accordion>
408
+ * <Accordion.Summary/>
409
+ * <Accordion.Details/>
410
+ * </Accordion>
411
+ * ```
412
+ */
413
+ export declare function attachSlots<T extends FC<Record<string, FC>>, S extends Record<string, FC> = InferSlots<ComponentProps<T>>>(root: T, slots: S, name?: string): T & S;
414
+
415
+ /**
416
+ * @inheritdoc attachSlots
417
+ */
418
+ export declare function attachSlots<T extends FC, S extends Record<string, FC>>(root: T, slots: S, name?: string): T & S;
419
+
360
420
  export declare const AUDIO_EXTENSIONS: string[];
361
421
 
362
422
  /**
@@ -438,22 +498,23 @@ export declare class Command {
438
498
  /**
439
499
  * Sets the command name and initializes the default usage string if not already set.
440
500
  */
441
- setName(name?: string): Command;
501
+ setName(name?: string): this;
502
+ matches(name: string): boolean;
442
503
  get name(): string;
443
- setExecute(execute: Execute): Command;
444
- setRequireArgs(value: boolean): Command;
445
- setRequireOptions(value: boolean): Command;
446
- setManual({ purpose, usage, description, options }: Manual): Command;
504
+ get aliases(): string[];
505
+ setExecute(execute: Execute): this;
506
+ setRequireArgs(value: boolean): this;
507
+ setRequireOptions(value: boolean): this;
508
+ setManual({ purpose, usage, description, options }: Manual): this;
447
509
  /**
448
510
  * Registers a new option/flag for this command.
449
511
  */
450
- addOption({ short, long, isInput }: Omit<Option_2, "isInput"> & {
451
- isInput?: boolean;
452
- }): Command;
512
+ addOption({ short, long, isInput }: Omit<Option_2, "isInput"> & Partial<Pick<Option_2, "isInput">>): this;
453
513
  /**
454
514
  * Retrieves an option definition by either its short or long name.
455
515
  */
456
516
  getOption(key: string): Option_2 | undefined;
517
+ addAlias(alias: string): this;
457
518
  }
458
519
 
459
520
  /**
@@ -490,6 +551,69 @@ export declare type ContextMenuHandler = (event: MouseEvent_2<HTMLElement, Mouse
490
551
 
491
552
  export declare function copyToClipboard(string: string, onSuccess?: (value: void) => void, onFail?: (value: void) => void): void;
492
553
 
554
+ /**
555
+ * Creates a context for slots and a provider that renders the slots and provides the context to them.
556
+ *
557
+ * Communication between the root component and its slots happens via the context.
558
+ * The root component renders the provider returned by this function and passes the context value to it, as well as any slots or children it receives.
559
+ * The provider then renders the children of the root component using {@link SlotsView}.
560
+ * Slots can then use the hook to retrieve the context value from the root component.
561
+ *
562
+ * @see {@link SlotsView}
563
+ * @param name - The name of the component associated with these slots.
564
+ * @typeParam C - The type of the context value.
565
+ * @returns A {@link SlotSystem} containing the hook and provider component for the slot system.
566
+ * @example
567
+ * ```tsx
568
+ * const { useSlotsContext, SlotsProvider } = createSlots<{ value: string, setValue: Dispatch<string> }>("MyComponent");
569
+ *
570
+ * // By default, the slot renders the value from the context as simple text.
571
+ * function MyDefaultSlot() {
572
+ * const { value } = useSlotsContext();
573
+ * return <p>{value}</p>;
574
+ * }
575
+ *
576
+ * // We can create a custom slot with an input field that can change the value via the context.
577
+ * function MyCustomSlot() {
578
+ * const { value, setValue } = useSlotsContext();
579
+ * return <input value={value} onChange={(event) => setValue(event.target.value)}/>;
580
+ * }
581
+ *
582
+ * const DEFAULT_SLOTS = { Slot: MyDefaultSlot };
583
+ *
584
+ * // This is the root component.
585
+ * function MyComponent({ children, ...slots }: PropsWithSlots<{ Slot: FC }>) {
586
+ * const [value, setValue] = useState("No value set");
587
+ * const context = useMemo(() => ({ value, setValue }), [value]);
588
+ *
589
+ * return <SlotsProvider
590
+ * context={context}
591
+ * defaults={DEFAULT_SLOTS}
592
+ * slots={slots}
593
+ * >
594
+ * {children}
595
+ * </SlotsProvider>;
596
+ * }
597
+ * ```
598
+ * We use `useMemo()` here to avoid re-rendering all slots on every re-render of `<MyComponent/>`.
599
+ * ### Usage
600
+ * ```tsx
601
+ * // We can use the component without any props and it will render the default slot.
602
+ * <MyComponent/>
603
+ *
604
+ * // We can pass our custom slot to replace the default slot with.
605
+ * <MyComponent renderSlot={MyCustomSlot}/>
606
+ *
607
+ * // We can also replace all slots with any content (including slots) by giving the component children.
608
+ * <MyComponent>
609
+ * <h1>Hello world</h1>
610
+ * <MyDefaultSlot/>
611
+ * <MyCustomSlot/>
612
+ * </MyComponent>
613
+ * ```
614
+ */
615
+ export declare function createSlots<C>(name: string, defaultValue?: C): SlotSystem<C>;
616
+
493
617
  export declare function DefaultRoute(): JSX_2.Element;
494
618
 
495
619
  export declare interface DefaultWindowOptions {
@@ -796,6 +920,29 @@ export declare interface ImageProps {
796
920
  [key: string]: unknown;
797
921
  }
798
922
 
923
+ /**
924
+ * Infers the dictionary that maps slot names to components from the props of a component with slots (e.g., a component with props of type {@link PropsWithSlots}).
925
+ * @example
926
+ * ### From props
927
+ * This can be used to infer the slots from the props of a component with slots:
928
+ * ```ts
929
+ * type MyProps = PropsWithSlots<{ SlotA: FC; SlotB: FC }>;
930
+ * type MySlots = InferSlots<MyProps>; // Result: { SlotA: FC; SlotB: FC }
931
+ * ```
932
+ * ### From a component
933
+ * This can also be used in combination with `ComponentProps` to infer the slots directly from a component with slots.
934
+ * ```ts
935
+ * function MyComponent(props: PropsWithSlots<{ SlotA: FC; SlotB: FC }>) {
936
+ * // ...
937
+ * }
938
+ *
939
+ * type MySlots = InferSlots<ComponentProps<typeof MyComponent>>; // Result: { SlotA: FC; SlotB: FC }
940
+ * ```
941
+ */
942
+ export declare type InferSlots<T extends Slots<Record<string, FC>>> = {
943
+ [K in keyof T & string as K extends `render${infer Key}` ? Key : never]: Exclude<T[K], undefined>;
944
+ };
945
+
799
946
  export declare interface InputStream<T = string> {
800
947
  read(): Promise<Result<T | null, StreamError>>;
801
948
  }
@@ -826,7 +973,12 @@ export declare interface InteractableProps {
826
973
  [key: string]: unknown;
827
974
  }
828
975
 
829
- export declare function isValidUrl(string: string): boolean;
976
+ /**
977
+ * Statically checks whether the given {@link ReactNode} contains no renderable content, without actually rendering it.
978
+ * @param node - The node to check.
979
+ * @returns `true` if there is no renderable child.
980
+ */
981
+ export declare function isEmpty(node: ReactNode): boolean;
830
982
 
831
983
  /**
832
984
  * Load an app from either a URL or an npm package name (auto-detected).
@@ -862,7 +1014,7 @@ export declare interface Manual {
862
1014
  /** A detailed explanation of the command's behavior. */
863
1015
  description?: string;
864
1016
  /** A mapping of option names to their descriptions for the help output. */
865
- options?: object;
1017
+ options?: Record<string, string>;
866
1018
  }
867
1019
 
868
1020
  export declare const MAX_WIDTH = 50;
@@ -1087,9 +1239,9 @@ export declare interface OpenWindowedModalParams {
1087
1239
  */
1088
1240
  declare interface Option_2 {
1089
1241
  /** The full name of the option (e.g., `"all"` for `--all`). */
1090
- long: string;
1242
+ long?: string;
1091
1243
  /** The single-character alias (e.g., `"a"` for `-a`). */
1092
- short: string;
1244
+ short?: string;
1093
1245
  /** If true, the shell expects a value to follow this option (e.g., `--file <name>`). */
1094
1246
  isInput: boolean;
1095
1247
  }
@@ -1178,6 +1330,20 @@ export declare interface ProgressBarProps {
1178
1330
  className?: string;
1179
1331
  }
1180
1332
 
1333
+ /**
1334
+ * The props of a component that supports slots.
1335
+ *
1336
+ * @typeParam S - A dictionary mapping each slot name to a component.
1337
+ */
1338
+ export declare type PropsWithSlots<S extends Record<string, FC>> = Slots<S> & {
1339
+ /**
1340
+ * The content to render instead of the slots.
1341
+ *
1342
+ * If this is an empty value, the slots will be rendered instead.
1343
+ */
1344
+ children?: ReactNode;
1345
+ };
1346
+
1181
1347
  /**
1182
1348
  * Main component that contains everything .
1183
1349
  */
@@ -1231,10 +1397,6 @@ declare interface RedirectionNode extends BaseNode {
1231
1397
  */
1232
1398
  export declare function reloadViewport(): void;
1233
1399
 
1234
- export declare function removeBaseUrl(url: string): string;
1235
-
1236
- export declare function removeUrlProtocol(url: string): string;
1237
-
1238
1400
  export declare function Router({ path, homePage, fallbackPage, children }: RouterProps): JSX_2.Element;
1239
1401
 
1240
1402
  export declare interface RouterProps {
@@ -1275,7 +1437,7 @@ export declare class Settings {
1275
1437
  * Virtual path to the virtual drive settings.
1276
1438
  */
1277
1439
  static readonly VIRTUAL_DRIVE: string;
1278
- constructor(virtualRoot: VirtualRoot, path: string);
1440
+ constructor(settingsManager: SettingsManager, virtualRoot: VirtualRoot, path: string);
1279
1441
  /**
1280
1442
  * Reads the xml doc from the given path and assigns it to itself.
1281
1443
  */
@@ -1331,7 +1493,8 @@ export declare class SettingsManager {
1331
1493
  static VIRTUAL_PATHS: {
1332
1494
  [s: string]: string;
1333
1495
  };
1334
- constructor(virtualRoot: VirtualRoot);
1496
+ enableWarning: boolean;
1497
+ constructor(virtualRoot: VirtualRoot, enableWarnings?: boolean);
1335
1498
  getSettings(path: string): Settings;
1336
1499
  }
1337
1500
 
@@ -1348,7 +1511,7 @@ export declare function setViewportTitle(title: string): void;
1348
1511
  export declare function Share({ modal, params, ...props }: ModalProps): JSX_2.Element;
1349
1512
 
1350
1513
  /**
1351
- * A Unix-like shell emulator that handles command parsing, environment management,
1514
+ * A Bash-like shell emulator, called Posh (ProzillaOS shell), that handles command parsing, environment management,
1352
1515
  * autocompletion, and process I/O.
1353
1516
  */
1354
1517
  export declare class Shell {
@@ -1412,11 +1575,16 @@ export declare class Shell {
1412
1575
  */
1413
1576
  write(text: string): void;
1414
1577
  /**
1415
- * Submits the current input line and executes the given command string.
1578
+ * Commits the current input line and executes the given command string.
1416
1579
  * @param input - The command string to execute.
1417
1580
  * @returns A promise that resolves with the final exit code of the execution.
1418
1581
  */
1419
1582
  run(input: string): Promise<number>;
1583
+ /**
1584
+ * Commits the current line or the given input string.
1585
+ * @param input - The input string.
1586
+ */
1587
+ commitLine(input?: string): void;
1420
1588
  /**
1421
1589
  * Clears the current input line and resets the history search offset.
1422
1590
  */
@@ -1449,6 +1617,7 @@ export declare class Shell {
1449
1617
  readRawInput(stdin: Stream, onData: (data: string) => void | Promise<void>): Promise<void>;
1450
1618
  /**
1451
1619
  * Processes a list of paths, falling back to standard input if the list is empty or contains "-".
1620
+ * @param params
1452
1621
  * @param params.paths - The list of file paths or "-" for stdin.
1453
1622
  * @param params.workingDirectory - The directory to resolve paths against.
1454
1623
  * @param params.commandName - The name of the command invoking this utility.
@@ -1510,6 +1679,7 @@ export declare class Shell {
1510
1679
  * @param text - The text to write.
1511
1680
  */
1512
1681
  static printLn(stream: Stream, text?: string): Promise<void>;
1682
+ static quote(text: string): string;
1513
1683
  }
1514
1684
 
1515
1685
  export declare namespace ShellAST {
@@ -1613,6 +1783,7 @@ export declare class ShellEnvironment {
1613
1783
  static readonly PREVIOUS_WORKING_DIRECTORY = "OLDPWD";
1614
1784
  static readonly HOME = "HOME";
1615
1785
  static readonly PROMPT = "PS1";
1786
+ static readonly SHELL = "SHELL";
1616
1787
  static readonly EXIT_CODE = "?";
1617
1788
  static readonly ARGUMENT_COUNT = "#";
1618
1789
  static readonly PROCESS_ID = "$";
@@ -1898,6 +2069,84 @@ export declare interface ShellState {
1898
2069
 
1899
2070
  export declare type ShortcutHandler = (event: KeyboardEvent) => void;
1900
2071
 
2072
+ /**
2073
+ * Utility functions related to slots.
2074
+ * @see {@link SlotsView}
2075
+ * @see {@link createSlots}
2076
+ */
2077
+ export declare namespace Slot {
2078
+ /**
2079
+ * An empty slot with no content.
2080
+ * @example
2081
+ * Using an empty slot to hide the apps in the taskbar:
2082
+ * ```tsx
2083
+ * <Taskbar renderApps={Slot.Empty}/>
2084
+ * ```
2085
+ */
2086
+ const Empty: FC;
2087
+ }
2088
+
2089
+ /**
2090
+ * Slots are components that can override or enhance parts of a root component.
2091
+ *
2092
+ * The value of each entry is the component that will be rendered in the slot associated with the corresponding key.
2093
+ *
2094
+ * {@link SlotsView} can be used to render slots.
2095
+ * Slots are ignored if this components has any children.
2096
+ * Any missing slots will be replaced with a default component.
2097
+ *
2098
+ * {@link createSlots} produces a context and provider that can be used to create a component with slots and give them access to a shared context.
2099
+ *
2100
+ * @typeParam S - A dictionary mapping each slot name to a component.
2101
+ */
2102
+ export declare type Slots<S extends Record<string, FC>> = {
2103
+ [K in keyof S & string as `render${Capitalize<K>}`]?: FC;
2104
+ };
2105
+
2106
+ /**
2107
+ * Props for {@link SlotsView}.
2108
+ */
2109
+ declare interface SlotsViewProps<S extends Record<string, FC>> {
2110
+ /** The default components to render in each slot if no override is given. */
2111
+ defaults: S;
2112
+ /** Slot components that replace the respective default component with a matching key. */
2113
+ slots: Slots<S>;
2114
+ /** Callback function that renders the resolved slots in a custom layout instead of rendering them in their order in {@link defaults}. */
2115
+ layout?: (slots: S) => ReactNode;
2116
+ /** Replaces all slots if not empty. */
2117
+ children?: ReactNode;
2118
+ }
2119
+
2120
+ /**
2121
+ * System that allows you to create root components and slot components.
2122
+ *
2123
+ * @see {@link createSlots}
2124
+ * @typeParam C - The type of the context value.
2125
+ */
2126
+ export declare interface SlotSystem<C> {
2127
+ /**
2128
+ * A hook that returns the current context value from the {@link SlotsProvider}.
2129
+ *
2130
+ * @throws If called outside of a {@link SlotsProvider}.
2131
+ */
2132
+ useSlotsContext: () => C;
2133
+ /**
2134
+ * Renders the slots or children with the given context value.
2135
+ *
2136
+ * Usually placed inside a root component that accepts the props specified by {@link PropsWithSlots} and passes them to this component.
2137
+ *
2138
+ * If {@link props.children} is not an empty value, they are rendered instead of the slots.
2139
+ *
2140
+ * @typeParam S - A dictionary mapping each slot name to a component.
2141
+ */
2142
+ SlotsProvider: <S extends Record<string, FC>>(props: SlotsViewProps<S> & {
2143
+ /**
2144
+ * The context value to provide to slots via {@link useSlotsContext}.
2145
+ */
2146
+ context: C;
2147
+ }) => ReactNode;
2148
+ }
2149
+
1901
2150
  export declare function StandaloneRoute({ app }: StandaloneRouteProps): JSX_2.Element;
1902
2151
 
1903
2152
  export declare interface StandaloneRouteProps {
@@ -2089,9 +2338,24 @@ export declare interface SystemManagerParams {
2089
2338
  }
2090
2339
 
2091
2340
  /**
2092
- * Component that renders the start and search menus, pinned applications and various indicators.
2341
+ * Component that renders the home menu, search menu, pinned and active applications and various indicators.
2093
2342
  */
2094
- export declare const Taskbar: MemoExoticComponent<() => JSX_2.Element>;
2343
+ export declare const Taskbar: typeof TaskbarRoot & InferSlots<Slots< {
2344
+ Home: FC;
2345
+ Search: FC;
2346
+ Apps: FC;
2347
+ Indicators: FC;
2348
+ }> & {
2349
+ children?: ReactNode;
2350
+ }>;
2351
+
2352
+ export declare interface TaskbarAppsProps {
2353
+ renderApp?: FC<{
2354
+ app: App;
2355
+ active: boolean;
2356
+ visible: boolean;
2357
+ }>;
2358
+ }
2095
2359
 
2096
2360
  export declare class TaskbarConfig {
2097
2361
  height: TaskbarConfigOptions["height"];
@@ -2106,6 +2370,47 @@ export declare interface TaskbarConfigOptions {
2106
2370
  height: number;
2107
2371
  }
2108
2372
 
2373
+ /**
2374
+ * Context for {@link Taskbar}.
2375
+ */
2376
+ export declare interface TaskbarContext {
2377
+ /** The current active menu in the taskbar. */
2378
+ activeMenu: "home" | "search" | "indicator" | null;
2379
+ /** Sets the current active menu in the taskbar. */
2380
+ setActiveMenu: (menu: TaskbarContext["activeMenu"]) => void;
2381
+ /** Toggles the active state of a menu in the taskbar. */
2382
+ toggleMenu: (menu: TaskbarContext["activeMenu"], active?: boolean) => void;
2383
+ /** The search query for the search menu in the taskbar. */
2384
+ searchQuery: string;
2385
+ /** Sets the search query for the search menu in the taskbar. */
2386
+ setSearchQuery: Dispatch<string>;
2387
+ searchInputRef: RefObject<HTMLInputElement>;
2388
+ }
2389
+
2390
+ export declare type TaskbarIndicatorsProps = PropsWithSlots<{
2391
+ Battery: FC;
2392
+ Network: FC;
2393
+ Volume: FC;
2394
+ Calendar: FC;
2395
+ DesktopButton: FC;
2396
+ }>;
2397
+
2398
+ /**
2399
+ * Props for {@link Taskbar}.
2400
+ */
2401
+ export declare type TaskbarProps = PropsWithSlots<{
2402
+ Home: FC;
2403
+ Search: FC;
2404
+ Apps: FC;
2405
+ Indicators: FC;
2406
+ }>;
2407
+
2408
+ declare function TaskbarRoot({ children, ...slots }: TaskbarProps): ReactNode;
2409
+
2410
+ export declare const TaskbarSlotsProvider: <S extends Record<string, FC>>(props: SlotsViewProps<S> & {
2411
+ context: TaskbarContext;
2412
+ }) => ReactNode;
2413
+
2109
2414
  export declare function TextDisplay({ children }: TextDisplayProps): JSX_2.Element;
2110
2415
 
2111
2416
  export declare interface TextDisplayProps {
@@ -2408,6 +2713,34 @@ export declare function useSingleton<T>(create: () => T): T;
2408
2713
 
2409
2714
  export declare function useSkin(): Skin;
2410
2715
 
2716
+ /**
2717
+ * Computes the override for the current skin.
2718
+ *
2719
+ * For each entry, if the key is (a subclass of) the current type of skin, the override is applied.
2720
+ * If multiple entries match the current skin, they are merged.
2721
+ *
2722
+ * @param overrides - The overrides to check.
2723
+ * @typeParam Override - The type of override.
2724
+ * @returns All matching overrides merged, or `undefined` if none match.
2725
+ * @see {@link useSkin}
2726
+ */
2727
+ export declare function useSkinOverrides<Override>(overrides: Map<typeof Skin, Override>): Override | undefined;
2728
+
2729
+ /**
2730
+ * Computes the override for the current skin.
2731
+ *
2732
+ * For each entry, if the key is (a subclass of) the current type of skin, the override is applied.
2733
+ * If one or more entries match the current skin, they are all merged with the default value.
2734
+ *
2735
+ * @param overrides - The overrides to check.
2736
+ * @param defaultValue - The default value to merge the matching overrides with.
2737
+ * @typeParam Default - The type of the default value.
2738
+ * @typeParam Override - The type of override.
2739
+ * @returns The default value, merged with all overrides that match.
2740
+ * @see {@link useSkin}
2741
+ */
2742
+ export declare function useSkinOverrides<Default, Override = undefined>(overrides: Map<typeof Skin, Override>, defaultValue: Default): Default | MergeValues<Default, Override>;
2743
+
2411
2744
  /**
2412
2745
  * Generates static class name using BEM notation.
2413
2746
  * @param block - The name of the block.
@@ -2429,6 +2762,8 @@ export declare function useStringSetting(path: SettingsPath, key: string, defaul
2429
2762
 
2430
2763
  export declare function useSystemManager(): SystemManager;
2431
2764
 
2765
+ export declare const useTaskbarContext: () => TaskbarContext;
2766
+
2432
2767
  export declare function useTrackingManager(): TrackingManagerState;
2433
2768
 
2434
2769
  export declare function useVirtualRoot(): VirtualRootState;
@@ -2868,6 +3203,7 @@ export declare class VirtualRoot extends VirtualFolder<VirtualRootEvents> {
2868
3203
  * Adds a shortcut to a file or folder.
2869
3204
  */
2870
3205
  addShortcut(name: string, destination: VirtualFile | VirtualFileLink | VirtualFolder | VirtualFolderLink): this;
3206
+ readSource(source: string): Promise<string | null>;
2871
3207
  /**
2872
3208
  * Tells the storage manager to clear all data and reloads the window.
2873
3209
  */