Skip to content

Notification API [to be implemented]

hackape edited this page Jul 24, 2017 · 5 revisions

Notification 应该跟 EventLog 结合在一起,EventLog 应该有个 UI 界面。

interface NotificationProps {
  action: string = 'Dismiss'
  key: string = Date.now()
  dismissAfter: string = 600
  type: enum([ERROR, INFO])
  message: string
}

interface NotificationManager {
  private removeNotification (notifKey: string): void
  private addNotification (notification: NotificationProps): Function
  info(message: string): Function
  info(notification: NotificationProps): Function
  error(message: string): Function
  error(notification: NotificationProps): Function
  log(message: string): Function
  log(notification: NotificationProps): Function
}

APIs

Clone this wiki locally