@openfin/core 44.101.1 → 44.101.3

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.
@@ -45,6 +45,16 @@ declare type Accelerator = {
45
45
  zoom: boolean;
46
46
  };
47
47
 
48
+ /**
49
+ * @interface
50
+ * Shared context available to all aria label functions.
51
+ */
52
+ declare type AccessibilityContext = {
53
+ arrowNavigationEnabled: boolean;
54
+ deleteKeyCloseEnabled: boolean;
55
+ homeEndNavigationEnabled: boolean;
56
+ };
57
+
48
58
  /**
49
59
  * Generated when a View is added to a layout.
50
60
  * @interface
@@ -54,6 +64,14 @@ declare type AddedToLayoutEvent = BaseEvent_4 & {
54
64
  layoutIdentity: OpenFin_2.LayoutIdentity;
55
65
  };
56
66
 
67
+ /**
68
+ * @interface
69
+ * Context for add tab button aria-label functions.
70
+ */
71
+ declare type AddTabButtonAriaLabelContext = AccessibilityContext & {
72
+ tabCount: number;
73
+ };
74
+
57
75
  /**
58
76
  * Options to use when adding a view to a {@link TabStack}.
59
77
  *
@@ -1599,6 +1617,17 @@ declare type AppVersionRuntimeStatusEvent = {
1599
1617
 
1600
1618
  /* Excluded from this release type: AppVersionTypeFromIdEvent */
1601
1619
 
1620
+ /**
1621
+ * @interface
1622
+ * Custom aria-label providers for accessibility.
1623
+ */
1624
+ declare type AriaLabelOptions = {
1625
+ activeTab?: string | ((ctx: TabAriaLabelContext) => string);
1626
+ inactiveTab?: string | ((ctx: TabAriaLabelContext) => string);
1627
+ closeButton?: string | ((ctx: CloseButtonAriaLabelContext) => string);
1628
+ addTabButton?: string | ((ctx: AddTabButtonAriaLabelContext) => string);
1629
+ };
1630
+
1602
1631
  declare interface AuthorizationPayload {
1603
1632
  token: string;
1604
1633
  file: string;
@@ -3115,6 +3144,11 @@ declare type ClearCacheOption = {
3115
3144
  * browser data that can be used across sessions
3116
3145
  */
3117
3146
  localStorage?: boolean;
3147
+ /**
3148
+ * Clears saved window-state data written for windows that use `saveWindowState`.
3149
+ * After this data is cleared, previously persisted bounds and state (Maximized/Minimized) will not be restored until new state is written again.
3150
+ */
3151
+ windowState?: boolean;
3118
3152
  };
3119
3153
 
3120
3154
  /**
@@ -3157,6 +3191,11 @@ declare type ClearDataOptions = {
3157
3191
  * - `origin-in-all-contexts` - Storage is matched on origin only in all contexts.
3158
3192
  */
3159
3193
  originMatchingMode?: 'third-parties-included' | 'origin-in-all-contexts';
3194
+ /**
3195
+ * Clears saved window-state data written for windows that use `saveWindowState`.
3196
+ * After this data is cleared, previously persisted bounds and state (Maximized/Minimized) will not be restored until new state is written again.
3197
+ */
3198
+ windowState?: boolean;
3160
3199
  };
3161
3200
 
3162
3201
  /**
@@ -3444,6 +3483,15 @@ declare type ClipboardPermissions = {
3444
3483
  */
3445
3484
  declare type ClipboardSelectionType = 'clipboard' | 'selection';
3446
3485
 
3486
+ /**
3487
+ * @interface
3488
+ * Context for close button aria-label functions.
3489
+ */
3490
+ declare type CloseButtonAriaLabelContext = AccessibilityContext & {
3491
+ title: string;
3492
+ isActive: boolean;
3493
+ };
3494
+
3447
3495
  /**
3448
3496
  * Generated when an application is closed.
3449
3497
  * @interface
@@ -4456,6 +4504,10 @@ declare type CreateLayoutOptions = {
4456
4504
  * @experimental
4457
4505
  */
4458
4506
  renderCustomHeaderControls?: (controlsElement: HTMLElement, context: HeaderControlsContext) => (() => void) | void;
4507
+ /**
4508
+ * Accessibility options for the layout. Controls ARIA attributes and keyboard navigation.
4509
+ */
4510
+ accessibilityOptions?: LayoutAccessibilityOptions;
4459
4511
  };
4460
4512
 
