Interface WebNotification.WebNotificationJs

All Superinterfaces:
Serializable
Enclosing class:
WebNotification

@JsDefinition public static interface WebNotification.WebNotificationJs extends Serializable
What web notifications ask of their client-side bridge, as a JavaScript definition for Element.executeJs(Class).
  • Method Details

    • show

      @JsExpression("window.Vaadin.Flow.webNotification.show($0, $1, (type, reason, message) => $3($2, type, reason, message), { key: $2, appId: $4 })") PendingJavaScriptResult show(String title, WebNotificationOptions options, String key, ReturnChannelRegistration channel, String appId)
      Shows a notification, reporting clicks, closing and failures through the given channel.
      Parameters:
      title - the title of the notification
      options - what the notification shows besides its title
      key - what close(String) closes the notification by
      channel - the channel the browser reports what happens to the notification through, preceded by the key
      appId - the id of the application showing the notification, so that closeByTag(String, String) only closes the notifications of that application
      Returns:
      the pending result, which completes once the notification is shown or has failed
    • close

      @JsExpression("window.Vaadin.Flow.webNotification.close($0)") PendingJavaScriptResult close(String key)
      Closes the notification shown under the given key.
      Parameters:
      key - the key the notification was shown with
      Returns:
      the pending result, which completes once the close is requested
    • closeByTag

      @JsExpression("window.Vaadin.Flow.webNotification.closeByTag($0, $1)") PendingJavaScriptResult closeByTag(String tag, String appId)
      Closes the notifications the given application has shown with the given tag.
      Parameters:
      tag - the tag of the notifications to close
      appId - the id of the application that showed the notifications
      Returns:
      the pending result, which completes once the close is requested