@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250722114330 → 13.346.0-beta.20250722114726

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@league-of-foundry-developers/foundry-vtt-types",
4
- "version": "13.346.0-beta.20250722114330",
4
+ "version": "13.346.0-beta.20250722114726",
5
5
  "description": "TypeScript type definitions for Foundry VTT",
6
6
  "type": "module",
7
7
  "types": "./src/index.d.mts",
@@ -50,7 +50,7 @@ declare class Notifications {
50
50
  * @remarks `type` and `options` use parameter defaults so `null` causes an error
51
51
  */
52
52
  notify<T extends Notifications.Type | undefined = undefined>(
53
- message: string,
53
+ message: string | Error,
54
54
  type?: T,
55
55
  options?: Notifications.NotifyOptions,
56
56
  ): Notifications.Notification<Coalesce<T, "info">>;
@@ -61,7 +61,7 @@ declare class Notifications {
61
61
  * @param options - Notification options passed to the notify function
62
62
  * @returns The registered notification
63
63
  */
64
- info(message: string, options?: Notifications.NotifyOptions): Notifications.Notification<"info">;
64
+ info(message: string | Error, options?: Notifications.NotifyOptions): Notifications.Notification<"info">;
65
65
 
66
66
  /**
67
67
  * Display a notification with the "warning" type
@@ -69,7 +69,7 @@ declare class Notifications {
69
69
  * @param options - Notification options passed to the notify function
70
70
  * @returns The registered notification
71
71
  */
72
- warn(message: string, options?: Notifications.NotifyOptions): Notifications.Notification<"warning">;
72
+ warn(message: string | Error, options?: Notifications.NotifyOptions): Notifications.Notification<"warning">;
73
73
 
74
74
  /**
75
75
  * Display a notification with the "error" type
@@ -77,7 +77,7 @@ declare class Notifications {
77
77
  * @param options - Notification options passed to the notify function
78
78
  * @returns The registered notification
79
79
  */
80
- error(message: string, options?: Notifications.NotifyOptions): Notifications.Notification<"error">;
80
+ error(message: string | Error, options?: Notifications.NotifyOptions): Notifications.Notification<"error">;
81
81
 
82
82
  /**
83
83
  * Display a notification with the "success" type.
@@ -85,7 +85,7 @@ declare class Notifications {
85
85
  * @param options - Notification options passed to the notify function
86
86
  * @returns The registered notification
87
87
  */
88
- success(message: string, options?: Notifications.NotifyOptions): Notifications.Notification<"success">;
88
+ success(message: string | Error, options?: Notifications.NotifyOptions): Notifications.Notification<"success">;
89
89
 
90
90
  /**
91
91
  * Update the progress of the notification.
@@ -132,14 +132,33 @@ declare namespace Notifications {
132
132
  type: T;
133
133
  timestamp: number;
134
134
  message: string;
135
+
136
+ /**
137
+ * @remarks Only set when the original `message` is an `Error`.
138
+ */
139
+ error?: Error | undefined;
140
+
135
141
  permanent: boolean;
136
142
  console: boolean;
137
143
  active: boolean;
138
144
  progress: boolean;
139
145
  pct: number;
146
+
147
+ /**
148
+ * @remarks Set when the notification is currently being rendered. When the notification is
149
+ * removed {@linkcode HTMLLIElement.remove | HTMLLIElement#remove} is called.
150
+ */
140
151
  element?: HTMLLIElement | undefined;
141
- remove?: (() => void) | undefined;
142
- update?: ((update: Notifications.UpdateOptions) => void) | undefined;
152
+
153
+ /**
154
+ * @remarks Foundry claims this is required but always sets it in practice.
155
+ */
156
+ remove: () => void;
157
+
158
+ /**
159
+ * @remarks Foundry claims this is required but always sets it in practice.
160
+ */
161
+ update: (update: Notifications.UpdateOptions) => void;
143
162
  }
144
163
 
145
164
  interface FormatOptions {