File tree Expand file tree Collapse file tree 6 files changed +39
-11
lines changed Expand file tree Collapse file tree 6 files changed +39
-11
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,9 @@ node_modules
55# -----------
66notify.js
77notify.js.map
8- notify.d.ts
98notifier.js
109notifier.js.map
11- notifier.d.ts
1210snackbar-component.js
1311snackbar-component.js.map
14- snackbar-component.d.ts
1512toast-component.js
1613toast-component.js.map
17- toast-component.d.ts
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ - typescript declaration files
13+ - toast injection
14+
1015## [ 2.0.0] - 2020-04-23
1116
1217### Added
Original file line number Diff line number Diff line change 1+ type NotificationButton = {
2+ label : string ;
3+ callback : Function ;
4+ ariaLabel ?: string ;
5+ classes ?: string [ ] ;
6+ } ;
7+
8+ type SnackbarNotification = {
9+ message : string ;
10+ uid : string ;
11+ duration ?: number ;
12+ closeable ?: boolean ;
13+ buttons ?: Array < NotificationButton > ;
14+ force ?: boolean ;
15+ classes ?: string [ ] ;
16+ el : HTMLElement ;
17+ } ;
18+
19+ type ToasterNotification = {
20+ title : string ;
21+ message : string ;
22+ closeable ?: boolean ;
23+ icon ?: string ;
24+ duration ?: number ;
25+ classes ?: string [ ] ;
26+ uid : string ;
27+ el : HTMLElement ;
28+ } ;
29+
30+ declare const snackbar : ( settings : SnackbarNotification ) => void ;
31+ declare const toast : ( settings : ToasterNotification ) => void ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @codewithkyle/notifyjs" ,
3- "version" : " 2.0.0 " ,
3+ "version" : " 2.0.1 " ,
44 "description" : " A simple JavaScript library for creating and managing toaster & snackbar notifications" ,
55 "main" : " notify.js" ,
66 "types" : " notify.d.ts" ,
1010 " notify.d.ts" ,
1111 " notifier.js" ,
1212 " notifier.js.map" ,
13- " notifier.d.ts" ,
1413 " snackbar-component.js" ,
1514 " snackbar-component.js.map" ,
16- " snackbar-component.d.ts" ,
1715 " toast-component.js" ,
18- " toast-component.js.map" ,
19- " toast-component.d.ts"
16+ " toast-component.js.map"
2017 ],
2118 "scripts" : {
2219 "compile" : " tsc" ,
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export class Notifier {
180180 }
181181
182182 const lastSlice = shell . querySelector ( "toast-component" ) || null ;
183- if ( ! lastSlice ) {
183+ if ( lastSlice ) {
184184 shell . insertBefore ( toast . el , lastSlice ) ;
185185 } else {
186186 shell . appendChild ( toast . el ) ;
Original file line number Diff line number Diff line change 99 "target" : " ES2019" ,
1010 "module" : " ESNext" ,
1111 "moduleResolution" : " node" ,
12- "declaration" : true ,
1312 "lib" : [" DOM" , " ES2019" ]
1413 },
1514 "exclude" : [" ./node_modules" ],
You can’t perform that action at this time.
0 commit comments