Files
atom/src/notification.coffee
2014-11-25 15:44:14 -08:00

29 lines
583 B
CoffeeScript

# Experimental: This will likely change, do not use.
module.exports =
class Notification
constructor: (@type, @message, @options={}) ->
@timestamp = new Date()
getOptions: -> @options
getType: -> @type
getMessage: -> @message
getTimestamp: -> @timestamp
getDetail: -> @options.detail
isClosable: ->
!!@options.closable
getIcon: ->
return @options.icon if @options.icon?
switch @type
when 'fatal' then 'bug'
when 'error' then 'flame'
when 'warning' then 'alert'
when 'info' then 'info'
when 'success' then 'check'