4461
4513
  /**
@@ -5139,7 +5191,7 @@ declare interface Environment {
5139
5191
  layoutAllowedInContext(fin: OpenFin_2.Fin<OpenFin_2.EntityType>): boolean;
5140
5192
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5141
5193
  applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5142
- createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5194
+ createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<OpenFin_2.LayoutSyncApi>;
5143
5195
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5144
5196
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
5145
5197
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
@@ -8392,6 +8444,27 @@ declare class Layout extends Base {
8392
8444
  closeView(viewIdentity: OpenFin_2.Identity): Promise<void>;
8393
8445
  }
8394
8446
 
8447
+ /**
8448
+ * @interface
8449
+ * Accessibility options for layout tab navigation and ARIA support.
8450
+ */
8451
+ declare type LayoutAccessibilityOptions = {
8452
+ viewTabOptions?: ViewTabAccessibilityOptions;
8453
+ /**
8454
+ * Keyboard shortcut used to move focus from a tab header element into the active tab's web content.
8455
+ *
8456
+ * - Accepts an accelerator-like string, e.g. `'Ctrl+Enter'`, `'Meta+Enter'`, `'Alt+Enter'`, `'Mod+Enter'`.
8457
+ * - `'Mod'`/`'CmdOrCtrl'`/`'CtrlOrMeta'` means Ctrl on Windows/Linux or Meta on macOS.
8458
+ * - Set to `false` to disable this shortcut.
8459
+ * - In core-web, reverse focus transfer (from iframe web content back to tab header) is not reliably supportable
8460
+ * due to browser iframe security and cross-origin focus restrictions. This hotkey is intentionally one-way:
8461
+ * tab header -> web content.
8462
+ *
8463
+ * @defaultValue 'Mod+Enter'
8464
+ */
8465
+ focusContentHotkey?: string | false;
8466
+ };
8467
+
8395
8468
  /**
8396
8469
  * @interface
8397
8470
  */
@@ -8775,7 +8848,7 @@ declare class LayoutModule extends Base {
8775
8848
  * @returns
8776
8849
  */
8777
8850
  getCurrentLayoutManagerSync: <UserSnapshotType extends OpenFin_2.LayoutSnapshot>() => OpenFin_2.LayoutManager<UserSnapshotType>;
8778
- create: (options: OpenFin_2.CreateLayoutOptions) => Promise<void>;
8851
+ create: (options: OpenFin_2.CreateLayoutOptions) => Promise<OpenFin_2.LayoutSyncApi>;
8779
8852
  destroy: (layoutIdentity: OpenFin_2.LayoutIdentity) => Promise<void>;
8780
8853
  }
8781
8854
 
@@ -8977,6 +9050,19 @@ declare type LayoutStateChangedEvent = LayoutDOMEvent & {
8977
9050
  type: 'layout-state-changed';
8978
9051
  };
8979
9052
 
9053
+ /**
9054
+ * @interface
9055
+ * Sync API returned from Layout.create() for operations that don't require IPC.
9056
+ * Only available in the window context that owns the layout.
9057
+ */
9058
+ declare type LayoutSyncApi = {
9059
+ /**
9060
+ * Updates accessibility options at runtime without recreating the layout.
9061
+ * @param options Partial accessibility options to merge with existing options
9062
+ */
9063
+ updateAccessibilityOptions(options: Partial<LayoutAccessibilityOptions>): void;
9064
+ };
9065
+
8980
9066
  /**
8981
9067
  * @interface
8982
9068
  */
