Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Notification

Notification namespace

Index

Type aliases

ActionDisplayType

ActionDisplayType: "default" | "accent" | "warn" | "link"

Enumeration of available action display type.

TypeOptions

TypeOptions: "info" | "in-progress" | "success" | "warning" | "error" | "default"

Type of notifications

Variables

Const manager

The global notification manager.

Functions

dismiss

  • dismiss(id?: string): void
  • Dismiss one notification (specified by its id) or all if no id provided

    Parameters

    • Optional id: string

      notification id

    Returns void

emit

  • Helper function to emit a notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    • message: string

      Notification message

    • Optional type: TypeOptions

      Notification type

    • Optional options: IOptions<T>

      Options for the error notification

    Returns string

    Notification unique id

error

  • error<T>(message: string, options?: IOptions<T>): string
  • Helper function to emit an error notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    • message: string

      Notification message

    • Optional options: IOptions<T>

      Options for the error notification

    Returns string

    Notification unique id

info

  • info<T>(message: string, options?: IOptions<T>): string
  • Helper function to emit an info notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    • message: string

      Notification message

    • Optional options: IOptions<T>

      Options for the info notification

    Returns string

    Notification unique id

promise

  • promise<Pending, Success, Error>(promise: Promise<Success>, options: IPromiseOptions<Pending, Success, Error>): string
  • Helper function to show an in-progress notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • Pending: ReadonlyJSONValue = ReadonlyJSONValue

    • Success: ReadonlyJSONValue = Pending

    • Error: ReadonlyJSONValue = Pending

    Parameters

    • promise: Promise<Success>

      Promise to wait for

    • options: IPromiseOptions<Pending, Success, Error>

      Options for the in-progress notification

    Returns string

    Notification unique id

success

  • success<T>(message: string, options?: IOptions<T>): string
  • Helper function to emit a success notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    • message: string

      Notification message

    • Optional options: IOptions<T>

      Options for the success notification

    Returns string

    Notification unique id

update

  • update<T>(args: IUpdate<T>): boolean
  • Helper function to update a notification.

    If the notification does not exists, nothing will happen.

    Once updated the notification will be moved at the begin of the notification stack.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    Returns boolean

    Whether the update was successful or not.

warning

  • warning<T>(message: string, options?: IOptions<T>): string
  • Helper function to emit a warning notification.

    Notes

    The message will be truncated if longer than 140 characters.

    Type parameters

    • T: ReadonlyJSONValue = ReadonlyJSONValue

    Parameters

    • message: string

      Notification message

    • Optional options: IOptions<T>

      Options for the warning notification

    Returns string

    Notification unique id

Generated using TypeDoc