@openfin/cloud-api
Advanced tools
Comparing version 0.0.1-alpha.4f8b7372 to 0.0.1-alpha.9e898e0
@@ -34,4 +34,2 @@ import * as OpenFin from '@openfin/core'; | ||
* Updates an existing Notification. | ||
* | ||
* @remarks Not implemented. | ||
*/ | ||
@@ -41,4 +39,2 @@ update(...args: Parameters<typeof NotificationsTypes.update>): ReturnType<typeof NotificationsTypes.update>; | ||
* Clears a Notification with the specified id. | ||
* | ||
* @remarks Not implemented. | ||
*/ | ||
@@ -172,2 +168,44 @@ clear(...args: Parameters<typeof NotificationsTypes.clear>): ReturnType<typeof NotificationsTypes.clear>; | ||
* @throws {Error} If the app UUID cannot be extracted from the current context | ||
* | ||
* @example **Basic Usage** Creating a notification, updating it and then clearing it | ||
* ```ts | ||
* const notificationsClient = await getNotificationsClient(); | ||
* | ||
* const notification = await notificationsClient.createNotification({ | ||
* title: 'Hello, World!', | ||
* body: 'This is a notification from the OpenFin Cloud API', | ||
* }); | ||
* | ||
* // Use the `id` from the returned notification to interact with it | ||
* console.log(notification.id); | ||
* | ||
* // Update the notification | ||
* await notificationsClient.update({ | ||
* id: notification.id, | ||
* body: 'This is a notification from the OpenFin Cloud API, that has been updated!', | ||
* }) | ||
* | ||
* // Clear the notification | ||
* await notificationsClient.clear(notification.id); | ||
* ``` | ||
* | ||
* @example **Advanced Usage** Listening for events | ||
* ```ts | ||
* const notificationsClient = await getNotificationsClient(); | ||
* | ||
* // create the notification | ||
* const notification = await notificationsClient.createNotification({ | ||
* title: `${window.fin.me.identity.name} Hello, World!`, | ||
* body: `This is a notification from the cloud API example created at ${new Date().toLocaleTimeString()}`, | ||
* buttons: [ | ||
* { | ||
* title: 'Acknowledge', | ||
* }, | ||
* ], | ||
* }); | ||
* | ||
* notificationsClient.addEventListener('notification-action', (event) => { | ||
* console.log('Notification action:', event); | ||
* }); | ||
* ``` | ||
*/ | ||
@@ -174,0 +212,0 @@ declare function getNotificationsClient(): Promise<NotificationsClient>; |
{ | ||
"name": "@openfin/cloud-api", | ||
"version": "0.0.1-alpha.4f8b7372", | ||
"version": "0.0.1-alpha.9e898e0", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47761
228