@openfin/core 42.100.101 → 42.100.103

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.
@@ -9410,6 +9410,12 @@ declare type MutableWindowOptions = {
9410
9410
  /**
9411
9411
  * Shows the window's icon in the taskbar.
9412
9412
  *
9413
+ * @remarks
9414
+ * In Windows, setting `showTaskbarIcon` to false will cause the window to display on all virtual desktops.
9415
+ * In order to prevent this while keeping `showTaskbarIcon` false, pass the identity of the parent via the
9416
+ * `modalParentIdentity` (see {@link WindowCreationOptions}). This is useful for popups managed by
9417
+ * {@link Window._Window.showPopupWindow}.
9418
+ *
9413
9419
  * @default true
9414
9420
  */
9415
9421
  showTaskbarIcon: boolean;
@@ -9551,15 +9557,96 @@ declare type NotificationEvent = {
9551
9557
  notificationId: string;
9552
9558
  };
9553
9559
 
9560
+ declare type NotificationHandler = (notification: WebNotificationInfo) => void;
9561
+
9562
+ /**
9563
+ * NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
9564
+ *
9565
+ * Please note, currently Notifications will only be intercepted if the following conditions are met:
9566
+ * - The source WebContents has the `notification` webAPI permission.
9567
+ * - The source WebContents is not a service worker.
9568
+ *
9569
+ * Service worker and push notifications are currently not supported.
9570
+ *
9571
+ * **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
9572
+ *
9573
+ * @experimental This API is subject to change in future releases.
9574
+ *
9575
+ */
9554
9576
  declare class NotificationManagerInstance {
9555
9577
  #private;
9556
- constructor(wire: Transport, id: string);
9557
- setNotificationHandler: (handler: NotificiationHandler) => Promise<void>;
9578
+ /* Excluded from this release type: __constructor */
9579
+ /**
9580
+ * Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
9581
+ *
9582
+ * **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
9583
+ *
9584
+ * @param handler The notification handler callback which will be invoked whenever a notification is created.
9585
+ *
9586
+ * @example
9587
+ *
9588
+ * ```typescript
9589
+ * const notificationManager = await fin.NotificationManager.init();
9590
+ * const handler = (notification) => {
9591
+ * console.log("Received the following notification", info);
9592
+ * }
9593
+ * await notificationManager.setNotificationHandler(handler);
9594
+ * ```
9595
+ */
9596
+ setNotificationHandler: (handler: OpenFin_2.NotificationHandler) => Promise<void>;
9597
+ /**
9598
+ * Destroys the current NotificationManagerInstance.
9599
+ *
9600
+ * @example
9601
+ * ```typescript
9602
+ * await notificationManager.destroy();
9603
+ * ```
9604
+ */
9558
9605
  destroy: () => Promise<void>;
9559
- dispatch: (event: NotificationEvent) => Promise<void>;
9606
+ /**
9607
+ * Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
9608
+ *
9609
+ * @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
9610
+ *
9611
+ * @example
9612
+ * ```typescript
9613
+ * notificationManager.setNotificationHandler((notification) => {
9614
+ * await mockNotificationUi.showNotification(notification);
9615
+ * await notificationManager.dispatchNotificationEvent({
9616
+ * notificationId: notification.notificationId,
9617
+ * type: 'show
9618
+ * })
9619
+ * })
9620
+ * ```
9621
+ *
9622
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
9623
+ *
9624
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
9625
+ *
9626
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
9627
+ */
9628
+ dispatch: (event: OpenFin_2.NotificationEvent) => Promise<void>;
9560
9629
  }
9561
9630
 
9562
9631
  declare class NotificationManagerModule extends Base {
9632
+ /**
9633
+ * Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
9634
+ *
9635
+ * Secured by default, must be called from a WebContents with the NotificationManager.init permission.
9636
+ *
9637
+ * Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
9638
+ *
9639
+ * If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
9640
+ *
9641
+ * @example
9642
+ *
9643
+ * ```js
9644
+ * // From Provider context
9645
+ * const notificationManager = await fin.NotificationManager.init();
9646
+ * // NotificationManager is now active and will intercept all incoming notifications.
9647
+ * ```
9648
+ * @experimental
9649
+ */
9563
9650
  init: () => Promise<NotificationManagerInstance>;
9564
9651
  }
9565
9652
 
@@ -9567,8 +9654,6 @@ declare type NotificationManagerPermissions = {
9567
9654
  init: boolean;
9568
9655
  };
9569
9656
 
9570
- declare type NotificiationHandler = (event: WebNotificationInfo) => void;
9571
-
9572
9657
  /* Excluded from this release type: NotRequested */
9573
9658
 
9574
9659
  /**
@@ -9981,11 +10066,12 @@ declare namespace OpenFin_2 {
9981
10066
  RoutingInfo,
9982
10067
  DownloadShelfOptions,
9983
10068
  ViewShowAtOptions,
10069
+ WebNotificationProperties,
10070
+ WebNotificationInfo,
9984
10071
  NotificationEvent,
10072
+ NotificationHandler,
9985
10073
  NotificationManagerInstance,
9986
10074
  NotificationManagerModule,
9987
- WebNotificationInfo,
9988
- WebNotificationProperties,
9989
10075
  ExtensionInfo,
9990
10076
  ServeRequest,
9991
10077
  AppAssetServeRequest,
@@ -12757,6 +12843,13 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
12757
12843
  apiPath: '.getOSInfo';
12758
12844
  namespace: 'System';
12759
12845
  };
12846
+ 'launch-log-uploader': ApiCall<{
12847
+ options: OpenFin_2.LogUploaderOptions;
12848
+ }, void> & {
12849
+ secure: true;
12850
+ apiPath: '.launchLogUploader';
12851
+ namespace: 'System';
12852
+ };
12760
12853
  'launch-external-process': ApiCall<OpenFin_2.ExternalProcessRequestType, OpenFin_2.Identity> & {
12761
12854
  secure: true;
12762
12855
  apiPath: '.launchExternalProcess';
@@ -13124,12 +13217,6 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
13124
13217
  };
13125
13218
  response: void;
13126
13219
  };
13127
- 'launch-log-uploader': ApiCall<{
13128
- options: OpenFin_2.LogUploaderOptions;
13129
- }, void> & {
13130
- apiPath: '.launchLogUploader';
13131
- namespace: 'System';
13132
- };
13133
13220
  'dispatch-notification-event': {
13134
13221
  request: {
13135
13222
  notificationId: string;
@@ -15781,6 +15868,7 @@ declare type SystemPermissions = {
15781
15868
  downloadAsset: boolean;
15782
15869
  serveAsset: boolean;
15783
15870
  enableNativeWindowIntegrationProvider: boolean;
15871
+ launchLogUploader: boolean;
15784
15872
  };
15785
15873
 
15786
15874
  /**
@@ -9410,6 +9410,12 @@ declare type MutableWindowOptions = {
9410
9410
  /**
9411
9411
  * Shows the window's icon in the taskbar.
9412
9412
  *
9413
+ * @remarks
9414
+ * In Windows, setting `showTaskbarIcon` to false will cause the window to display on all virtual desktops.
9415
+ * In order to prevent this while keeping `showTaskbarIcon` false, pass the identity of the parent via the
9416
+ * `modalParentIdentity` (see {@link WindowCreationOptions}). This is useful for popups managed by
9417
+ * {@link Window._Window.showPopupWindow}.
9418
+ *
9413
9419
  * @default true
9414
9420
  */
9415
9421
  showTaskbarIcon: boolean;
@@ -9551,15 +9557,96 @@ declare type NotificationEvent = {
9551
9557
  notificationId: string;
9552
9558
  };
9553
9559
 
9560
+ declare type NotificationHandler = (notification: WebNotificationInfo) => void;
9561
+
9562
+ /**
9563
+ * NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
9564
+ *
9565
+ * Please note, currently Notifications will only be intercepted if the following conditions are met:
9566
+ * - The source WebContents has the `notification` webAPI permission.
9567
+ * - The source WebContents is not a service worker.
9568
+ *
9569
+ * Service worker and push notifications are currently not supported.
9570
+ *
9571
+ * **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
9572
+ *
9573
+ * @experimental This API is subject to change in future releases.
9574
+ *
9575
+ */
9554
9576
  declare class NotificationManagerInstance {
9555
9577
  #private;
9556
- constructor(wire: Transport, id: string);
9557
- setNotificationHandler: (handler: NotificiationHandler) => Promise<void>;
9578
+ /* Excluded from this release type: __constructor */
9579
+ /**
9580
+ * Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
9581
+ *
9582
+ * **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
9583
+ *
9584
+ * @param handler The notification handler callback which will be invoked whenever a notification is created.
9585
+ *
9586
+ * @example
9587
+ *
9588
+ * ```typescript
9589
+ * const notificationManager = await fin.NotificationManager.init();
9590
+ * const handler = (notification) => {
9591
+ * console.log("Received the following notification", info);
9592
+ * }
9593
+ * await notificationManager.setNotificationHandler(handler);
9594
+ * ```
9595
+ */
9596
+ setNotificationHandler: (handler: OpenFin_2.NotificationHandler) => Promise<void>;
9597
+ /**
9598
+ * Destroys the current NotificationManagerInstance.
9599
+ *
9600
+ * @example
9601
+ * ```typescript
9602
+ * await notificationManager.destroy();
9603
+ * ```
9604
+ */
9558
9605
  destroy: () => Promise<void>;
9559
- dispatch: (event: NotificationEvent) => Promise<void>;
9606
+ /**
9607
+ * Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
9608
+ *
9609
+ * @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
9610
+ *
9611
+ * @example
9612
+ * ```typescript
9613
+ * notificationManager.setNotificationHandler((notification) => {
9614
+ * await mockNotificationUi.showNotification(notification);
9615
+ * await notificationManager.dispatchNotificationEvent({
9616
+ * notificationId: notification.notificationId,
9617
+ * type: 'show
9618
+ * })
9619
+ * })
9620
+ * ```
9621
+ *
9622
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
9623
+ *
9624
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
9625
+ *
9626
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
9627
+ */
9628
+ dispatch: (event: OpenFin_2.NotificationEvent) => Promise<void>;
9560
9629
  }
9561
9630
 
9562
9631
  declare class NotificationManagerModule extends Base {
9632
+ /**
9633
+ * Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
9634
+ *
9635
+ * Secured by default, must be called from a WebContents with the NotificationManager.init permission.
9636
+ *
9637
+ * Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
9638
+ *
9639
+ * If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
9640
+ *
9641
+ * @example
9642
+ *
9643
+ * ```js
9644
+ * // From Provider context
9645
+ * const notificationManager = await fin.NotificationManager.init();
9646
+ * // NotificationManager is now active and will intercept all incoming notifications.
9647
+ * ```
9648
+ * @experimental
9649
+ */
9563
9650
  init: () => Promise<NotificationManagerInstance>;
9564
9651
  }
9565
9652
 
@@ -9567,8 +9654,6 @@ declare type NotificationManagerPermissions = {
9567
9654
  init: boolean;
9568
9655
  };
9569
9656
 
9570
- declare type NotificiationHandler = (event: WebNotificationInfo) => void;
9571
-
9572
9657
  /* Excluded from this release type: NotRequested */
9573
9658
 
9574
9659
  /**
@@ -9981,11 +10066,12 @@ declare namespace OpenFin_2 {
9981
10066
  RoutingInfo,
9982
10067
  DownloadShelfOptions,
9983
10068
  ViewShowAtOptions,
10069
+ WebNotificationProperties,
10070
+ WebNotificationInfo,
9984
10071
  NotificationEvent,
10072
+ NotificationHandler,
9985
10073
  NotificationManagerInstance,
9986
10074
  NotificationManagerModule,
9987
- WebNotificationInfo,
9988
- WebNotificationProperties,
9989
10075
  ExtensionInfo,
9990
10076
  ServeRequest,
9991
10077
  AppAssetServeRequest,
@@ -12757,6 +12843,13 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
12757
12843
  apiPath: '.getOSInfo';
12758
12844
  namespace: 'System';
12759
12845
  };
12846
+ 'launch-log-uploader': ApiCall<{
12847
+ options: OpenFin_2.LogUploaderOptions;
12848
+ }, void> & {
12849
+ secure: true;
12850
+ apiPath: '.launchLogUploader';
12851
+ namespace: 'System';
12852
+ };
12760
12853
  'launch-external-process': ApiCall<OpenFin_2.ExternalProcessRequestType, OpenFin_2.Identity> & {
12761
12854
  secure: true;
12762
12855
  apiPath: '.launchExternalProcess';
@@ -13124,12 +13217,6 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
13124
13217
  };
13125
13218
  response: void;
13126
13219
  };
13127
- 'launch-log-uploader': ApiCall<{
13128
- options: OpenFin_2.LogUploaderOptions;
13129
- }, void> & {
13130
- apiPath: '.launchLogUploader';
13131
- namespace: 'System';
13132
- };
13133
13220
  'dispatch-notification-event': {
13134
13221
  request: {
13135
13222
  notificationId: string;
@@ -15781,6 +15868,7 @@ declare type SystemPermissions = {
15781
15868
  downloadAsset: boolean;
15782
15869
  serveAsset: boolean;
15783
15870
  enableNativeWindowIntegrationProvider: boolean;
15871
+ launchLogUploader: boolean;
15784
15872
  };
15785
15873
 
15786
15874
  /**
@@ -9410,6 +9410,12 @@ declare type MutableWindowOptions = {
9410
9410
  /**
9411
9411
  * Shows the window's icon in the taskbar.
9412
9412
  *
9413
+ * @remarks
9414
+ * In Windows, setting `showTaskbarIcon` to false will cause the window to display on all virtual desktops.
9415
+ * In order to prevent this while keeping `showTaskbarIcon` false, pass the identity of the parent via the
9416
+ * `modalParentIdentity` (see {@link WindowCreationOptions}). This is useful for popups managed by
9417
+ * {@link Window._Window.showPopupWindow}.
9418
+ *
9413
9419
  * @default true
9414
9420
  */
9415
9421
  showTaskbarIcon: boolean;
@@ -9551,15 +9557,96 @@ declare type NotificationEvent = {
9551
9557
  notificationId: string;
9552
9558
  };
9553
9559
 
9560
+ declare type NotificationHandler = (notification: WebNotificationInfo) => void;
9561
+
9562
+ /**
9563
+ * NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
9564
+ *
9565
+ * Please note, currently Notifications will only be intercepted if the following conditions are met:
9566
+ * - The source WebContents has the `notification` webAPI permission.
9567
+ * - The source WebContents is not a service worker.
9568
+ *
9569
+ * Service worker and push notifications are currently not supported.
9570
+ *
9571
+ * **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
9572
+ *
9573
+ * @experimental This API is subject to change in future releases.
9574
+ *
9575
+ */
9554
9576
  declare class NotificationManagerInstance {
9555
9577
  #private;
9556
- constructor(wire: Transport, id: string);
9557
- setNotificationHandler: (handler: NotificiationHandler) => Promise<void>;
9578
+ /* Excluded from this release type: __constructor */
9579
+ /**
9580
+ * Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
9581
+ *
9582
+ * **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
9583
+ *
9584
+ * @param handler The notification handler callback which will be invoked whenever a notification is created.
9585
+ *
9586
+ * @example
9587
+ *
9588
+ * ```typescript
9589
+ * const notificationManager = await fin.NotificationManager.init();
9590
+ * const handler = (notification) => {
9591
+ * console.log("Received the following notification", info);
9592
+ * }
9593
+ * await notificationManager.setNotificationHandler(handler);
9594
+ * ```
9595
+ */
9596
+ setNotificationHandler: (handler: OpenFin_2.NotificationHandler) => Promise<void>;
9597
+ /**
9598
+ * Destroys the current NotificationManagerInstance.
9599
+ *
9600
+ * @example
9601
+ * ```typescript
9602
+ * await notificationManager.destroy();
9603
+ * ```
9604
+ */
9558
9605
  destroy: () => Promise<void>;
9559
- dispatch: (event: NotificationEvent) => Promise<void>;
9606
+ /**
9607
+ * Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
9608
+ *
9609
+ * @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
9610
+ *
9611
+ * @example
9612
+ * ```typescript
9613
+ * notificationManager.setNotificationHandler((notification) => {
9614
+ * await mockNotificationUi.showNotification(notification);
9615
+ * await notificationManager.dispatchNotificationEvent({
9616
+ * notificationId: notification.notificationId,
9617
+ * type: 'show
9618
+ * })
9619
+ * })
9620
+ * ```
9621
+ *
9622
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
9623
+ *
9624
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
9625
+ *
9626
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
9627
+ */
9628
+ dispatch: (event: OpenFin_2.NotificationEvent) => Promise<void>;
9560
9629
  }
9561
9630
 
9562
9631
  declare class NotificationManagerModule extends Base {
9632
+ /**
9633
+ * Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
9634
+ *
9635
+ * Secured by default, must be called from a WebContents with the NotificationManager.init permission.
9636
+ *
9637
+ * Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
9638
+ *
9639
+ * If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
9640
+ *
9641
+ * @example
9642
+ *
9643
+ * ```js
9644
+ * // From Provider context
9645
+ * const notificationManager = await fin.NotificationManager.init();
9646
+ * // NotificationManager is now active and will intercept all incoming notifications.
9647
+ * ```
9648
+ * @experimental
9649
+ */
9563
9650
  init: () => Promise<NotificationManagerInstance>;
9564
9651
  }
9565
9652
 
@@ -9567,8 +9654,6 @@ declare type NotificationManagerPermissions = {
9567
9654
  init: boolean;
9568
9655
  };
9569
9656
 
9570
- declare type NotificiationHandler = (event: WebNotificationInfo) => void;
9571
-
9572
9657
  /* Excluded from this release type: NotRequested */
9573
9658
 
9574
9659
  /**
@@ -9981,11 +10066,12 @@ declare namespace OpenFin_2 {
9981
10066
  RoutingInfo,
9982
10067
  DownloadShelfOptions,
9983
10068
  ViewShowAtOptions,
10069
+ WebNotificationProperties,
10070
+ WebNotificationInfo,
9984
10071
  NotificationEvent,
10072
+ NotificationHandler,
9985
10073
  NotificationManagerInstance,
9986
10074
  NotificationManagerModule,
9987
- WebNotificationInfo,
9988
- WebNotificationProperties,
9989
10075
  ExtensionInfo,
9990
10076
  ServeRequest,
9991
10077
  AppAssetServeRequest,
@@ -12757,6 +12843,13 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
12757
12843
  apiPath: '.getOSInfo';
12758
12844
  namespace: 'System';
12759
12845
  };
12846
+ 'launch-log-uploader': ApiCall<{
12847
+ options: OpenFin_2.LogUploaderOptions;
12848
+ }, void> & {
12849
+ secure: true;
12850
+ apiPath: '.launchLogUploader';
12851
+ namespace: 'System';
12852
+ };
12760
12853
  'launch-external-process': ApiCall<OpenFin_2.ExternalProcessRequestType, OpenFin_2.Identity> & {
12761
12854
  secure: true;
12762
12855
  apiPath: '.launchExternalProcess';
@@ -13124,12 +13217,6 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
13124
13217
  };
13125
13218
  response: void;
13126
13219
  };
13127
- 'launch-log-uploader': ApiCall<{
13128
- options: OpenFin_2.LogUploaderOptions;
13129
- }, void> & {
13130
- apiPath: '.launchLogUploader';
13131
- namespace: 'System';
13132
- };
13133
13220
  'dispatch-notification-event': {
13134
13221
  request: {
13135
13222
  notificationId: string;
@@ -15781,6 +15868,7 @@ declare type SystemPermissions = {
15781
15868
  downloadAsset: boolean;
15782
15869
  serveAsset: boolean;
15783
15870
  enableNativeWindowIntegrationProvider: boolean;
15871
+ launchLogUploader: boolean;
15784
15872
  };
15785
15873
 
15786
15874
  /**
package/out/stub.d.ts CHANGED
@@ -9723,6 +9723,12 @@ declare type MutableWindowOptions = {
9723
9723
  /**
9724
9724
  * Shows the window's icon in the taskbar.
9725
9725
  *
9726
+ * @remarks
9727
+ * In Windows, setting `showTaskbarIcon` to false will cause the window to display on all virtual desktops.
9728
+ * In order to prevent this while keeping `showTaskbarIcon` false, pass the identity of the parent via the
9729
+ * `modalParentIdentity` (see {@link WindowCreationOptions}). This is useful for popups managed by
9730
+ * {@link Window._Window.showPopupWindow}.
9731
+ *
9726
9732
  * @default true
9727
9733
  */
9728
9734
  showTaskbarIcon: boolean;
@@ -9877,15 +9883,99 @@ declare type NotificationEvent = {
9877
9883
  notificationId: string;
9878
9884
  };
9879
9885
 
9886
+ declare type NotificationHandler = (notification: WebNotificationInfo) => void;
9887
+
9888
+ /**
9889
+ * NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
9890
+ *
9891
+ * Please note, currently Notifications will only be intercepted if the following conditions are met:
9892
+ * - The source WebContents has the `notification` webAPI permission.
9893
+ * - The source WebContents is not a service worker.
9894
+ *
9895
+ * Service worker and push notifications are currently not supported.
9896
+ *
9897
+ * **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
9898
+ *
9899
+ * @experimental This API is subject to change in future releases.
9900
+ *
9901
+ */
9880
9902
  declare class NotificationManagerInstance {
9881
9903
  #private;
9904
+ /**
9905
+ * @internal
9906
+ */
9882
9907
  constructor(wire: Transport, id: string);
9883
- setNotificationHandler: (handler: NotificiationHandler) => Promise<void>;
9908
+ /**
9909
+ * Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
9910
+ *
9911
+ * **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
9912
+ *
9913
+ * @param handler The notification handler callback which will be invoked whenever a notification is created.
9914
+ *
9915
+ * @example
9916
+ *
9917
+ * ```typescript
9918
+ * const notificationManager = await fin.NotificationManager.init();
9919
+ * const handler = (notification) => {
9920
+ * console.log("Received the following notification", info);
9921
+ * }
9922
+ * await notificationManager.setNotificationHandler(handler);
9923
+ * ```
9924
+ */
9925
+ setNotificationHandler: (handler: OpenFin_2.NotificationHandler) => Promise<void>;
9926
+ /**
9927
+ * Destroys the current NotificationManagerInstance.
9928
+ *
9929
+ * @example
9930
+ * ```typescript
9931
+ * await notificationManager.destroy();
9932
+ * ```
9933
+ */
9884
9934
  destroy: () => Promise<void>;
9885
- dispatch: (event: NotificationEvent) => Promise<void>;
9935
+ /**
9936
+ * Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
9937
+ *
9938
+ * @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
9939
+ *
9940
+ * @example
9941
+ * ```typescript
9942
+ * notificationManager.setNotificationHandler((notification) => {
9943
+ * await mockNotificationUi.showNotification(notification);
9944
+ * await notificationManager.dispatchNotificationEvent({
9945
+ * notificationId: notification.notificationId,
9946
+ * type: 'show
9947
+ * })
9948
+ * })
9949
+ * ```
9950
+ *
9951
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
9952
+ *
9953
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
9954
+ *
9955
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
9956
+ */
9957
+ dispatch: (event: OpenFin_2.NotificationEvent) => Promise<void>;
9886
9958
  }
9887
9959
 
9888
9960
  declare class NotificationManagerModule extends Base {
9961
+ /**
9962
+ * Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
9963
+ *
9964
+ * Secured by default, must be called from a WebContents with the NotificationManager.init permission.
9965
+ *
9966
+ * Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
9967
+ *
9968
+ * If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
9969
+ *
9970
+ * @example
9971
+ *
9972
+ * ```js
9973
+ * // From Provider context
9974
+ * const notificationManager = await fin.NotificationManager.init();
9975
+ * // NotificationManager is now active and will intercept all incoming notifications.
9976
+ * ```
9977
+ * @experimental
9978
+ */
9889
9979
  init: () => Promise<NotificationManagerInstance>;
9890
9980
  }
9891
9981
 
@@ -9893,8 +9983,6 @@ declare type NotificationManagerPermissions = {
9893
9983
  init: boolean;
9894
9984
  };
9895
9985
 
9896
- declare type NotificiationHandler = (event: WebNotificationInfo) => void;
9897
-
9898
9986
  /**
9899
9987
  * @internal
9900
9988
  *
@@ -10312,11 +10400,12 @@ declare namespace OpenFin_2 {
10312
10400
  RoutingInfo,
10313
10401
  DownloadShelfOptions,
10314
10402
  ViewShowAtOptions,
10403
+ WebNotificationProperties,
10404
+ WebNotificationInfo,
10315
10405
  NotificationEvent,
10406
+ NotificationHandler,
10316
10407
  NotificationManagerInstance,
10317
10408
  NotificationManagerModule,
10318
- WebNotificationInfo,
10319
- WebNotificationProperties,
10320
10409
  ExtensionInfo,
10321
10410
  ServeRequest,
10322
10411
  AppAssetServeRequest,
@@ -13171,6 +13260,13 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
13171
13260
  apiPath: '.getOSInfo';
13172
13261
  namespace: 'System';
13173
13262
  };
13263
+ 'launch-log-uploader': ApiCall<{
13264
+ options: OpenFin_2.LogUploaderOptions;
13265
+ }, void> & {
13266
+ secure: true;
13267
+ apiPath: '.launchLogUploader';
13268
+ namespace: 'System';
13269
+ };
13174
13270
  'launch-external-process': ApiCall<OpenFin_2.ExternalProcessRequestType, OpenFin_2.Identity> & {
13175
13271
  secure: true;
13176
13272
  apiPath: '.launchExternalProcess';
@@ -13538,12 +13634,6 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
13538
13634
  };
13539
13635
  response: void;
13540
13636
  };
13541
- 'launch-log-uploader': ApiCall<{
13542
- options: OpenFin_2.LogUploaderOptions;
13543
- }, void> & {
13544
- apiPath: '.launchLogUploader';
13545
- namespace: 'System';
13546
- };
13547
13637
  'dispatch-notification-event': {
13548
13638
  request: {
13549
13639
  notificationId: string;
@@ -16201,6 +16291,7 @@ declare type SystemPermissions = {
16201
16291
  downloadAsset: boolean;
16202
16292
  serveAsset: boolean;
16203
16293
  enableNativeWindowIntegrationProvider: boolean;
16294
+ launchLogUploader: boolean;
16204
16295
  };
16205
16296
 
16206
16297
  /**
package/out/stub.js CHANGED
@@ -17302,7 +17302,24 @@ var _NotificationManagerInstance_wire, _NotificationManagerInstance_handler, _No
17302
17302
  Object.defineProperty(instance, "__esModule", { value: true });
17303
17303
  instance.NotificationManagerInstance = void 0;
17304
17304
  const lazy_1 = lazy;
17305
+ /**
17306
+ * NotificationManagers allow all {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | HTML5 notifications} created in the application to be intercepted and dispatched.
17307
+ *
17308
+ * Please note, currently Notifications will only be intercepted if the following conditions are met:
17309
+ * - The source WebContents has the `notification` webAPI permission.
17310
+ * - The source WebContents is not a service worker.
17311
+ *
17312
+ * Service worker and push notifications are currently not supported.
17313
+ *
17314
+ * **See also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API | Notification API (MDN)}
17315
+ *
17316
+ * @experimental This API is subject to change in future releases.
17317
+ *
17318
+ */
17305
17319
  class NotificationManagerInstance {
17320
+ /**
17321
+ * @internal
17322
+ */
17306
17323
  constructor(wire, id) {
17307
17324
  _NotificationManagerInstance_wire.set(this, void 0);
17308
17325
  _NotificationManagerInstance_handler.set(this, void 0);
@@ -17332,13 +17349,60 @@ class NotificationManagerInstance {
17332
17349
  });
17333
17350
  return true;
17334
17351
  }));
