ngx-toastr 16.0.1 → 16.1.0

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.
@@ -7,7 +7,7 @@ export declare type DisableTimoutType = boolean | 'timeOut' | 'extendedTimeOut';
7
7
  /**
8
8
  * Configuration for an individual toast.
9
9
  */
10
- export interface IndividualConfig {
10
+ export interface IndividualConfig<ConfigPayload = any> {
11
11
  /**
12
12
  * disable both timeOut and extendedTimeOut
13
13
  * default: false
@@ -94,10 +94,9 @@ export interface IndividualConfig {
94
94
  */
95
95
  newestOnTop: boolean;
96
96
  /**
97
- * payload to pass to the toastComponent
98
- * default: null
97
+ * Payload to pass to the toast component
99
98
  */
100
- payload: any;
99
+ payload?: ConfigPayload;
101
100
  }
102
101
  export interface ToastrIconClasses {
103
102
  error: string;
@@ -147,16 +146,16 @@ export interface GlobalConfig extends IndividualConfig {
147
146
  /**
148
147
  * Everything a toast needs to launch
149
148
  */
150
- export declare class ToastPackage {
149
+ export declare class ToastPackage<ConfigPayload = any> {
151
150
  toastId: number;
152
- config: IndividualConfig;
151
+ config: IndividualConfig<ConfigPayload>;
153
152
  message: string | null | undefined;
154
153
  title: string | undefined;
155
154
  toastType: string;
156
155
  toastRef: ToastRef<any>;
157
156
  private _onTap;
158
157
  private _onAction;
159
- constructor(toastId: number, config: IndividualConfig, message: string | null | undefined, title: string | undefined, toastType: string, toastRef: ToastRef<any>);
158
+ constructor(toastId: number, config: IndividualConfig<ConfigPayload>, message: string | null | undefined, title: string | undefined, toastType: string, toastRef: ToastRef<any>);
160
159
  /** Fired on click */
161
160
  triggerTap(): void;
162
161
  onTap(): Observable<void>;
@@ -39,15 +39,15 @@ export declare class ToastrService {
39
39
  private index;
40
40
  constructor(token: ToastToken, overlay: Overlay, _injector: Injector, sanitizer: DomSanitizer, ngZone: NgZone);
41
41
  /** show toast */
42
- show(message?: string, title?: string, override?: Partial<IndividualConfig>, type?: string): ActiveToast<any>;
42
+ show<ConfigPayload = any>(message?: string, title?: string, override?: Partial<IndividualConfig<ConfigPayload>>, type?: string): ActiveToast<any>;
43
43
  /** show successful toast */
44
- success(message?: string, title?: string, override?: Partial<IndividualConfig>): ActiveToast<any>;
44
+ success<ConfigPayload = any>(message?: string, title?: string, override?: Partial<IndividualConfig<ConfigPayload>>): ActiveToast<any>;
45
45
  /** show error toast */
46
- error(message?: string, title?: string, override?: Partial<IndividualConfig>): ActiveToast<any>;
46
+ error<ConfigPayload = any>(message?: string, title?: string, override?: Partial<IndividualConfig<ConfigPayload>>): ActiveToast<any>;
47
47
  /** show info toast */
48
- info(message?: string, title?: string, override?: Partial<IndividualConfig>): ActiveToast<any>;
48
+ info<ConfigPayload = any>(message?: string, title?: string, override?: Partial<IndividualConfig<ConfigPayload>>): ActiveToast<any>;
49
49
  /** show warning toast */
50
- warning(message?: string, title?: string, override?: Partial<IndividualConfig>): ActiveToast<any>;
50
+ warning<ConfigPayload = any>(message?: string, title?: string, override?: Partial<IndividualConfig<ConfigPayload>>): ActiveToast<any>;
51
51
  /**
52
52
  * Remove all or a single toast by id
53
53
  */