ngx-snotifire 1.0.3-beta → 15.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +1 -0
  2. package/esm2020/lib/components/buttons/buttons-config.interface.mjs +1 -1
  3. package/esm2020/lib/components/buttons/buttons.component.mjs +5 -5
  4. package/esm2020/lib/components/ngx-notifire/ngx-snotifire.component.mjs +5 -5
  5. package/esm2020/lib/components/prompt/prompt.component.mjs +4 -4
  6. package/esm2020/lib/components/toast/notifire-toast.model.mjs +2 -2
  7. package/esm2020/lib/components/toast/toast.component.mjs +6 -6
  8. package/esm2020/lib/defaults/defaults.interface.mjs +1 -1
  9. package/esm2020/lib/defaults/global-config.interface.mjs +1 -1
  10. package/esm2020/lib/models/snotifire-notifications.interface.mjs +1 -1
  11. package/esm2020/lib/ngx-snotifire.module.mjs +7 -7
  12. package/esm2020/lib/pipes/keys.pipe.mjs +4 -4
  13. package/esm2020/lib/pipes/truncate.pipe.mjs +4 -4
  14. package/esm2020/lib/services/notification.service.mjs +24 -16
  15. package/fesm2015/ngx-snotifire.mjs +51 -43
  16. package/fesm2015/ngx-snotifire.mjs.map +1 -1
  17. package/fesm2020/ngx-snotifire.mjs +51 -43
  18. package/fesm2020/ngx-snotifire.mjs.map +1 -1
  19. package/lib/components/buttons/buttons-config.interface.d.ts +2 -2
  20. package/lib/components/buttons/buttons.component.d.ts +5 -5
  21. package/lib/components/ngx-notifire/ngx-snotifire.component.d.ts +8 -8
  22. package/lib/components/prompt/prompt.component.d.ts +3 -3
  23. package/lib/components/toast/notifire-toast.model.d.ts +2 -2
  24. package/lib/components/toast/toast.component.d.ts +5 -5
  25. package/lib/defaults/defaults.interface.d.ts +3 -3
  26. package/lib/defaults/global-config.interface.d.ts +1 -1
  27. package/lib/models/snotifire-notifications.interface.d.ts +10 -10
  28. package/lib/services/notification.service.d.ts +47 -41
  29. package/package.json +3 -3
@@ -1,12 +1,12 @@
1
1
  import { SafeHtml } from '@angular/platform-browser';
2
2
  import { Observable, Subject } from 'rxjs';
3
3
  import { SnotifireConfig } from '../models';
4
- import { NotificationDefaults } from '../defaults/defaults.interface';
4
+ import { SnotifireDefaults } from '../defaults/defaults.interface';
5
5
  import { SnotifireModel } from '../models/snotifire.model';
6
- import { NotifireModel } from '../components/toast/notifire-toast.model';
6
+ import { SnotifireToastModel } from '../components/toast/notifire-toast.model';
7
7
  import * as i0 from "@angular/core";
