@rocketman-streamkit/types 1.0.5 → 1.0.6

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/README.md CHANGED
@@ -14,7 +14,7 @@ API reference, manifest format, permissions, and addon categories are published
14
14
 
15
15
  **[github.com/RocketMan-StreamKit/types](https://github.com/RocketMan-StreamKit/types)**
16
16
 
17
- Open the branch that matches your target app version (for example `1.0.5`) and start from [`index.md`](https://github.com/RocketMan-StreamKit/types/blob/1.0.5/index.md).
17
+ Open the branch that matches your target app version (for example `1.0.6`) and start from [`index.md`](https://github.com/RocketMan-StreamKit/types/blob/1.0.6/index.md).
18
18
 
19
19
  This npm package provides **TypeScript typings only**; the docs repo is the full written guide.
20
20
 
package/addon.d.ts CHANGED
@@ -103,6 +103,60 @@ declare global {
103
103
  sourceAddonId?: string;
104
104
  };
105
105
 
106
+ type OverlayTriggerType = | 'donation'
107
+ | 'subscribe'
108
+ | 'subgift'
109
+ | 'follow'
110
+ | 'custom';
111
+
112
+ type OverlayEventTrigger = {
113
+ type: OverlayTriggerType;
114
+ key?: string;
115
+ value?: string | number | boolean;
116
+ };
117
+
118
+ /**
119
+ * Currency code key from the built-in exchange rates table.
120
+ */
121
+ type CurrencyCode = string;
122
+
123
+ type DashboardRecordType = | 'donation'
124
+ | 'subscribe'
125
+ | 'follow'
126
+ | 'custom'
127
+ | 'timer';
128
+
129
+ type DashboardRecordValue = {
130
+ id: string;
131
+ type: DashboardRecordType;
132
+ amount?: [number, CurrencyCode];
133
+ platform: string;
134
+ message?: DashboardLocalizedString;
135
+ from?: string;
136
+ attach?: { type: string; value: string }[];
137
+ };
138
+
139
+ /**
140
+ * Payload delivered to addons subscribed via `dashboard.onRecord`.
141
+ */
142
+ type DashboardRecordIncomingPayload = {
143
+ id: string;
144
+ created: number;
145
+ updated: number;
146
+ record: DashboardRecordValue;
147
+ user?: {
148
+ id: string;
149
+ name: string;
150
+ avatar: string;
151
+ platform: string;
152
+ color?: string;
153
+ icons?: string[];
154
+ };
155
+ sourceAddonId?: string;
156
+ /** Trigger entries used for overlay/sound/hotkey/timer matching. */
157
+ triggers?: OverlayEventTrigger[];
158
+ };
159
+
106
160
  type AddonConfigFieldType = | 'text'
107
161
  | 'color'
108
162
  | 'number'
@@ -350,6 +404,19 @@ declare global {
350
404
  * @requires AddonsPermission.NOTIFY
351
405
  */
352
406
  Send: (payload: { id?: string | undefined; type?: "error" | "success" | "info" | "warning" | undefined; title?: DashboardLocalizedString | undefined; message: DashboardLocalizedString; temp?: boolean | undefined; }) => void;
407
+ /**
408
+ * Removes a notification previously created by this addon.
409
+ Notifications from other addons or the main process are ignored.
410
+ * @requires AddonsPermission.NOTIFY
411
+ * @param id Notification record id (same value passed to `Send`).
412
+ * @example notify.Send({
413
+ id: `${data.id}_status`,
414
+ type: 'success',
415
+ message: { en: 'Connected' },
416
+ });
417
+ notify.Remove(`${data.id}_status`);
418
+ */
419
+ Remove: (id: string) => void;
353
420
  };
354
421
  /**
355
422
  * Permission helpers for the running addon instance.
@@ -984,6 +1051,24 @@ declare global {
984
1051
  * @requires AddonsPermission.DASHBOARD_CHAT_INCOMING
985
1052
  */
986
1053
  offChatMessage: () => Promise<unknown>;
1054
+ /**
1055
+ * Subscribes to new event records shown in the latest-events dashboard widget.
1056
+ The handler receives the stored record (including system `attach` entries
1057
+ for matched overlays, sounds, hotkeys, and timers), resolved user info,
1058
+ trigger entries used for matching, and the source addon id (if any).
1059
+ Unlike chat incoming, the source addon also receives its own records so it
1060
+ can inspect match results after `dashboard.addRecord`.
1061
+ * @requires AddonsPermission.DASHBOARD_EVENTS_INCOMING
1062
+ * @example dashboard.onRecord(payload => {
1063
+ console.log(payload.record.type, payload.record.attach, payload.sourceAddonId);
1064
+ });
1065
+ */
1066
+ onRecord: (handler: (payload: DashboardRecordIncomingPayload) => void | Promise<void>) => Promise<unknown>;
1067
+ /**
1068
+ * Unsubscribes from incoming dashboard event records.
1069
+ * @requires AddonsPermission.DASHBOARD_EVENTS_INCOMING
1070
+ */
1071
+ offRecord: () => Promise<unknown>;
987
1072
  };
988
1073
  /**
989
1074
  * Game integration API for `manifest.type: "game"` addons.
@@ -1144,6 +1229,10 @@ declare global {
1144
1229
  * Receive new chat messages from the chat dashboard window
1145
1230
  */
1146
1231
  | 'DASHBOARD_CHAT_INCOMING'
1232
+ /**
1233
+ * Receive new event records from the latest-events dashboard widget
1234
+ */
1235
+ | 'DASHBOARD_EVENTS_INCOMING'
1147
1236
  /**
1148
1237
  * Create Socket.IO namespaces for addon web pages and external clients
1149
1238
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocketman-streamkit/types",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "TypeScript declarations for the StreamKit+ integration addon sandbox API",
5
5
  "types": "addon.d.ts",
6
6
  "files": [
package/tsconfig.json CHANGED
File without changes