@crowbartools/firebot-types 5.67.0-alpha26 → 5.67.0-alpha28

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 (43) hide show
  1. package/LICENSE +674 -674
  2. package/backend/chat/active-user-handler.d.ts +7 -1
  3. package/backend/chat/frontend-chat-manager.d.ts +36 -0
  4. package/backend/common/connection-manager.d.ts +40 -0
  5. package/backend/common/profile-manager.d.ts +3 -0
  6. package/backend/core/update-manager.d.ts +16 -0
  7. package/backend/currency/currency-manager.d.ts +1 -0
  8. package/backend/effects/builtin/overlay-widgets/update-rotating-text.d.ts +12 -0
  9. package/backend/events/activity-feed-manager.d.ts +8 -1
  10. package/backend/events/event-manager.d.ts +1 -1
  11. package/backend/overlay-widgets/builtin-types/index.d.ts +3 -3
  12. package/backend/overlay-widgets/builtin-types/rotating-text/rotating-text.d.ts +18 -0
  13. package/backend/plugins/executors/plugin-executor.interface.d.ts +2 -1
  14. package/backend/plugins/plugin-api/namespaces/currency.d.ts +2 -0
  15. package/backend/plugins/plugin-api/namespaces/viewers.d.ts +2 -0
  16. package/backend/plugins/plugin-manager.d.ts +19 -7
  17. package/backend/roles/twitch-roles-manager.d.ts +4 -0
  18. package/backend/streaming-platforms/twitch/api/eventsub/eventsub-chat-helpers.d.ts +1 -0
  19. package/backend/streaming-platforms/twitch/api/eventsub/eventsub-client.d.ts +1 -0
  20. package/backend/streaming-platforms/twitch/api/resource/moderation.d.ts +1 -1
  21. package/backend/streaming-platforms/twitch/events/bits.d.ts +1 -1
  22. package/backend/ui-extensions/ui-extension-manager.d.ts +4 -2
  23. package/backend/utils/index.d.ts +1 -0
  24. package/backend/utils/versions.d.ts +9 -0
  25. package/backend/viewers/viewer-database.d.ts +3 -1
  26. package/backend/viewers/viewer-metadata-manager.d.ts +3 -0
  27. package/backend/viewers/viewer-online-status-manager.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/server/http-server-manager.d.ts +2 -2
  30. package/server/websocket-server-manager.d.ts +5 -3
  31. package/shared/compare-versions.d.ts +21 -0
  32. package/types/chat.d.ts +76 -0
  33. package/types/events.d.ts +9 -0
  34. package/types/integrations.d.ts +1 -2
  35. package/types/overlay-widgets.d.ts +1 -0
  36. package/types/parameters.d.ts +1 -0
  37. package/types/plugin-api.d.ts +306 -89
  38. package/types/plugins.d.ts +55 -32
  39. package/types/ui/modal-factory.d.ts +9 -0
  40. package/types/ui-extensions.d.ts +3 -1
  41. package/types/viewers.d.ts +9 -0
  42. package/types/websocket.d.ts +12 -1
  43. package/backend/chat/frontend-chat-helpers.d.ts +0 -14
package/types/events.d.ts CHANGED
@@ -53,6 +53,15 @@ export type EventFilterData = {
53
53
  mode: "inclusive" | "exclusive";
54
54
  filters: FilterSettings[];
55
55
  };
