@crowbartools/firebot-types 5.67.0-alpha15 → 5.67.0-alpha17

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/events/filters/builtin/firebot/custom-variable-name.d.ts +1 -1
  3. package/backend/events/filters/builtin/firebot/custom-widget-message-name.d.ts +1 -1
  4. package/backend/events/filters/builtin/firebot/index.d.ts +1 -3
  5. package/backend/events/filters/builtin/firebot/metadata-key.d.ts +1 -1
  6. package/backend/events/filters/builtin/firebot/metadata-value.d.ts +1 -1
  7. package/backend/events/filters/builtin/firebot/new-currency-amount.d.ts +1 -3
  8. package/backend/events/filters/builtin/firebot/new-view-time.d.ts +1 -3
  9. package/backend/events/filters/builtin/firebot/previous-currency-amount.d.ts +1 -3
  10. package/backend/events/filters/builtin/firebot/previous-view-time.d.ts +1 -3
  11. package/backend/events/filters/builtin/index.d.ts +1 -3
  12. package/backend/events/filters/builtin/third-party/donation-amount.d.ts +1 -3
  13. package/backend/events/filters/builtin/third-party/donation-from.d.ts +1 -1
  14. package/backend/events/filters/builtin/third-party/index.d.ts +1 -3
  15. package/backend/events/filters/builtin/twitch/bits-badge-tier.d.ts +1 -3
  16. package/backend/events/filters/builtin/twitch/chat-mode-duration.d.ts +1 -3
  17. package/backend/events/filters/builtin/twitch/cheer-bits-amount.d.ts +1 -3
  18. package/backend/events/filters/builtin/twitch/gift-count.d.ts +1 -3
  19. package/backend/events/filters/builtin/twitch/gift-duration.d.ts +1 -3
  20. package/backend/events/filters/builtin/twitch/index.d.ts +1 -3
  21. package/backend/events/filters/builtin/twitch/lifetime-gift-count.d.ts +1 -3
  22. package/backend/events/filters/builtin/twitch/message.d.ts +1 -1
  23. package/backend/events/filters/builtin/twitch/raid-viewer-count.d.ts +1 -3
  24. package/backend/events/filters/builtin/twitch/reward-name.d.ts +1 -1
  25. package/backend/events/filters/builtin/twitch/stream-category.d.ts +1 -1
  26. package/backend/events/filters/builtin/twitch/sub-months.d.ts +1 -3
  27. package/backend/events/filters/builtin/twitch/username.d.ts +1 -1
  28. package/backend/events/filters/builtin/twitch/watch-streak-count.d.ts +1 -3
  29. package/backend/events/filters/filter-factory.d.ts +9 -20
  30. package/backend/integrations/builtin/streamloots/filters/card-name.d.ts +1 -1
  31. package/backend/integrations/builtin/streamloots/filters/chest-quantity.d.ts +1 -3
  32. package/backend/scripts/executors/script-executor.interface.d.ts +2 -1
  33. package/backend/scripts/script-api/namespaces/event-filter-factory.d.ts +2 -0
  34. package/backend/scripts/script-api/namespaces/variable-factory.d.ts +2 -0
  35. package/backend/scripts/script-manager.d.ts +1 -1
  36. package/backend/variables/variable-factory.d.ts +1 -2
  37. package/backend/webhooks/webhook-config-manager.d.ts +5 -6
  38. package/package.json +1 -1
  39. package/types/events.d.ts +4 -4
  40. package/types/plugins.d.ts +3 -2
  41. package/types/script-api.d.ts +20 -14
  42. package/types/variables.d.ts +10 -0
  43. package/types/webhooks.d.ts +12 -2
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const _default: (Omit<import("../../../../../types").EventFilter, "presetValues"> | (Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- }))[];
1
+ declare const _default: import("../../../../../types").EventFilter[];
4
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const _default: (Omit<import("../../../../types").EventFilter, "presetValues"> | (Omit<import("../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- }))[];
1
+ declare const _default: import("../../../../types").EventFilter[];
4
2
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const _default: (Omit<import("../../../../../types").EventFilter, "presetValues"> | (Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- }))[];
1
+ declare const _default: import("../../../../../types").EventFilter[];
4
2
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const _default: (Omit<import("../../../../../types").EventFilter, "presetValues"> | (Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- }))[];
1
+ declare const _default: import("../../../../../types").EventFilter[];
4
2
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export default filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export default filter;
@@ -1,28 +1,17 @@
1
- import { Awaitable, EventFilter, FilterSettings, PresetValue } from "../../../types";
2
- type EventData = {
3
- eventSourceId: string;
4
- eventId: string;
5
- eventMeta: Record<string, unknown>;
6
- };
7
- type FilterEvent = Omit<EventData, "eventMeta">;
8
- type FilterConfig = {
9
- id: string;
10
- name: string;
11
- description: string;
12
- events: Array<FilterEvent>;
1
+ import { Awaitable, EventData, EventFilter, FilterSettings, PresetValue } from "../../../types";
2
+ export type FilterConfig = Pick<EventFilter, "id" | "name" | "description" | "events"> & {
13
3
  eventMetaKey: string | ((eventData: EventData, filterSettings: FilterSettings) => string);
4
+ };
5
+ export type TextFilterConfig = FilterConfig & {
14
6
  caseInsensitive?: boolean;
15
7
  };
16
- type PresetFilterConfig = FilterConfig & {
8
+ export type PresetFilterConfig = FilterConfig & {
17
9
  presetValues: (...args: unknown[]) => Awaitable<PresetValue[]>;
18
10
  valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
19
11
  getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
20
12
  allowIsNot?: boolean;
21
13
  };
22
- export declare function createTextFilter({ eventMetaKey, caseInsensitive, ...config }: Omit<FilterConfig, "presetValues" | "allowIsNot">): Omit<EventFilter, "presetValues">;
23
- export declare function createNumberFilter({ eventMetaKey, ...config }: Omit<FilterConfig, "caseInsensitive" | "presetValues" | "allowIsNot">): Omit<EventFilter, "presetValues" | "valueType"> & {
24
- valueType: "number";
25
- };
26
- export declare function createTextOrNumberFilter({ eventMetaKey, caseInsensitive, ...config }: Omit<FilterConfig, "presetValues" | "allowIsNot">): Omit<EventFilter, "presetValues">;
27
- export declare function createPresetFilter({ eventMetaKey, presetValues, getSelectedValueDisplay, valueIsStillValid, allowIsNot, ...config }: Omit<PresetFilterConfig, "caseInsensitive">): EventFilter;
28
- export {};
14
+ export declare function createTextFilter({ eventMetaKey, caseInsensitive, ...config }: TextFilterConfig): EventFilter;
15
+ export declare function createNumberFilter({ eventMetaKey, ...config }: FilterConfig): EventFilter;
16
+ export declare function createTextOrNumberFilter({ eventMetaKey, caseInsensitive, ...config }: TextFilterConfig): EventFilter;
17
+ export declare function createPresetFilter({ eventMetaKey, presetValues, getSelectedValueDisplay, valueIsStillValid, allowIsNot, ...config }: PresetFilterConfig): EventFilter;
@@ -1,2 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues">;
1
+ declare const filter: import("../../../../../types").EventFilter;
2
2
  export = filter;
@@ -1,4 +1,2 @@
1
- declare const filter: Omit<import("../../../../../types").EventFilter, "presetValues" | "valueType"> & {
2
- valueType: "number";
3
- };
1
+ declare const filter: import("../../../../../types").EventFilter;
4
2
  export = filter;
@@ -1,4 +1,4 @@
1
- import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails } from "../../../types";
1
+ import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails, AdditionalVariableEvent } from "../../../types";
2
2
  import type { ScriptApiContext } from "../script-api";
3
3
  declare abstract class IBaseScriptExecutor {
4
4
  abstract canHandle(script: ScriptBase | LegacyCustomScript): Awaitable<boolean>;
@@ -7,6 +7,7 @@ declare abstract class IBaseScriptExecutor {
7
7
  export interface PluginRegistrations {
8
8
  effectIds?: string[];
9
9
  variableHandles?: string[];
10
+ additionalVariableEvents?: AdditionalVariableEvent[];
10
11
  eventSourceIds?: string[];
11
12
  filterIds?: string[];
12
13
  systemCommandIds?: string[];
@@ -0,0 +1,2 @@
1
+ import type { ScriptEventFilterFactoryApi } from "../../../../types/script-api";
2
+ export declare const createEventFilterFactoryApi: import("../internal/define-namespace").ScriptApiNamespaceFactory<ScriptEventFilterFactoryApi>;
@@ -0,0 +1,2 @@
1
+ import type { ScriptVariableFactoryApi } from "../../../../types/script-api";
2
+ export declare const createVariableFactoryApi: import("../internal/define-namespace").ScriptApiNamespaceFactory<ScriptVariableFactoryApi>;
@@ -32,7 +32,7 @@ declare class ScriptManager {
32
32
  * Handle a config change. Starts/stops as needed, and on a still-enabled plugin
33
33
  * either re-loads (if file may have changed) or invokes onParameterUpdate.
34
34
  */
35
- reloadPluginConfig(pluginConfig: InstalledPluginConfig): Promise<void>;
35
+ reloadPluginConfig(pluginConfig: InstalledPluginConfig, isNewInstall?: boolean): Promise<void>;
36
36
  setPluginEnabled(pluginId: string, enabled: boolean): Promise<void>;
37
37
  getInstalledPlugins(): Promise<InstalledPlugin[]>;
38
38
  /**
@@ -1,5 +1,5 @@
1
1
  import type { ReplaceVariable } from "../../types/variables";
2
- type VariableConfig = {
2
+ export type VariableConfig = {
3
3
  handle: string;
4
4
  description: string;
5
5
  events: string[];
@@ -9,4 +9,3 @@ type VariableConfig = {
9
9
  type: ReplaceVariable["definition"]["possibleDataOutput"][number] | ReplaceVariable["definition"]["possibleDataOutput"];
10
10
  };
11
11
  export declare function createEventDataVariable({ events, eventMetaKey, type, defaultValue, ...definition }: VariableConfig): ReplaceVariable;
12
- export {};
@@ -1,5 +1,4 @@
1
- import type { ScriptWebhook, WebhookConfig } from "../../types";
2
- import type { ScriptWebhookEventHandler } from "../../types/script-api";
1
+ import type { PluginWebhook, PluginWebhookEventHandler, WebhookConfig } from "../../types";
3
2
  import JsonDbManager from "../database/json-db-manager";
4
3
  type ExtraEvents = {
5
4
  "webhook-received": (data: {
@@ -15,12 +14,12 @@ declare class WebhookConfigManager extends JsonDbManager<WebhookConfig, ExtraEve
15
14
  getWebhookUrlById(webhookId: string): string;
16
15
  private toPublic;
17
16
  findPluginWebhookByName(pluginId: string, webhookName: string): WebhookConfig;
18
- getPluginWebhook(pluginId: string, webhookName: string): ScriptWebhook;
19
- getAllPluginWebhooks(pluginId: string): ScriptWebhook[];
20
- savePluginWebhook(pluginId: string, webhookName: string): ScriptWebhook;
17
+ getPluginWebhook(pluginId: string, webhookName: string): PluginWebhook;
18
+ getAllPluginWebhooks(pluginId: string): PluginWebhook[];
19
+ savePluginWebhook(pluginId: string, webhookName: string): PluginWebhook;
21
20
  deletePluginWebhook(pluginId: string, webhookName: string): boolean;
22
21
  getPluginWebhookUrl(pluginId: string, webhookName: string): string;
23
- registerPluginHandler(pluginId: string, handler: ScriptWebhookEventHandler): boolean;
22
+ registerPluginHandler(pluginId: string, handler: PluginWebhookEventHandler): boolean;
24
23
  unregisterPluginHandler(pluginId: string): boolean;
25
24
  }
26
25
  declare const webhookConfigManager: WebhookConfigManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowbartools/firebot-types",
3
- "version": "5.67.0-alpha15",
3
+ "version": "5.67.0-alpha17",
4
4
  "description": "Type definitions and script API for Firebot plugins and custom scripts.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/types/events.d.ts CHANGED
@@ -22,20 +22,20 @@ export type EventSource = {
22
22
  events: EventDefinition[];
23
23
  };
24
24
  export type PresetValue = {
25
- value: any;
25
+ value: unknown;
26
26
  display: string;
27
27
  };
28
28
  export type FilterSettings = {
29
29
  type: string;
30
30
  comparisonType: ComparisonType;
31
- value: any;
31
+ value: unknown;
32
32
  };
33
33
  export type EventSourceAndId = {
34
34
  eventSourceId: string;
35
35
  eventId: string;
36
36
  };
37
37
  export type EventData = EventSourceAndId & {
38
- eventMeta: Record<string, any>;
38
+ eventMeta: Record<string, unknown>;
39
39
  };
40
40
  export type EventFilter = {
41
41
  id: string;
@@ -43,7 +43,7 @@ export type EventFilter = {
43
43
  description: string;
44
44
  events: EventSourceAndId[];
45
45
  comparisonTypes: string[];
46
- valueType: "text" | "preset";
46
+ valueType: "text" | "number" | "preset";
47
47
  presetValues?(...args: unknown[]): Awaitable<PresetValue[]>;
48
48
  valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
49
49
  getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
@@ -1,7 +1,7 @@
1
1
  import type { EffectInstance, EffectList, EffectType } from "./effects";
2
2
  import type { Trigger } from "./triggers";
3
3
  import type { Awaitable } from "./util-types";
4
- import type { ReplaceVariable } from "./variables";
4
+ import type { PluginAdditonalVariableEvents, ReplaceVariable } from "./variables";
5
5
  import type { EventFilter, EventSource } from "./events";
6
6
  import type { SystemCommand } from "./commands";
7
7
  import type { RestrictionType } from "./restrictions";
@@ -119,6 +119,7 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
119
119
  effects?: DynamicArray<EffectType<any, any>>;
120
120
  eventSources?: DynamicArray<EventSource>;
121
121
  variables?: DynamicArray<ReplaceVariable>;
122
+ additionalVariableEvents?: DynamicArray<PluginAdditonalVariableEvents>;
122
123
  integrations?: DynamicArray<Integration<any>>;
123
124
  filters?: DynamicArray<EventFilter>;
124
125
  restrictions?: DynamicArray<RestrictionType<any>>;
@@ -203,4 +204,4 @@ export type LegacyCustomScript = {
203
204
  stop?: () => Awaitable<void>;
204
205
  };
205
206
  export type FirebotScriptApi = import("./script-api").FirebotScriptApi;
206
- export type { ScriptLoggerApi, ScriptWebhooksApi, ScriptWebhook, ScriptWebhookEvent } from "./script-api";
207
+ export type { ScriptLoggerApi, ScriptWebhooksApi } from "./script-api";
@@ -1,10 +1,14 @@
1
- import type { TriggeredEvent } from "./events";
1
+ import type { EventFilter, TriggeredEvent } from "./events";
2
2
  import type { RunEffectsContext } from "./effects";
3
3
  import type { TwitchApi } from "../backend/streaming-platforms/twitch/api";
4
4
  import type { Notification } from "./notifications";
5
5
  import type { FirebotAccount } from "./accounts";
6
6
  import type { FirebotSettingsTypes } from "./settings";
7
7
  import type { InstalledPlugin } from "./plugins";
8
+ import type { PluginWebhook } from "./webhooks";
9
+ import { ReplaceVariable } from "./variables";
10
+ import type { VariableConfig } from "../backend/variables/variable-factory";
11
+ import type { FilterConfig, PresetFilterConfig, TextFilterConfig } from "../backend/events/filters/filter-factory";
8
12
  export type ScriptLogMethod = (message: string, ...meta: unknown[]) => void;
9
13
  export interface ScriptLoggerApi {
10
14
  debug: ScriptLogMethod;
@@ -12,22 +16,11 @@ export interface ScriptLoggerApi {
12
16
  warn: ScriptLogMethod;
13
17
  error: ScriptLogMethod;
14
18
  }
15
- export interface ScriptWebhook {
16
- id: string;
17
- name: string;
18
- }
19
- export interface ScriptWebhookEvent {
20
- webhook: ScriptWebhook;
21
- payload: unknown;
22
- rawPayload?: string;
23
- headers: Record<string, string>;
24
- }
25
- export type ScriptWebhookEventHandler = (event: ScriptWebhookEvent) => void;
26
19
  export interface ScriptWebhooksApi {
27
20
  /** Look up a webhook by name. */
28
- get(name: string): ScriptWebhook | null;
21
+ get(name: string): PluginWebhook | null;
29
22
  /** All webhooks owned by this script. */
30
- list(): ScriptWebhook[];
23
+ list(): PluginWebhook[];
31
24
  /** Public URL for a webhook by name, or null if not found. */
32
25
  getUrl(name: string): string | null;
33
26
  }
@@ -158,6 +151,15 @@ export interface ScriptWebServerApi {
158
151
  */
159
152
  sendWebSocketEvent(name: string, data?: unknown): any;
160
153
  }
154
+ export interface ScriptVariableFactoryApi {
155
+ createEventDataVariable(config: VariableConfig): ReplaceVariable;
156
+ }
157
+ export interface ScriptEventFilterFactoryApi {
158
+ createTextFilter(config: TextFilterConfig): EventFilter;
159
+ createNumberFilter(config: FilterConfig): EventFilter;
160
+ createTextOrNumberFilter(config: TextFilterConfig): EventFilter;
161
+ createPresetFilter(config: PresetFilterConfig): EventFilter;
162
+ }
161
163
  export interface FirebotScriptApi {
162
164
  /** Running Firebot version, e.g. `"5.67.0"`. */
163
165
  version: string;
@@ -187,4 +189,8 @@ export interface FirebotScriptApi {
187
189
  plugins: ScriptPluginsApi;
188
190
  /** Firebot internal web server functions. */
189
191
  webServer: ScriptWebServerApi;
192
+ /** Factory for creating variables based on event data. */
193
+ variableFactory: ScriptVariableFactoryApi;
194
+ /** Factory for creating event filters. */
195
+ eventFilterFactory: ScriptEventFilterFactoryApi;
190
196
  }
@@ -1,3 +1,4 @@
1
+ import type { EventSourceAndId } from "./events";
1
2
  import type { Trigger, TriggersObject, TriggerType, TriggerMeta } from "./triggers";
2
3
  import type { Awaitable } from "./util-types";
3
4
  export { Trigger, TriggersObject, TriggerType, TriggerMeta };
@@ -43,3 +44,12 @@ export type RegisteredVariable = {
43
44
  evaluator(trigger: Trigger, ...args: unknown[]): Awaitable<unknown>;
44
45
  getSuggestions: (triggerType: TriggerType, triggerMeta?: TriggerMeta) => Awaitable<VariableUsage[]>;
45
46
  };
47
+ export type AdditionalVariableEvent = {
48
+ handle: string;
49
+ eventSourceId: string;
50
+ eventId: string;
51
+ };
52
+ export type PluginAdditonalVariableEvents = {
53
+ handle: string;
54
+ events: Array<EventSourceAndId>;
55
+ };
@@ -1,10 +1,20 @@
1
- import type { ScriptWebhookEventHandler } from "./script-api";
2
1
  export type WebhookConfig = {
3
2
  id: string;
4
3
  name: string;
5
4
  scriptId?: string;
6
5
  };
6
+ export interface PluginWebhook {
7
+ id: string;
8
+ name: string;
9
+ }
10
+ export interface PluginWebhookEvent {
11
+ webhook: PluginWebhook;
12
+ payload: unknown;
13
+ rawPayload?: string;
14
+ headers: Record<string, string>;
15
+ }
16
+ export type PluginWebhookEventHandler = (event: PluginWebhookEvent) => void;
7
17
  export type PluginWebhooks = {
8
18
  webhookNames: string[];
9
- handler: ScriptWebhookEventHandler;
19
+ handler: PluginWebhookEventHandler;
10
20
  };