import { default as uniqueId } from "lodash/uniqueId" ; export type NotificationType = "regular" | "success" | "failure" ; const TYPE_TO_FILE_SUFFIX = { regular : "" , success : "-success" , failure : "-failure" , } ; export function notify ( title , message ? , type = "regular" , id = uniqueId ( "notification-" ) ) { browser . notifications . create ( id , { type : "basic" , title , message : message || "" , iconUrl : browser . extension . getURL ( `icons/icon-256${ TYPE_TO_FILE_SUFFIX [ type ] }.png` ) , } ) ; return id ; }