17352
+ /**
17353
+ * Sets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
17354
+ *
17355
+ * **Note**, only one handler can be used at a time, calling `setNotificationHandler` will replace any existing registered handler.
17356
+ *
17357
+ * @param handler The notification handler callback which will be invoked whenever a notification is created.
17358
+ *
17359
+ * @example
17360
+ *
17361
+ * ```typescript
17362
+ * const notificationManager = await fin.NotificationManager.init();
17363
+ * const handler = (notification) => {
17364
+ * console.log("Received the following notification", info);
17365
+ * }
17366
+ * await notificationManager.setNotificationHandler(handler);
17367
+ * ```
17368
+ */
17335
17369
  this.setNotificationHandler = async (handler) => {
17336
17370
  await __classPrivateFieldGet$1(this, _NotificationManagerInstance_isReceivingNotifications, "f").getValue();
17337
17371
  __classPrivateFieldSet$1(this, _NotificationManagerInstance_handler, handler, "f");
17338
17372
  };
17373
+ /**
17374
+ * Destroys the current NotificationManagerInstance.
17375
+ *
17376
+ * @example
17377
+ * ```typescript
17378
+ * await notificationManager.destroy();
17379
+ * ```
17380
+ */
17339
17381
  this.destroy = async () => {
17340
17382
  await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('destroy-notification-manager', { managerId: __classPrivateFieldGet$1(this, _NotificationManagerInstance_id, "f") });
17341
17383
  };
