@openfin/core 43.100.63 → 43.100.65
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/out/mock-alpha.d.ts +87 -7
- package/out/mock-beta.d.ts +87 -7
- package/out/mock-public.d.ts +87 -7
- package/out/stub.d.ts +89 -6
- package/out/stub.js +89 -0
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
@@ -9557,15 +9557,96 @@ declare type NotificationEvent = {
|
|
9557
9557
|
notificationId: string;
|
9558
9558
|
};
|
9559
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
|
+
*/
|
9560
9576
|
declare class NotificationManagerInstance {
|
9561
9577
|
#private;
|
9562
|
-
|
9563
|
-
|
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
|
+
*/
|
9564
9605
|
destroy: () => Promise<void>;
|
9565
|
-
|
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>;
|
9566
9629
|
}
|
9567
9630
|
|
9568
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
|
+
*/
|
9569
9650
|
init: () => Promise<NotificationManagerInstance>;
|
9570
9651
|
}
|
9571
9652
|
|
@@ -9573,8 +9654,6 @@ declare type NotificationManagerPermissions = {
|
|
9573
9654
|
init: boolean;
|
9574
9655
|
};
|
9575
9656
|
|
9576
|
-
declare type NotificiationHandler = (event: WebNotificationInfo) => void;
|
9577
|
-
|
9578
9657
|
/* Excluded from this release type: NotRequested */
|
9579
9658
|
|
9580
9659
|
/**
|
@@ -9987,11 +10066,12 @@ declare namespace OpenFin_2 {
|
|
9987
10066
|
RoutingInfo,
|
9988
10067
|
DownloadShelfOptions,
|
9989
10068
|
ViewShowAtOptions,
|
10069
|
+
WebNotificationProperties,
|
10070
|
+
WebNotificationInfo,
|
9990
10071
|
NotificationEvent,
|
10072
|
+
NotificationHandler,
|
9991
10073
|
NotificationManagerInstance,
|
9992
10074
|
NotificationManagerModule,
|
9993
|
-
WebNotificationInfo,
|
9994
|
-
WebNotificationProperties,
|
9995
10075
|
ExtensionInfo,
|
9996
10076
|
ServeRequest,
|
9997
10077
|
AppAssetServeRequest,
|
package/out/mock-beta.d.ts
CHANGED
@@ -9557,15 +9557,96 @@ declare type NotificationEvent = {
|
|
9557
9557
|
notificationId: string;
|
9558
9558
|
};
|
9559
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
|
+
*/
|
9560
9576
|
declare class NotificationManagerInstance {
|
9561
9577
|
#private;
|
9562
|
-
|
9563
|
-
|
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
|
+
*/
|
9564
9605
|
destroy: () => Promise<void>;
|
9565
|
-
|
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>;
|
9566
9629
|
}
|
9567
9630
|
|
9568
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
|
+
*/
|
9569
9650
|
init: () => Promise<NotificationManagerInstance>;
|
9570
9651
|
}
|
9571
9652
|
|
@@ -9573,8 +9654,6 @@ declare type NotificationManagerPermissions = {
|
|
9573
9654
|
init: boolean;
|
9574
9655
|
};
|
9575
9656
|
|
9576
|
-
declare type NotificiationHandler = (event: WebNotificationInfo) => void;
|
9577
|
-
|
9578
9657
|
/* Excluded from this release type: NotRequested */
|
9579
9658
|
|
9580
9659
|
/**
|
@@ -9987,11 +10066,12 @@ declare namespace OpenFin_2 {
|
|
9987
10066
|
RoutingInfo,
|
9988
10067
|
DownloadShelfOptions,
|
9989
10068
|
ViewShowAtOptions,
|
10069
|
+
WebNotificationProperties,
|
10070
|
+
WebNotificationInfo,
|
9990
10071
|
NotificationEvent,
|
10072
|
+
NotificationHandler,
|
9991
10073
|
NotificationManagerInstance,
|
9992
10074
|
NotificationManagerModule,
|
9993
|
-
WebNotificationInfo,
|
9994
|
-
WebNotificationProperties,
|
9995
10075
|
ExtensionInfo,
|
9996
10076
|
ServeRequest,
|
9997
10077
|
AppAssetServeRequest,
|
package/out/mock-public.d.ts
CHANGED
@@ -9557,15 +9557,96 @@ declare type NotificationEvent = {
|
|
9557
9557
|
notificationId: string;
|
9558
9558
|
};
|
9559
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
|
+
*/
|
9560
9576
|
declare class NotificationManagerInstance {
|
9561
9577
|
#private;
|
9562
|
-
|
9563
|
-
|
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
|
+
*/
|
9564
9605
|
destroy: () => Promise<void>;
|
9565
|
-
|
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>;
|
9566
9629
|
}
|
9567
9630
|
|
9568
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
|
+
*/
|
9569
9650
|
init: () => Promise<NotificationManagerInstance>;
|
9570
9651
|
}
|
9571
9652
|
|
@@ -9573,8 +9654,6 @@ declare type NotificationManagerPermissions = {
|
|
9573
9654
|
init: boolean;
|
9574
9655
|
};
|
9575
9656
|
|
9576
|
-
declare type NotificiationHandler = (event: WebNotificationInfo) => void;
|
9577
|
-
|
9578
9657
|
/* Excluded from this release type: NotRequested */
|
9579
9658
|
|
9580
9659
|
/**
|
@@ -9987,11 +10066,12 @@ declare namespace OpenFin_2 {
|
|
9987
10066
|
RoutingInfo,
|
9988
10067
|
DownloadShelfOptions,
|
9989
10068
|
ViewShowAtOptions,
|
10069
|
+
WebNotificationProperties,
|
10070
|
+
WebNotificationInfo,
|
9990
10071
|
NotificationEvent,
|
10072
|
+
NotificationHandler,
|
9991
10073
|
NotificationManagerInstance,
|
9992
10074
|
NotificationManagerModule,
|
9993
|
-
WebNotificationInfo,
|
9994
|
-
WebNotificationProperties,
|
9995
10075
|
ExtensionInfo,
|
9996
10076
|
ServeRequest,
|
9997
10077
|
AppAssetServeRequest,
|
package/out/stub.d.ts
CHANGED
@@ -9883,15 +9883,99 @@ declare type NotificationEvent = {
|
|
9883
9883
|
notificationId: string;
|
9884
9884
|
};
|
9885
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
|
+
*/
|
9886
9902
|
declare class NotificationManagerInstance {
|
9887
9903
|
#private;
|
9904
|
+
/**
|
9905
|
+
* @internal
|
9906
|
+
*/
|
9888
9907
|
constructor(wire: Transport, id: string);
|
9889
|
-
|
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
|
+
*/
|
9890
9934
|
destroy: () => Promise<void>;
|
9891
|
-
|
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>;
|
9892
9958
|
}
|
9893
9959
|
|
9894
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
|
+
*/
|
9895
9979
|
init: () => Promise<NotificationManagerInstance>;
|
9896
9980
|
}
|
9897
9981
|
|
@@ -9899,8 +9983,6 @@ declare type NotificationManagerPermissions = {
|
|
9899
9983
|
init: boolean;
|
9900
9984
|
};
|
9901
9985
|
|
9902
|
-
declare type NotificiationHandler = (event: WebNotificationInfo) => void;
|
9903
|
-
|
9904
9986
|
/**
|
9905
9987
|
* @internal
|
9906
9988
|
*
|
@@ -10318,11 +10400,12 @@ declare namespace OpenFin_2 {
|
|
10318
10400
|
RoutingInfo,
|
10319
10401
|
DownloadShelfOptions,
|
10320
10402
|
ViewShowAtOptions,
|
10403
|
+
WebNotificationProperties,
|
10404
|
+
WebNotificationInfo,
|
10321
10405
|
NotificationEvent,
|
10406
|
+
NotificationHandler,
|
10322
10407
|
NotificationManagerInstance,
|
10323
10408
|
NotificationManagerModule,
|
10324
|
-
WebNotificationInfo,
|
10325
|
-
WebNotificationProperties,
|
10326
10409
|
ExtensionInfo,
|
10327
10410
|
ServeRequest,
|
10328
10411
|
AppAssetServeRequest,
|
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));
|