@etsoo/notificationbase 1.0.86 → 1.0.87

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.
@@ -35,7 +35,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
35
35
  * @param callback Callback
36
36
  * @param props Props
37
37
  */
38
- alert(error: string, callback?: NotificationReturn<void>, props?: C): void;
38
+ alert(error: string, callback?: NotificationReturn<void>, props?: C): INotification<UI, C>;
39
39
  /**
40
40
  * Align all notification count
41
41
  * @param align Align
@@ -57,7 +57,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
57
57
  * @param callback Callback
58
58
  * @param props Props
59
59
  */
60
- confirm(message: string, title?: string, callback?: NotificationReturn<boolean>, props?: C): void;
60
+ confirm(message: string, title?: string, callback?: NotificationReturn<boolean>, props?: C): INotification<UI, C>;
61
61
  /**
62
62
  * Dispose all notifications
63
63
  */
@@ -93,7 +93,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
93
93
  * @param title Title
94
94
  * @param props More properties
95
95
  */
96
- prompt<T = string>(message: string, callback: NotificationReturn<T>, title?: string, props?: C): void;
96
+ prompt<T = string>(message: string, callback: NotificationReturn<T>, title?: string, props?: C): INotification<UI, C>;
97
97
  /**
98
98
  * Show loading
99
99
  * @param title Title
@@ -107,7 +107,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
107
107
  * @param timespan Timespan to close
108
108
  * @param props Props
109
109
  */
110
- succeed(message: string, title?: string, callback?: NotificationReturn<void>, timespan?: number, props?: C): void;
110
+ succeed(message: string, title?: string, callback?: NotificationReturn<void>, timespan?: number, props?: C): INotification<UI, C>;
111
111
  }
112
112
  /**
113
113
  * Notification container class
@@ -184,7 +184,7 @@ export declare abstract class NotificationContainer<UI, C extends NotificationCa
184
184
  * @param callback Callback
185
185
  * @param props Props
186
186
  */
187
- alert(error: string, callback?: NotificationReturn<void>, props?: C): void;
187
+ alert(error: string, callback?: NotificationReturn<void>, props?: C): INotification<UI, C>;
188
188
  /**
189
189
  * Confirm action
190
190
  * @param message Message
@@ -192,7 +192,7 @@ export declare abstract class NotificationContainer<UI, C extends NotificationCa
192
192
  * @param callback Callback
193
193
  * @param props Props
194
194
  */
195
- confirm(message: string, title?: string, callback?: NotificationReturn<boolean>, props?: C): void;
195
+ confirm(message: string, title?: string, callback?: NotificationReturn<boolean>, props?: C): INotification<UI, C>;
196
196
  /**
197
197
  * Hide loading
198
198
  */
@@ -213,7 +213,7 @@ export declare abstract class NotificationContainer<UI, C extends NotificationCa
213
213
  * @param title Title
214
214
  * @param props More properties
215
215
  */
216
- prompt<T>(message: string, callback: NotificationReturn<T>, title?: string, props?: C): void;
216
+ prompt<T>(message: string, callback: NotificationReturn<T>, title?: string, props?: C): INotification<UI, C>;
217
217
  /**
218
218
  * Show loading
219
219
  * @param title Title
@@ -227,5 +227,5 @@ export declare abstract class NotificationContainer<UI, C extends NotificationCa
227
227
  * @param timespan Timespan to close
228
228
  * @param props Props
229
229
  */
230
- succeed(message: string, title?: string, callback?: NotificationReturn<void>, timespan?: number, props?: C): void;
230
+ succeed(message: string, title?: string, callback?: NotificationReturn<void>, timespan?: number, props?: C): INotification<UI, C>;
231
231
  }
@@ -150,7 +150,7 @@ export class NotificationContainer {
150
150
  onReturn: callback
151
151
  };
152
152
  // Add to the collection
153
- this.addRaw(n);
153
+ return this.addRaw(n);
154
154
  }
155
155
  /**
156
156
  * Confirm action
@@ -169,7 +169,7 @@ export class NotificationContainer {
169
169
  inputProps: props
170
170
  };
171
171
  // Add to the collection
172
- this.addRaw(n);
172
+ return this.addRaw(n);
173
173
  }
174
174
  /**
175
175
  * Hide loading
@@ -219,7 +219,7 @@ export class NotificationContainer {
219
219
  onReturn: callback
220
220
  };
221
221
  // Add to the collection
222
- this.addRaw(n);
222
+ return this.addRaw(n);
223
223
  }
224
224
  /**
225
225
  * Show loading
@@ -247,7 +247,7 @@ export class NotificationContainer {
247
247
  // Default to zero for constant
248
248
  timespan !== null && timespan !== void 0 ? timespan : (timespan = 0);
249
249
  // Create as message
250
- this.message(NotificationMessageType.Success, message, title, {
250
+ return this.message(NotificationMessageType.Success, message, title, {
251
251
  align: NotificationAlign.Center,
252
252
  modal: true,
253
253
  timespan,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/notificationbase",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "TypeScript notification component for extending with all features described and partially implemented",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -51,7 +51,11 @@ export interface INotifier<UI, C extends NotificationCallProps> {
51
51
  * @param callback Callback
52
52
  * @param props Props
53
53
  */
54
- alert(error: string, callback?: NotificationReturn<void>, props?: C): void;
54
+ alert(
55
+ error: string,
56
+ callback?: NotificationReturn<void>,
57
+ props?: C
58
+ ): INotification<UI, C>;
55
59
 
56
60
  /**
57
61
  * Align all notification count
@@ -82,7 +86,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
82
86
  title?: string,
83
87
  callback?: NotificationReturn<boolean>,
84
88
  props?: C
85
- ): void;
89
+ ): INotification<UI, C>;
86
90
 
87
91
  /**
88
92
  * Dispose all notifications
@@ -135,7 +139,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
135
139
  callback: NotificationReturn<T>,
136
140
  title?: string,
137
141
  props?: C
138
- ): void;
142
+ ): INotification<UI, C>;
139
143
 
140
144
  /**
141
145
  * Show loading
@@ -157,7 +161,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
157
161
  callback?: NotificationReturn<void>,
158
162
  timespan?: number,
159
163
  props?: C
160
- ): void;
164
+ ): INotification<UI, C>;
161
165
  }
162
166
 
163
167
  /**
@@ -355,7 +359,7 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
355
359
  };
356
360
 
357
361
  // Add to the collection
358
- this.addRaw(n);
362
+ return this.addRaw(n);
359
363
  }
360
364
 
361
365
  /**
@@ -381,7 +385,7 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
381
385
  };
382
386
 
383
387
  // Add to the collection
384
- this.addRaw(n);
388
+ return this.addRaw(n);
385
389
  }
386
390
 
387
391
  /**
@@ -447,7 +451,7 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
447
451
  };
448
452
 
449
453
  // Add to the collection
450
- this.addRaw(n);
454
+ return this.addRaw(n);
451
455
  }
452
456
 
453
457
  /**
@@ -485,7 +489,7 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
485
489
  timespan ??= 0;
486
490
 
487
491
  // Create as message
488
- this.message(
492
+ return this.message(
489
493
  NotificationMessageType.Success,
490
494
  message,
491
495
  title,