56
+ export type AdditionalFilterEvent = {
57
+ filterId: string;
58
+ eventSourceId: string;
59
+ eventId: string;
60
+ };
61
+ export type PluginAdditionalFilterEvents = {
62
+ filterId: string;
63
+ events: Array<EventSourceAndId>;
64
+ };
56
65
  export type EventSettings = {
57
66
  id: string;
58
67
  type: string;
@@ -43,7 +43,7 @@ export interface IntegrationEvents {
43
43
  disconnected: (id: string) => void;
44
44
  "settings-update": (id: string, settings: Record<string, any>) => void;
45
45
  }
46
- type LinkData = {
46
+ export type LinkData = {
47
47
  accountId: string;
48
48
  } | {
49
49
  auth: Record<string, unknown>;
@@ -66,4 +66,3 @@ export type IntegrationWithUnknowns = {
66
66
  definition: IntegrationDefinition & ObjectOfUnknowns;
67
67
  integration: IntegrationController & ObjectOfUnknowns;
68
68
  };
69
- export {};
@@ -276,6 +276,7 @@ export interface IOverlayWidgetEventUtils {
276
276
  stylesToString(styles: Record<string, string | number | undefined>): string;
277
277
  getFontOptionsStyles(fontOptions?: FontOptions): Record<string, string | number | undefined>;
278
278
  sendMessageToFirebot(messageName: string, messageData?: unknown): void;
279
+ invokeFirebotRequest<TData extends Record<string, unknown> = Record<string, unknown>, TResponse = unknown>(requestName: string, requestData?: TData): Promise<TResponse>;
279
280
  }
280
281
  export interface IOverlayWidgetInitUtils {
281
282
  getWidgetContainerElements(): NodeListOf<HTMLElement>;
@@ -26,6 +26,7 @@ export type BaseParameter = {
26
26
  pattern?: string;
27
27
  };
28
28
  default?: unknown;
29
+ allowReplaceVariables?: boolean;
29
30
  };
30
31
  export type StringParameter = BaseParameter & {
31
32
  type: "string";
@@ -8,58 +8,98 @@ import type { InstalledPlugin } from "./plugins";
8
8
  import type { PluginWebhook } from "./webhooks";
9
9
  import type { ReplaceVariable, VariableConfig } from "./variables";
10
10
  import type { FilterConfig, PresetFilterConfig, TextFilterConfig } from "../backend/events/filters/filter-factory";
11
+ import type { FirebotViewer } from "./viewers";
12
+ import type { Currency } from "./currency";
13
+ export interface Accounts {
14
+ /** Streamer account information */
15
+ streamer: FirebotAccount;
16
+ /** Bot account information. May be null if user has not logged in with a bot account. */
17
+ bot: FirebotAccount;
18
+ }
11
19
  export type PluginLogMethod = (message: string, ...meta: unknown[]) => void;
12
20
  export interface PluginLoggerApi {
21
+ /** Log a message at the debug log level. These may not appear in log files if the user has not enabled debug logging. */
13
22
  debug: PluginLogMethod;
23
+ /** Log a message at the info log level */
14
24
  info: PluginLogMethod;
25
+ /** Log a message at the warn log level */
15
26
  warn: PluginLogMethod;
27
+ /** Log a message at the error log level */
16
28
  error: PluginLogMethod;
17
29
  }
18
- export interface PluginWebhooksApi {
19
- /** Look up a webhook by name. */
20
- get(name: string): PluginWebhook | null;
21
- /** All webhooks owned by this plugin. */
22
- list(): PluginWebhook[];
23
- /** Public URL for a webhook by name, or null if not found. */
24
- getUrl(name: string): string | null;
30
+ export interface PluginSettingsApi {
31
+ /**
32
+ * Get a Firebot setting value or its default
33
+ *
34
+ * @param settingName Name of the setting to get
35
+ * @returns Setting value, or the default if one isn't explicitly set
36
+ */
37
+ getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
25
38
  }
26
- /**
27
- * Simple per-plugin storage scoped to the plugin's data directory.
28
- * Provides helpers for storing/loading JSON values
29
- * plus generic file read/write for anything else.
30
- */
31
39
  export interface PluginStorageApi {
32
40
  /** Absolute path to this plugin's data directory. */
33
41
  readonly path: string;
34
- /** Save a value as JSON under the given key. The key becomes the filename with a `.json` extension. */
35
- setJson(key: string, value: unknown): Promise<void>;
36
42
  /**
37
- * Load a JSON value previously saved with `setJson`. Returns `null` if
38
- * nothing has been stored under this key.
43
+ * Save a value as JSON under the given key. The key becomes the filename with a `.json` extension.
44
+ * @param key The name of the key to store
45
+ * @param value The value to store
39
46
  */
47
+ setJson(key: string, value: unknown): Promise<void>;
48
+ /**
49
+ * Load a JSON value previously saved with {@linkcode setJson}
50
+ * @param key The name of the key to get
51
+ * @returns A `Promise` with either the data of type `T` or `null` if nothing has been stored under this key
52
+ */
40
53
  getJson<T = unknown>(key: string): Promise<T | null>;
41
- /** Delete the JSON value stored under the given key. No-op if missing. */
54
+ /**
55
+ * Delete the JSON value stored under the given key. No-op if missing.
56
+ * @param key The name of the key to delete
57
+ */
42
58
  deleteJson(key: string): Promise<void>;
43
- /** Check whether a file exists in the data directory. */
59
+ /**
60
+ * Check whether a file exists in the data directory.
61
+ * @param name Name of the file to check
62
+ * @returns A `Promise<boolean>` indicating if the file exists
63
+ */
44
64
  fileExists(name: string): Promise<boolean>;
45
- /** Read a file's raw bytes. Returns `null` if it doesn't exist. */
65
+ /**
66
+ * Read a file's raw bytes
67
+ * @param name Name of the file to read
68
+ * @returns A `Promise` with either a `Buffer` containing the file's contents, or `null` if the file doesn't exist
69
+ */
46
70
  readFile(name: string): Promise<Buffer | null>;
47
- /** Read a file as text. Returns `null` if it doesn't exist. */
71
+ /**
72
+ * Read a file as text
73
+ * @param name Name of the file to read
74
+ * @param encoding Encoding to use when reading the file
75
+ * @returns A `Promise` with either a `string` containing the file's contents, or `null` if the file doesn't exist
76
+ */
48
77
  readTextFile(name: string, encoding?: BufferEncoding): Promise<string | null>;
49
- /** Write contents to a file, creating any missing parent directories. */
78
+ /**
79
+ * Write contents to a file, creating any missing parent directories
80
+ * @param name Name of the file to write
81
+ * @param contents Data to store in the file
82
+ */
50
83
  writeFile(name: string, contents: string | Buffer | Uint8Array): Promise<void>;
51
- /** Delete a file. No-op if it doesn't exist. */
84
+ /**
85
+ * Delete a file. No-op if it doesn't exist.
86
+ * @param name Name of the file to delete
87
+ */
52
88
  deleteFile(name: string): Promise<void>;
53
89
  }
54
90
  export type PluginEventHandler = (event: TriggeredEvent) => void;
55
91
  export interface PluginEventsApi {
56
92
  /**
57
- * Subscribe to all Firebot events as they trigger. Returns an `unsubscribe`
58
- * function.
93
+ * Subscribe to all Firebot events as they trigger
94
+ * @param hander Function to execute when an event is triggered
95
+ * @returns An `unsubscribe` function
59
96
  */
60
97
  onTriggered(handler: PluginEventHandler): () => void;
61
98
  /**
62
- * Manually trigger a Firebot event.
99
+ * Manually trigger a Firebot event
100
+ * @param sourceId Event source ID
101
+ * @param eventId Event ID
102
+ * @param meta (Optional) Any metadata to include with the event
63
103
  */
64
104
  trigger(sourceId: string, eventId: string, meta?: Record<string, unknown>): Promise<void>;
65
105
  }
@@ -68,144 +108,321 @@ export interface PluginEffectsApi {
68
108
  * Run an effect list. Respects the list's run mode and effect queue, if any.
69
109
  * Resolves once the effects have been run (queued lists resolve
70
110
  * immediately).
111
+ * @param context An object containing the context of the effects to run,
112
+ * including any trigger data and effect outputs.
71
113
  */
72
114
  processEffects(context: RunEffectsContext): Promise<unknown>;
73
115
  }
116
+ export interface PluginViewersApi {
117
+ /**
118
+ * Retrieve a Firebot user from the viewer database via their Twitch user ID
119
+ * @param userId The viewer's Twitch user ID
120
+ * @returns A {@linkcode FirebotViewer} with the specified user ID, or `undefined` if the viewer isn't in the database or the viewer database is disabled
121
+ */
122
+ getViewerByUserId(userId: string): Promise<FirebotViewer>;
123
+ /**
124
+ * Retrieve a Firebot user from the viewer database via their Twitch username
125
+ * @param username The viewer's Twitch username
126
+ * @returns A {@linkcode FirebotViewer} with the specified username, or `undefined` if the viewer isn't in the database or the viewer database is disabled
127
+ */
128
+ getViewerByUsername(username: string): Promise<FirebotViewer>;
129
+ /**
130
+ * Get a metadata value for a given user
131
+ * @param userId The viewer's Twitch user ID
132
+ * @param key Key of the metadata value to get
133
+ * @param propertyPath (Optional) Dot-notated property path
134
+ * @returns A `Promise` with the value, or `null` if it doesn't exist
135
+ */
136
+ getViewerMetadataValue(userId: string, key: string, propertyPath: string): Promise<unknown>;
137
+ /**
138
+ * Set a metadata value for a given user
139
+ * @param userId The viewer's Twitch user ID
140
+ * @param key Key of the metadata value to set
141
+ * @param value Data to store
142
+ * @param propertyPath (Optional) Dot-notated property path
143
+ */
144
+ setViewerMetadataValue(userId: string, key: string, value: string, propertyPath: string): Promise<void>;
145
+ /**
146
+ * Delete a metadata value for a given user
147
+ * @param userId The viewer's Twitch user ID
148
+ * @param key Key of the metadata value to delete
149
+ */
150
+ deleteViewerMetadataValue(userId: string, key: string): Promise<void>;
151
+ }
152
+ export interface PluginCurrencyApi {
153
+ /**
154
+ * Get an array of all currencies
155
+ * @returns An array of {@linkcode Currency}
156
+ */
157
+ getAllCurrencies(): Array<Currency>;
158
+ /**
159
+ * Get a specific currency by its ID
160
+ * @param id ID of the currency to get
161
+ * @returns The {@linkcode Currency} with the given ID, or `null` if it doesn't exist
162
+ */
163
+ getCurrencyById(id: string): Currency;
164
+ /**
165
+ * Get a specific currency by its name
166
+ * @param name Name of the currency to get
167
+ * @returns The {@linkcode Currency} with the given name, or `null` if it doesn't exist
168
+ */
169
+ getCurrencyByName(name: string): Currency;
170
+ /**
171
+ * Get the amount of a viewer's currency
172
+ * @param userId The viewer's Twitch user ID
173
+ * @param currencyId The ID of the currency to get
174
+ * @returns A `Promise` with the total of the specified currency the viewer currently has
175
+ */
176
+ getViewerCurrency(userId: string, currencyId: string): Promise<number>;
177
+ /**
178
+ * Add to or subtract from a viewer's currency
179
+ * @param userId The viewer's Twitch user ID
180
+ * @param currencyId The ID of the currency to adjust
181
+ * @param amount An amount to add to the specified currency for the viewer. Negative values will subtract that amount.
182
+ * @returns A `Promise` indicating if the adjustment to the viewer's currency was successful
183
+ */
184
+ addOrSubtractViewerCurrency(userId: string, currencyId: string, amount: number): Promise<boolean>;
185
+ /**
186
+ * Set a viewer's currency to a specific amount
187
+ * @param userId The viewer's Twitch user ID
188
+ * @param currencyId The ID of the currency to set
189
+ * @param amount The total amount of the specified currency the viewer should have
190
+ * @returns A `Promise` indicating if setting the viewer's currency was successful
191
+ */
192
+ setViewerCurrency(userId: string, currencyId: string, amount: number): Promise<boolean>;
193
+ /**
194
+ * Get an array of viewers with the highest amounts of a specific currency
195
+ * @param currencyId The ID of the currency
196
+ * @param count The total number of viewers to retrieve
197
+ * @returns A `Promise` with an array of {@linkcode FirebotViewer} representing the
198
+ * viewers that possess the specified currency, sorted by highest amount first
199
+ */
200
+ getCurrencyLeaderboard(currencyId: string, count: number): Promise<Array<FirebotViewer>>;
201
+ }
74
202
  export interface PluginTwitchApi {
75
203
  /** The full Twitch API surface. See {@linkcode TwitchApi}. */
76
204
  api: typeof TwitchApi;
77
205
  }
78
- /**
79
- * Access to this plugin's saved parameter values (the settings configured by
80
- * the user)
81
- */
82
206
  export interface PluginParametersApi {
83
- getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
84
- }
85
- export interface PluginNotificationsApi {
86
207
  /**
87
- * Create a new notification. Pass `permanentlySave` as `true` to persist it
88
- * across restarts.
208
+ * Get all parameter values for this plugin
209
+ * @returns A `Record<string, unknown>` containing the parameter names and their values
89
210
  */
90
- add(notification: Pick<Notification, "title" | "message" | "type" | "metadata">, permanentlySave?: boolean): Notification;
91
- /** Look up one of this plugin's notifications by id. */
92
- get(id: string): Notification | null;
93
- /** All notifications owned by this plugin. */
94
- getAll(): Notification[];
95
- /** Delete one of this plugin's notifications by id. */
96
- delete(id: string): void;
97
- /** Delete all of this plugin's notifications. */
98
- clearAll(): void;
211
+ getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
99
212
  }
100
213
  export interface PluginFrontendCommunicatorApi {
101
- /** Send a synchronous event to the frontend. */
214
+ /**
215
+ * Send a synchronous event to the frontend
216
+ * @param eventName Name of the event to send
217
+ * @param (Optional) Any data to send with the event
218
+ */
102
219
  send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
103
220
  /**
104
221
  * Send an asynchronous event to the frontend and await the reply it sends
105
- * back.
222
+ * back
223
+ * @param eventName Name of the event to send
224
+ * @param (Optional) Any data to send with the event
225
+ * @returns A `Promise` with any response data received
106
226
  */
107
227
  fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
108
228
  }
109
229
  export interface PluginMessageEvent<TPayload = unknown> {
110
- /** The pluginId of the plugin that sent the message. */
230
+ /** The pluginId of the plugin that sent the message */
111
231
  sender: string;
112
- /** The provided payload. */
232
+ /** The provided payload */
113
233
  payload: TPayload;
114
234
  }
115
- /**
116
- * Plugin-to-plugin messaging. Supports both fire-and-forget (`emit`/`on`/`off`)
117
- * and request/response (`invoke`/`handle`) messaging over a shared event bus,
118
- * based on Electron's IPC
119
- */
120
235
  export interface ScopedIpc {
121
- /** Broadcast a message on a channel. */
236
+ /**
237
+ * Broadcast a message on a channel
238
+ * @param channel Name of the channel to send on
239
+ * @param data Data to send with the message
240
+ */
122
241
  emit(channel: string, data: unknown): void;
123
242
  /**
124
- * Listen for messages on a channel.
125
- * Returns an `unsubscribe` function.
243
+ * Listen for messages on a channel
244
+ * @param channel Name of the channel to listen on
245
+ * @param callback A function that will get executed when a message is received
246
+ * @returns An `unsubscribe` function
126
247
  */
127
248
  on<TPayload = unknown>(channel: string, callback: (event: PluginMessageEvent<TPayload>) => void): () => void;
128
- /** Remove a previously registered `on` listener. */
249
+ /**
250
+ * Remove a previously registered {@linkcode on} listener
251
+ * @param channel Name of the channel to stop listening on
252
+ * @param callback The function that was used during registration
253
+ */
129
254
  off(channel: string, callback: (...args: never[]) => void): void;
130
255
  /**
131
256
  * Send a request on a channel and await a response. Rejects if
132
257
  * no handler responds within a 10s timeout or if the handler throws.
258
+ * @param channel Name of the channel to invoke on
259
+ * @param data (Optional) Any data to send along with the request
260
+ * @returns A `Promise` with any response data received
133
261
  */
134
262
  invoke<TRequestPayload = unknown, TResponseData = unknown>(channel: string, data?: TRequestPayload): Promise<TResponseData>;
135
263
  /**
136
- * Register the handler for a request channel.
264
+ * Register the handler for a request channel
265
+ * @param channel Name of the channel to listen on
266
+ * @param handlerFn A function that is executed when a request
267
+ * is invoked on the specified channel using {@linkcode invoke}
137
268
  */
138
269
  handle<TRequestPayload = unknown, TResponseData = unknown>(channel: string, handlerFn: (payload: TRequestPayload, sender: string) => Promise<TResponseData> | TResponseData): void;
139
270
  }
140
- export interface PluginSettingsApi {
271
+ export interface PluginNotificationsApi {
141
272
  /**
142
- * Get a Firebot setting value or its default
143
- *
144
- * @param settingName Name of the setting to get
145
- * @returns Setting value, or the default if one isn't explicitly set
273
+ * Create a new notification
274
+ * @param notification The notification to add
275
+ * @param permanentlySave (Optional) Set as `true` to persist the notification across Firebot restarts
276
+ * @returns The {@linkcode Notification} that was created
146
277
  */
147
- getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
278
+ add(notification: Pick<Notification, "title" | "message" | "type" | "metadata">, permanentlySave?: boolean): Notification;
279
+ /**
280
+ * Look up one of this plugin's notifications by ID
281
+ * @param id ID of the notification to retrieve
282
+ * @returns The {@linkcode Notification} with the given ID, or `null` if it doesn't exist
283
+ */
284
+ get(id: string): Notification | null;
285
+ /**
286
+ * All notifications owned by this plugin
287
+ * @returns An array of {@linkcode Notification}
288
+ */
289
+ getAll(): Array<Notification>;
290
+ /**
291
+ * Delete one of this plugin's notifications by ID
292
+ * @param id ID of the notification to delete
293
+ */
294
+ delete(id: string): void;
295
+ /** Delete all of this plugin's notifications */
296
+ clearAll(): void;
148
297
  }
149
298
  export interface PluginPluginsApi {
150
299
  /**
151
- * Get a list of currently installed plugins installed by the user
300
+ * Get a list of plugins currently installed by the user
301
+ * @returns A `Promise` with an array of {@linkcode InstalledPlugin} objects
152
302
  */
153
303
  getInstalledPlugins(): Promise<Array<InstalledPlugin>>;
154
304
  }
155
- export interface Accounts {
156
- streamer: FirebotAccount;
157
- bot: FirebotAccount;
158
- }
159
305
  export interface PluginWebServerApi {
160
306
  /**
161
- * Sends a custom event over the internal Firebot WebSocket server
307
+ * Send a custom event over the internal Firebot WebSocket server
162
308
  * @param name Name of the event to send. Full event name will be `custom-event:{name}`
163
- * @param data Any optional data you would like to send with the event
309
+ * @param data (Optional) Any data you would like to send with the event
310
+ */
311
+ sendWebSocketEvent(name: string, data?: unknown): void;
312
+ /**
313
+ * Create a resource token for a file to be retrieved via the internal HTTP server (e.g. in an overlay).
314
+ * The URL format for retrieval is: `http://localhost:7472/resource/{token}`
315
+ * @param path Full file path of the resource
316
+ * @param ttl (Optional) Time (in seconds) to retain the resource token once it is retrieved the first time.
317
+ * Setting this to `null`/`undefined` will retain the token until Firebot exits.
318
+ * @returns A token representing the resource
164
319
  */
165
- sendWebSocketEvent(name: string, data?: unknown): any;
320
+ createResourceToken(path: string, ttl?: number): string;
321
+ }
322
+ export interface PluginWebhooksApi {
323
+ /**
324
+ * Look up a webhook by name
325
+ * @param name Name of the webhook
326
+ * @return The {@linkcode PluginWebhook} with the given name, or `null` if it doesn't exist
327
+ */
328
+ get(name: string): PluginWebhook | null;
329
+ /**
330
+ * Get all webhooks owned by this plugin
331
+ * @returns An array of {@linkcode PluginWebhook}
332
+ */
333
+ list(): Array<PluginWebhook>;
334
+ /**
335
+ * Get the public URL for a webhook by name
336
+ * @param name Name of the webhook
337
+ * @returns The webhook's URL, or `null` if it doesn't exist
338
+ */
339
+ getUrl(name: string): string | null;
166
340
  }
167
341
  export interface PluginVariableFactoryApi {
342
+ /**
343
+ * Create a basic replace variable based on an event metadata value
344
+ * @param config Configuration data for the new variable
345
+ * @returns A {@linkcode ReplaceVariable} based on the specified config data
346
+ */
168
347
  createEventDataVariable(config: VariableConfig): ReplaceVariable;
169
348
  }
170
349
  export interface PluginEventFilterFactoryApi {
350
+ /**
351
+ * Create a basic event filter based on a text value
352
+ * @param config Configuration data for the new filter
353
+ * @returns An {@linkcode EventFilter} based on the specified config data
354
+ */
171
355
  createTextFilter(config: TextFilterConfig): EventFilter;
356
+ /**
357
+ * Create a basic event filter based on a numeric value
358
+ * @param config Configuration data for the new filter
359
+ * @returns An {@linkcode EventFilter} based on the specified config data
360
+ */
172
361
  createNumberFilter(config: FilterConfig): EventFilter;
362
+ /**
363
+ * Create a basic event filter based on either a text or numeric value
364
+ * @param config Configuration data for the new filter
365
+ * @returns An {@linkcode EventFilter} based on the specified config data
366
+ */
173
367
  createTextOrNumberFilter(config: TextFilterConfig): EventFilter;
368
+ /**
369
+ * Create a basic event filter based on a list of preset values
370
+ * @param config Configuration data for the new filter
371
+ * @returns An {@linkcode EventFilter} based on the specified config data
372
+ */
174
373
  createPresetFilter(config: PresetFilterConfig): EventFilter;
175
374
  }
176
375
  export interface FirebotPluginApi {
177
- /** Running Firebot version, e.g. `"5.67.0"`. */
376
+ /** Running Firebot version, e.g. `"5.67.0"` */
178
377
  version: string;
179
- /** The streamer and bot accounts currently in use. */
378
+ /** The user's streamer and bot accounts currently in use */
180
379
  accounts: Accounts;
181
- /** Scoped logger. */
380
+ /** A scoped logger */
182
381
  logger: PluginLoggerApi;
183
- /** Access to Firebot settings. */
382
+ /** Access to Firebot settings */
184
383
  settings: PluginSettingsApi;
185
- /** Webhooks owned by this plugin. */
186
- webhooks: PluginWebhooksApi;
187
- /** Simple persistent storage rooted at this plugin's data directory. */
384
+ /**
385
+ * Simple per-plugin storage scoped to the plugin's data directory.
386
+ * Provides helpers for storing/loading JSON values
387
+ * plus generic file read/write for anything else.
388
+ */
188
389
  storage: PluginStorageApi;
189
- /** Subscribe to and trigger Firebot events + register event sources. */
390
+ /** Subscribe to and trigger Firebot events */
190
391
  events: PluginEventsApi;
191
- /** Run effect lists. */
392
+ /** Run effect lists */
192
393
  effects: PluginEffectsApi;
193
- /** Access to Firebot's Twitch API wrappers (Helix, chat, auth, etc). */
394
+ /** Access to the viewer database, including viewer metadata */
395
+ viewers: PluginViewersApi;
396
+ /** Access to currencies, including viewer currency amounts and leaderboards */
397
+ currency: PluginCurrencyApi;
398
+ /** Access to Firebot's Twitch API wrappers (Helix, chat, auth, etc) */
194
399
  twitch: PluginTwitchApi;
195
- /** This plugin's saved parameter values. */
400
+ /**
401
+ * Access to this plugin's saved parameter values (the settings configured by
402
+ * the user)
403
+ */
196
404
  parameters: PluginParametersApi;
197
- /** Two-way messaging between the plugin and the frontend. */
405
+ /**
406
+ * Two-way messaging between the plugin and the Firebot frontend, including
407
+ * UI Extensions
408
+ */
198
409
  frontendCommunicator: PluginFrontendCommunicatorApi;
199
- /** Plugin-to-plugin messaging */
410
+ /**
411
+ * Plugin-to-plugin messaging. Supports both fire-and-forget (`emit`/`on`/`off`)
412
+ * and request/response (`invoke`/`handle`) messaging over a shared event bus,
413
+ * based on Electron's IPC.
414
+ */
200
415
  messaging: ScopedIpc;
201
- /** Notifications owned by this plugin. */
416
+ /** In-app user notifications owned by this plugin */
202
417
  notifications: PluginNotificationsApi;
203
- /** Access to installed plugins. */
418
+ /** Access to installed plugins */
204
419
  plugins: PluginPluginsApi;
205
- /** Firebot internal web server functions. */
420
+ /** Firebot internal web server functions */
206
421
  webServer: PluginWebServerApi;
207
- /** Factory for creating variables based on event data. */
422
+ /** Webhooks owned by this plugin */
423
+ webhooks: PluginWebhooksApi;
424
+ /** Factory functions for creating basic replace variables */
208
425
  variableFactory: PluginVariableFactoryApi;
209
- /** Factory for creating event filters. */
426
+ /** Factory functions for creating basic event filters */
210
427
  eventFilterFactory: PluginEventFilterFactoryApi;
211
428
  }