17384
+ /**
17385
+ * Dispatches a Notification lifecycle event ('close' | 'click' | 'show').
17386
+ *
17387
+ * @param event Identifies the type of event to emit, and which `notificationId` to emit it for.
17388
+ *
17389
+ * @example
17390
+ * ```typescript
17391
+ * notificationManager.setNotificationHandler((notification) => {
17392
+ * await mockNotificationUi.showNotification(notification);
17393
+ * await notificationManager.dispatchNotificationEvent({
17394
+ * notificationId: notification.notificationId,
17395
+ * type: 'show
17396
+ * })
17397
+ * })
17398
+ * ```
17399
+ *
17400
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/click_event | Notification Click Event (MDN)}
17401
+ *
17402
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/close_event | Notification Close Event (MDN)}
17403
+ *
17404
+ * **See Also** - {@link https://developer.mozilla.org/en-US/docs/Web/API/Notification/show_event | Notification Show Event (MDN)}
17405
+ */
17342
17406
  this.dispatch = async (event) => {
17343
17407
  const { notificationId, type } = event;
17344
17408
  await __classPrivateFieldGet$1(this, _NotificationManagerInstance_wire, "f").sendAction('dispatch-notification-event', {
@@ -17360,6 +17424,24 @@ const instance_1 = instance;
17360
17424
  class NotificationManagerModule extends base_1.Base {
17361
17425
  constructor() {
17362
17426
  super(...arguments);
17427
+ /**
17428
+ * Initializes a NotificationManager for the current application, which allows interception of HTML5 web notifications.
17429
+ *
17430
+ * Secured by default, must be called from a WebContents with the NotificationManager.init permission.
17431
+ *
17432
+ * Only one NotificationManager can be active at a time, calls to `init` will fail otherwise.
17433
+ *
17434
+ * If a WebContents with the NotificationManager active reloads or is closed, it will be possible to create a new one.
17435
+ *
17436
+ * @example
17437
+ *
17438
+ * ```js
17439
+ * // From Provider context
17440
+ * const notificationManager = await fin.NotificationManager.init();
17441
+ * // NotificationManager is now active and will intercept all incoming notifications.
17442
+ * ```
17443
+ * @experimental
17444
+ */
17363
17445
  this.init = async () => {
17364
17446
  const { payload: { data: { managerId } } } = await this.wire.sendAction('init-notification-manager');
17365
17447
  const manager = new instance_1.NotificationManagerInstance(this.wire, managerId);
@@ -17385,6 +17467,13 @@ factory.NotificationManagerModule = NotificationManagerModule;
17385
17467
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17386
17468
  };
17387
17469
  Object.defineProperty(exports, "__esModule", { value: true });
17470
+ /**
17471
+ * Entry point for the OpenFin `NotificationManager` API (`fin.NotificationManager`).
17472
+ *
17473
+ * * {@link NotificationManagerModule} contains static initialisation apis to create a {@link NotificationManagerInstance} instance.
17474
+ *
17475
+ * @packageDocumentation
17476
+ */
17388
17477
  __exportStar(factory, exports);
17389
17478
  __exportStar(instance, exports);
17390
17479
  } (notificationManager));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "42.100.101",
3
+ "version": "42.100.103",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",