8
- export declare class SnotificationService {
9
- defaultConfig: NotificationDefaults;
8
+ export declare class SnotifireService {
9
+ defaultConfig: SnotifireDefaults;
10
10
  /**
11
11
  * Minimum display time of the notification message
12
12
  */
@@ -14,24 +14,24 @@ export declare class SnotificationService {
14
14
  /**
15
15
  * Emits Notifire Notifications
16
16
  */
17
- readonly emitter: Subject<NotifireModel[]>;
17
+ readonly emitter: Subject<SnotifireToastModel[]>;
18
18
  readonly toastDeleted: Subject<number>;
19
- readonly toastChanged: Subject<NotifireModel>;
20
- notifications: Array<NotifireModel>;
21
- constructor(defaultConfig: NotificationDefaults);
19
+ readonly toastChanged: Subject<SnotifireToastModel>;
20
+ notifications: Array<SnotifireToastModel>;
21
+ constructor(defaultConfig: SnotifireDefaults);
22
22
  /**
23
23
  * Creates toast and add it to array, returns toast id
24
24
  * @param NotificationModel NotificationModel
25
25
  * @return number
26
26
  */
27
- create(notif: SnotifireModel): NotifireModel;
27
+ create(notif: SnotifireModel): SnotifireToastModel;
28
28
  /**
29
29
  * If ID passed, emits toast animation remove, if ID & REMOVE passed, removes toast from notifications array
30
30
  * @param id number
31
31
  * @param remove boolean
32
32
  */
33
33
  remove(id: number, remove?: boolean): void;
34
- setDefaults(defaults: NotificationDefaults): NotificationDefaults;
34
+ setDefaults(defaults: SnotifireDefaults): SnotifireDefaults;
35
35
  /**
36
36
  * Clear notifications array
37
37
  */
@@ -57,27 +57,27 @@ export declare class SnotificationService {
57
57
  * @param config NotifireConfig
58
58
  * @returns number
59
59
  */
60
- html(html: string | SafeHtml, config?: SnotifireConfig): NotifireModel;
60
+ html(html: string | SafeHtml, config?: SnotifireConfig): SnotifireToastModel;
61
61
  /**
62
62
  * Create toast with success style returns toast id;
63
63
  * @param body string
64
64
  * @returns number
65
65
  */
66
- success(body: string): NotifireModel;
66
+ success(body: string): SnotifireToastModel;
67
67
  /**
68
68
  * Create toast with success style returns toast id;
69
69
  * @param body string
70
70
  * @param title string
71
71
  * @returns number
72
72
  */
73
- success(body: string, title: string): NotifireModel;
73
+ success(body: string, title: string): SnotifireToastModel;
74
74
  /**
75
75
  * Create toast with success style returns toast id;
76
76
  * @param body string
77
77
  * @param config NotificationConfig
78
78
  * @returns number
79
79
  */
80
- success(body: string, config: SnotifireConfig): NotifireModel;
80
+ success(body: string, config: SnotifireConfig): SnotifireToastModel;
81
81
  /**
82
82
  * Create toast with success style returns toast id;
83
83
  * @param [body] string
@@ -85,27 +85,27 @@ export declare class SnotificationService {
85
85
  * @param [config] NotificationConfig
86
86
  * @returns number
87
87
  */
88
- success(body: string, title: string, config: SnotifireConfig): NotifireModel;
88
+ success(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
89
89
  /**
90
90
  * Create toast with error style returns toast id;
91
91
  * @param body string
92
92
  * @returns number
93
93
  */
94
- error(body: string): NotifireModel;
94
+ error(body: string): SnotifireToastModel;
95
95
  /**
96
96
  * Create toast with error style returns toast id;
97
97
  * @param body string
98
98
  * @param title string
99
99
  * @returns number
100
100
  */
101
- error(body: string, title: string): NotifireModel;
101
+ error(body: string, title: string): SnotifireToastModel;
102
102
  /**
103
103
  * Create toast with error style returns toast id;
104
104
  * @param body string
105
105
  * @param config NotificationConfig
106
106
  * @returns number
107
107
  */
108
- error(body: string, config: SnotifireConfig): NotifireModel;
108
+ error(body: string, config: SnotifireConfig): SnotifireToastModel;
109
109
  /**
110
110
  * Create toast with error style returns toast id;
111
111
  * @param [body] string
@@ -113,27 +113,27 @@ export declare class SnotificationService {
113
113
  * @param [config] NotificationConfig
114
114
  * @returns number
115
115
  */
116
- error(body: string, title: string, config: SnotifireConfig): NotifireModel;
116
+ error(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
117
117
  /**
118
118
  * Create toast with info style returns toast id;
119
119
  * @param body string
120
120
  * @returns number
121
121
  */
122
- info(body: string): NotifireModel;
122
+ info(body: string): SnotifireToastModel;
123
123
  /**
124
124
  * Create toast with info style returns toast id;
125
125
  * @param body string
126
126
  * @param title string
127
127
  * @returns number
128
128
  */
129
- info(body: string, title: string): NotifireModel;
129
+ info(body: string, title: string): SnotifireToastModel;
130
130
  /**
131
131
  * Create toast with info style returns toast id;
132
132
  * @param body string
133
133
  * @param config NotificationConfig
134
134
  * @returns number
135
135
  */
136
- info(body: string, config: SnotifireConfig): NotifireModel;
136
+ info(body: string, config: SnotifireConfig): SnotifireToastModel;
137
137
  /**
138
138
  * Create toast with info style returns toast id;
139
139
  * @param [body] string
@@ -141,27 +141,27 @@ export declare class SnotificationService {
141
141
  * @param [config] NotificationConfig
142
142
  * @returns number
143
143
  */
144
- info(body: string, title: string, config: SnotifireConfig): NotifireModel;
144
+ info(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
145
145
  /**
146
146
  * Create toast with warning style returns toast id;
147
147
  * @param body string
148
148
  * @returns number
149
149
  */
150
- warning(body: string): NotifireModel;
150
+ warning(body: string): SnotifireToastModel;
151
151
  /**
152
152
  * Create toast with warning style returns toast id;
153
153
  * @param body string
154
154
  * @param title string
155
155
  * @returns number
156
156
  */
157
- warning(body: string, title: string): NotifireModel;
157
+ warning(body: string, title: string): SnotifireToastModel;
158
158
  /**
159
159
  * Create toast with warning style returns toast id;
160
160
  * @param body string
161
161
  * @param config NotificationConfig
162
162
  * @returns number
163
163
  */
164
- warning(body: string, config: SnotifireConfig): NotifireModel;
164
+ warning(body: string, config: SnotifireConfig): SnotifireToastModel;
165
165
  /**
166
166
  * Create toast with warning style returns toast id;
167
167
  * @param [body] string
@@ -169,27 +169,27 @@ export declare class SnotificationService {
169
169
  * @param [config] NotificationConfig
170
170
  * @returns number
171
171
  */
172
- warning(body: string, title: string, config: SnotifireConfig): NotifireModel;
172
+ warning(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
173
173
  /**
174
174
  * Create toast with confirm style returns toast id;
175
175
  * @param body string
176
176
  * @returns number
177
177
  */
178
- confirm(body: string): NotifireModel;
178
+ confirm(body: string): SnotifireToastModel;
179
179
  /**
180
180
  * Create toast with confirm style returns toast id;
181
181
  * @param body string
182
182
  * @param title string
183
183
  * @returns number
184
184
  */
185
- confirm(body: string, title: string): NotifireModel;
185
+ confirm(body: string, title: string): SnotifireToastModel;
186
186
  /**
187
187
  * Create toast with confirm style returns toast id;
188
188
  * @param body string
189
189
  * @param config NotificationConfig
190
190
  * @returns number
191
191
  */
192
- confirm(body: string, config: SnotifireConfig): NotifireModel;
192
+ confirm(body: string, config: SnotifireConfig): SnotifireToastModel;
193
193
  /**
194
194
  * Create toast with confirm style returns toast id;
195
195
  * @param [body] string
@@ -197,27 +197,27 @@ export declare class SnotificationService {
197
197
  * @param [config] NotificationConfig
198
198
  * @returns number
199
199
  */
200
- confirm(body: string, title: string, config: SnotifireConfig): NotifireModel;
200
+ confirm(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
201
201
  /**
202
202
  * Create toast with Prompt style with two buttons, returns toast id;
203
203
  * @param body string
204
204
  * @returns number
205
205
  */
206
- prompt(body: string): NotifireModel;
206
+ prompt(body: string): SnotifireToastModel;
207
207
  /**
208
208
  * Create toast with Prompt style with two buttons, returns toast id;
209
209
  * @param body string
210
210
  * @param title string
211
211
  * @returns number
212
212
  */
213
- prompt(body: string, title: string): NotifireModel;
213
+ prompt(body: string, title: string): SnotifireToastModel;
214
214
  /**
215
215
  * Create toast with Prompt style with two buttons, returns toast id;
216
216
  * @param body string
217
217
  * @param config NotificationConfig
218
218
  * @returns number
219
219
  */
220
- prompt(body: string, config: SnotifireConfig): NotifireModel;
220
+ prompt(body: string, config: SnotifireConfig): SnotifireToastModel;
221
221
  /**
222
222
  * Create toast with Prompt style with two buttons, returns toast id;
223
223
  * @param [body] string
@@ -225,14 +225,14 @@ export declare class SnotificationService {
225
225
  * @param [config] NotificationConfig
226
226
  * @returns number
227
227
  */
228
- prompt(body: string, title: string, config: SnotifireConfig): NotifireModel;
228
+ prompt(body: string, title: string, config: SnotifireConfig): SnotifireToastModel;
229
229
  /**
230
230
  * Creates async toast with Info style. Pass action, and resolve or reject it.
231
231
  * @param body string
232
232
  * @param action Promise<NotificationModel> | Observable<NotificationModel>
233
233
  * @returns number
234
234
  */
235
- async(body: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>): NotifireModel;
235
+ async(body: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>): SnotifireToastModel;
236
236
  /**
237
237
  * Creates async toast with Info style. Pass action, and resolve or reject it.
238
238
  * @param body string
@@ -240,7 +240,7 @@ export declare class SnotificationService {
240
240
  * @param action Promise<NotificationModel> | Observable<NotificationModel>
241
241
  * @returns number
242
242
  */
243
- async(body: string, title: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>): NotifireModel;
243
+ async(body: string, title: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>): SnotifireToastModel;
244
244
  /**
245
245
  * Creates async toast with Info style. Pass action, and resolve or reject it.
246
246
  * @param body string
@@ -248,7 +248,7 @@ export declare class SnotificationService {
248
248
  * @param [config] NotificationConfig
249
249
  * @returns number
250
250
  */
251
- async(body: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>, config: SnotifireConfig): NotifireModel;
251
+ async(body: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>, config: SnotifireConfig): SnotifireToastModel;
252
252
  /**
253
253
  * Creates async toast with Info style. Pass action, and resolve or reject it.
254
254
  * @param body string
@@ -257,8 +257,14 @@ export declare class SnotificationService {
257
257
  * @param [config] NotificationConfig
258
258
  * @returns number
259
259
  */
260
- async(body: string, title: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>, config: SnotifireConfig): NotifireModel;
260
+ async(body: string, title: string, action: Promise<SnotifireModel> | Observable<SnotifireModel>, config: SnotifireConfig): SnotifireToastModel;
261
261
  private mergeToast;
262
- static ɵfac: i0.ɵɵFactoryDeclaration<SnotificationService, never>;
263
- static ɵprov: i0.ɵɵInjectableDeclaration<SnotificationService>;
262
+ /**
263
+ * returns SnotifyToast object
264
+ * @param id Number
265
+ * @return SnotifyToast|undefined
266
+ */
267
+ get(id: number): SnotifireToastModel | undefined;
268
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnotifireService, never>;
269
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnotifireService>;
264
270
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "ngx-snotifire",
3
- "version": "1.0.3-beta",
3
+ "version": "15.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "peerDependencies": {
6
- "@angular/common": "^14.2.0",
7
- "@angular/core": "^14.2.0"
6
+ "@angular/common": "^15.0.0",
7
+ "@angular/core": "^15.0.0"
8
8
  },
9
9
  "dependencies": {
10
10
  "tslib": "^2.3.0"