@openfin/workspace-platform 23.2.9 → 23.2.11

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.
@@ -30,11 +30,30 @@ export declare class ThemeStorageController {
30
30
  private themePaletteSheet?;
31
31
  private generatedPalettes?;
32
32
  private workspaceStorage?;
33
+ private recreateFactory?;
33
34
  constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>);
34
35
  /**
35
36
  * Set the current Storage Proxy to enable Workspace Storage properties to be populated.
36
37
  */
37
38
  setWorkspaceStorageProxy: (proxy: StorageProxy) => void;
39
+ /**
40
+ * Set a factory to recreate the storage proxy if it was destroyed (e.g. when a new browser
41
+ * window is opened after the last one closed with preventQuitOnLastWindowClosed true).
42
+ * Called once at platform init; avoids createWindow needing URL/env dependencies.
43
+ */
44
+ setRecreateFactory: (factory: () => Promise<StorageProxy>) => void;
45
+ /**
46
+ * Close the storage proxy window and clear the reference. Called when the last browser window
47
+ * closes so the platform can quit (storage proxy would otherwise keep the process alive).
48
+ * Clears the reference before awaiting destroy() to avoid a race with ensureWorkspaceStorageProxy.
49
+ */
50
+ destroyWorkspaceStorageProxy: () => Promise<void>;
51
+ /**
52
+ * Ensure the workspace storage proxy exists, recreating via the factory set at init if it was
53
+ * previously destroyed. No-op if no factory was set (e.g. in tests). Call before using
54
+ * workspace storage (e.g. when creating a browser window).
55
+ */
56
+ ensureWorkspaceStorageProxy: () => Promise<void>;
38
57
  /**
39
58
  * Check if there's an explicit user preference stored in localStorage.
40
59
  * A user preference is indicated by the presence of a SelectedColorScheme key. Which is something assigned if you click on the Appearance dropdown.
@@ -4,3 +4,9 @@ export type StorageProxy = {
4
4
  destroy: () => Promise<void>;
5
5
  };
6
6
  export declare const createStorageProxy: (url: string) => Promise<StorageProxy>;
7
+ /**
8
+ * Ensure the workspace storage proxy window exists. Recreates it if it was previously destroyed
9
+ * (e.g. when the last browser window closed with preventQuitOnLastWindowClosed true and a new
10
+ * browser window is now being created). Uses the factory registered at init; no-op in tests.
11
+ */
12
+ export declare const ensureWorkspaceStorageProxy: () => Promise<void>;
@@ -291,12 +291,13 @@ export declare const OpenFinDarkTheme: {
291
291
  };
292
292
  export declare const DefaultOpenFinTheme: CustomThemes;
293
293
  export declare const parseNotificationIndicatorColors: (customTheme: CustomTheme) => NotificationIndicatorColorsParsed;
294
+ export declare const constructThemePaletteSheet: (themes: GeneratedPalettes) => string;
294
295
  export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<{
295
296
  theme: CustomThemes | GeneratedPalettes;
296
297
  defaultScheme: ColorSchemeOptionType;
298
+ themePaletteSheet: string;
297
299
  }>;
298
300
  export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
299
301
  export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType, "system">>;
300
302
  export declare const getComputedBackgroundColor: (platformIdentity: OpenFin.Identity) => Promise<string>;
301
- export declare const constructThemePaletteSheet: (themes: GeneratedPalettes) => string;
302
303
  export {};
@@ -1,4 +1,10 @@
1
+ import type OpenFin from '@openfin/core';
1
2
  import { BackgroundLayers, CustomPaletteSet } from '../../../common/src/api/theming';
3
+ export type ColorSchemeValue = 'light' | 'dark' | 'system';
4
+ export type WorkspaceSchemeSetting = 'light' | 'dark' | 'system';
5
+ export type MediaSchemeValue = 'light' | 'dark';
6
+ /** Maps a color scheme to OpenFin native theme preferences. */
7
+ export declare const mapColorSchemeToNativeTheme: (scheme: ColorSchemeValue) => OpenFin.NativeTheme;
2
8
  /**
3
9
  * Parses a CSS color string (hex, rgb(a), or hsl(a)) into a structured RGB string and alpha value.
4
10
  *