# Class: Notifications

## Notifications

#### new Notifications( [userOptions])

  Manages a list of notifications

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---

  `userOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `$wrapper` | HTMLElement | <optional> | document.body |
  `onClick` | function | <optional> |  |
  `autoCloseDelay` | Number | <optional> | 5 | In second

  `templates`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `notifications` | String | <optional> | <div class="notifications"><div class="list"></div></div> |
  `notification` | String | <optional> | <div class="notification"></div> |

  `selectors`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `notifications` | String | <optional> | .notifications |
  `list` | String | <optional> | .list |
  `notification` | String | <optional> | .notification |

  `cssClass`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `open` | String | <optional> | open |
  `success` | String | <optional> | success |
  `danger` | String | <optional> | danger |
  `warning` | String | <optional> | warning |
  `info` | String | <optional> | info |

  `animations`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `show` | function | <optional> | ($notification, options) => Promise
  `hide` | function | <optional> | ($notification, options) => Promise

  ##### Example

      let notifSys = new Notification();
      notifSys.add( 'Here is a simple notification' );

### Members

#### <static, readonly> ERROR :String

  Notification error/danger type

  ##### Type:

  - String

#### <static, readonly> INFO :String

  Notification information type

  ##### Type:

  - String

#### <static, readonly> SUCCESS :String

  Notification success type

  ##### Type:

  - String

#### <static, readonly> WARNING :String

  Notification warning type

  ##### Type:

  - String

### Methods

#### add(html, type [, notificationOptions])

  Add a new notification.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `html` | String |  |
  `type` | String |  |

  `notificationOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `closeDelay` | Number | false | <optional> | In second or False
  `onClick` | function | <optional> |

#### addDanger(html [, notificationOptions])

  Add a new error/danger notification.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `html` | String |  |

  `notificationOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `closeDelay` | Number | false | <optional> | In second or False
  `onClick` | function | <optional> |

#### addInfo(html [, notificationOptions])

  Add a new information notification.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `html` | String |  |

  `notificationOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `closeDelay` | Number | false | <optional> | In second or False
  `onClick` | function | <optional> |

#### addSuccess(html [, notificationOptions])

  Add a new success notification.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `html` | String |  |

  `notificationOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `closeDelay` | Number | false | <optional> | In second or False
  `onClick` | function | <optional> |

#### addWarning(html [, notificationOptions])

  Add a new warning notification.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `html` | String |  |

  `notificationOptions`

  Object

  <optional>

  ###### Properties

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `closeDelay` | Number | false | <optional> | In second or False
  `onClick` | function | <optional> |

#### clean()

  Close all notifications and remove all containers

#### closeAll()

  Close all notifications

#### Search results