@@ -10490,6 +10576,15 @@ declare namespace OpenFin_2 {
10490
10576
  HeaderControlsContext,
10491
10577
  CreateLayoutOptions,
10492
10578
  MultiInstanceViewBehavior,
10579
+ LayoutAccessibilityOptions,
10580
+ ViewTabElements,
10581
+ ViewTabAccessibilityOptions,
10582
+ AccessibilityContext,
10583
+ TabAriaLabelContext,
10584
+ CloseButtonAriaLabelContext,
10585
+ AddTabButtonAriaLabelContext,
10586
+ AriaLabelOptions,
10587
+ LayoutSyncApi,
10493
10588
  PresetLayoutOptions_2 as PresetLayoutOptions,
10494
10589
  ResultBehavior,
10495
10590
  PopupBaseBehavior,
@@ -12223,6 +12318,38 @@ declare interface PlatformProvider {
12223
12318
  * @returns A promise resolving to `true` if the window should prevent the app from quitting, otherwise `false`.
12224
12319
  */
12225
12320
  shouldWindowPreventQuit(windowIdentity: OpenFin_2.Identity): Promise<boolean>;
12321
+ /**
12322
+ * Returns the platform's keyboard commands. Default implementation returns the manifest's
12323
+ * `platform.commands`. Override to inject additional default commands.
12324
+ * Called once during Platform.init; the result is cached for the lifetime
12325
+ * of the platform.
12326
+ *
12327
+ * @remarks
12328
+ * The returned commands are merged with core's built-in default commands
12329
+ * (unless `disableDefaultCommands` is set).
12330
+ * Overriders receive the raw manifest commands from `super` and can prepend
12331
+ * their own defaults — returned commands override default commands by command name.
12332
+ *
12333
+ * @example
12334
+ * ```js
12335
+ * const overrideCallback = (PlatformProvider) => {
12336
+ * class Override extends PlatformProvider {
12337
+ * getKeyboardCommands() {
12338
+ * const manifestCommands = super.getKeyboardCommands();
12339
+ * const myCommands = [{ command: 'myApp.search', keys: 'Ctrl+K' }];
12340
+ * return [
12341
+ * ...myCommands,
12342
+ * ...manifestCommands
12343
+ * ];
12344
+ * }
12345
+ * }
12346
+ * return new Override();
12347
+ * }
12348
+ *
12349
+ * fin.Platform.init({ overrideCallback });
12350
+ * ```
12351
+ */
12352
+ getKeyboardCommands(): OpenFin_2.ShortcutOverride[];
12226
12353
  /**
12227
12354
  * Method that is called every time an error occurs when processing an action in the Platform Provider. It is meant to be overriden, as a means to debug Platform applications
12228
12355
  */
@@ -14830,13 +14957,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
14830
14957
  * * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
14831
14958
  * * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
14832
14959
  * * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
14960
+ * * windowState: clears data written for windows using `saveWindowState`; after clearing, previously saved bounds and state will not be restored until new state is written
14833
14961
  * @example
14834
14962
  * ```js
14835
14963
  * const clearCacheOptions = {
14836
14964
  * appcache: true,
14837
14965
  * cache: true,
14838
14966
  * cookies: true,
14839
- * localStorage: true
14967
+ * localStorage: true,
14968
+ * windowState: true
14840
14969
  * };
14841
14970
  * fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
14842
14971
  * ```
@@ -14861,12 +14990,16 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
14861
14990
  *
14862
14991
  * @param options - Optional configuration for what data to clear
14863
14992
  *
14993
+ * @remarks Set `windowState: true` to also clear data written for windows using `saveWindowState`.
14994
+ * After this data is cleared, previously saved bounds and state will not be restored until new state is written again.
14995
+ *
14864
14996
  * @example
14865
14997
  * ```js
14866
14998
  * // Clear only cookies and localStorage for a specific origin
14867
14999
  * await fin.System.clearCacheData({
14868
15000
  * dataTypes: ['cookies', 'localStorage'],
14869
- * origins: ['http://localhost:8081']
15001
+ * origins: ['http://localhost:8081'],
15002
+ * windowState: true
14870
15003
  * });
14871
15004
  *
14872
15005
  * // Clear everything except for a specific origin
@@ -16446,6 +16579,13 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
16446
16579
  declare class SystemContentTracing extends Base {
16447
16580
  /**
16448
16581
  * Gets the currently known tracing category groups.
16582
+ *
16583
+ * @example
16584
+ * ```ts
16585
+ * const categories = await fin.System.ContentTracing.getCategories();
16586
+ * const sorted = [...new Set(categories)].sort((a, b) => a.localeCompare(b));
16587
+ * console.log(`Loaded ${sorted.length} tracing categories`);
16588
+ * ```
16449
16589
  */
16450
16590
  getCategories(): Promise<string[]>;
16451
16591
  /**
@@ -16453,6 +16593,29 @@ declare class SystemContentTracing extends Base {
16453
16593
  *
16454
16594
  * Only one content tracing session may be active across the runtime at a time.
16455
16595
  * This method rejects if another identity already owns the active session.
16596
+ *
16597
+ * @example
16598
+ * ```ts
16599
+ * await fin.System.ContentTracing.startRecording({
16600
+ * recording_mode: 'record-as-much-as-possible',
16601
+ * included_categories: [
16602
+ * '*',
16603
+ * 'disabled-by-default-blink.invalidation',
16604
+ * 'disabled-by-default-cc.debug',
16605
+ * 'disabled-by-default-viz.surface_id_flow'
16606
+ * ]
16607
+ * });
16608
+ *
16609
+ * console.log('Content tracing started. Call stopRecording() when ready to collect the trace.');
16610
+ * ```
16611
+ *
16612
+ * @example
16613
+ * ```ts
16614
+ * await fin.System.ContentTracing.startRecording({
16615
+ * categoryFilter: 'electron,blink,cc',
16616
+ * traceOptions: 'record-until-full,enable-sampling'
16617
+ * });
16618
+ * ```
16456
16619
  */
16457
16620
  startRecording(options: OpenFin_2.TraceConfig | OpenFin_2.TraceCategoriesAndOptions): Promise<void>;
16458
16621
  /**
@@ -16460,12 +16623,29 @@ declare class SystemContentTracing extends Base {
16460
16623
  *
16461
16624
  * The calling identity must match the identity that started the active tracing session.
16462
16625
  * This method rejects if tracing is not active or is owned by another identity.
16626
+ *
16627
+ * @example
16628
+ * ```ts
16629
+ * const tracePath = await fin.System.ContentTracing.stopRecording();
16630
+ * console.log('Trace written to:', tracePath);
16631
+ * // Load the file in chrome://tracing or https://ui.perfetto.dev/
16632
+ * ```
16463
16633
  */
16464
16634
  stopRecording(): Promise<string>;
16465
16635
  /**
16466
16636
  * Returns the current maximum trace buffer usage across processes.
16467
16637
  *
16468
16638
  * This method is not supported on macOS and rejects on that platform.
16639
+ *
16640
+ * @example
16641
+ * ```ts
16642
+ * try {
16643
+ * const usage = await fin.System.ContentTracing.getTraceBufferUsage();
16644
+ * console.log(`Buffer usage: ${usage.percentage}% (${usage.value})`);
16645
+ * } catch (error) {
16646
+ * console.warn('Trace buffer usage is not available on this platform.', error);
16647
+ * }
16648
+ * ```
16469
16649
  */
16470
16650
  getTraceBufferUsage(): Promise<OpenFin_2.TraceBufferUsage>;
16471
16651
  }
@@ -16588,6 +16768,17 @@ declare type SystemShutdownHandler = (shutdownEvent: {
16588
16768
  proceed: () => void;
16589
16769
  }) => void;
16590
16770
 
16771
+ /**
16772
+ * @interface
16773
+ * Context for tab aria-label functions.
16774
+ */
16775
+ declare type TabAriaLabelContext = AccessibilityContext & {
16776
+ title: string;
16777
+ isActive: boolean;
16778
+ tabIndex: number;
16779
+ tabCount: number;
16780
+ };
16781
+
16591
16782
  /**
16592
16783
  * Generated when a Layout Tab Component was closed.
16593
16784
  * @interface
@@ -17956,6 +18147,53 @@ declare interface ViewStatuses {
17956
18147
  viewsNotPreventingUnload: Identity_4[];
17957
18148
  }
17958
18149
 
18150
+ /**
18151
+ * @interface
18152
+ * Accessibility options for view tab navigation.
18153
+ */
18154
+ declare type ViewTabAccessibilityOptions = {
18155
+ /**
18156
+ * Controls which elements are reachable via Tab key navigation.
18157
+ * Uses roving tabindex pattern - only one element focusable at a time.
18158
+ * @default ['active-tab', 'add-tab-button']
18159
+ */
18160
+ tabNavigation?: ViewTabElements[];
18161
+ /**
18162
+ * Controls which elements are navigable via Arrow keys.
18163
+ * @default ['inactive-tab', 'active-tab', 'active-tab-close-button', 'inactive-tab-close-button', 'add-tab-button']
18164
+ */
18165
+ arrowNavigation?: ViewTabElements[];
18166
+ /**
18167
+ * Whether Delete/Backspace keys close the focused tab.
18168
+ * @default false
18169
+ */
18170
+ enableDeleteKeyClose?: boolean;
18171
+ /**
18172
+ * Whether Home/End keys jump to first/last navigable element.
18173
+ * @default false
18174
+ */
18175
+ enableHomeEndNavigation?: boolean;
18176
+ /**
18177
+ * Custom aria-label providers. Can be a static string or a function receiving context.
18178
+ */
18179
+ ariaLabels?: AriaLabelOptions;
18180
+ /**
18181
+ * Whether to announce tab changes via aria-live.
18182
+ * @default true
18183
+ */
18184
+ announceTabChanges?: boolean;
18185
+ /**
18186
+ * Focus behavior when a tab is closed via keyboard.
18187
+ * @default 'next'
18188
+ */
18189
+ focusOnCloseStrategy?: 'next' | 'previous' | 'active';
18190
+ };
18191
+
18192
+ /**
18193
+ * Elements that can be navigated in view tabs.
18194
+ */
18195
+ declare type ViewTabElements = 'active-tab' | 'inactive-tab' | 'active-tab-close-button' | 'inactive-tab-close-button' | 'add-tab-button';
18196
+
17959
18197
  /**
17960
18198
  * View throttling state.
17961
18199
  *