 
 ###*
  * Makes sure that user has given us permissions to send desktop notifications.
+ *
+ * @param {Function} callback - to be called with err, and args object.
+ * @return {Function}
 ###
 permitted = (callback) -> (args...) ->
   browserNotifications

module.exports = class DesktopNotificationsController extends kd.Controller

  ###
   * makes sure browser notifications are supported and permitted by user.
   *
   * NOTE: it curries given options object with the result of err from
   * `permitted` helper.
   *
   * @param {object} options
   * @param {string} options.title
   * @param {string} options.message
   * @return {Promise} a promise which will resolve if user clicks to notification.
  ###
  notify: supported permitted (err, options) ->

###*
 * Makes sure browser notifications are supported.
 *
 * @param {Function} callback
 * @return {Function|undefined} callback
###
supported = (callback) ->
  return callback  if browserNotifications.isSupported()
