@crowbartools/firebot-types 5.67.0-alpha12 → 5.67.0-alpha14

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 (86) hide show
  1. package/LICENSE +674 -674
  2. package/backend/events/filters/builtin/firebot/index.d.ts +1 -1
  3. package/backend/events/filters/builtin/firebot/new-currency-amount.d.ts +1 -1
  4. package/backend/events/filters/builtin/firebot/new-view-time.d.ts +1 -1
  5. package/backend/events/filters/builtin/firebot/previous-currency-amount.d.ts +1 -1
  6. package/backend/events/filters/builtin/firebot/previous-view-time.d.ts +1 -1
  7. package/backend/events/filters/builtin/index.d.ts +1 -1
  8. package/backend/events/filters/builtin/third-party/donation-amount.d.ts +1 -1
  9. package/backend/events/filters/builtin/third-party/index.d.ts +1 -1
  10. package/backend/events/filters/builtin/twitch/bits-badge-tier.d.ts +1 -1
  11. package/backend/events/filters/builtin/twitch/chat-mode-duration.d.ts +1 -1
  12. package/backend/events/filters/builtin/twitch/cheer-bits-amount.d.ts +1 -1
  13. package/backend/events/filters/builtin/twitch/gift-count.d.ts +1 -1
  14. package/backend/events/filters/builtin/twitch/gift-duration.d.ts +1 -1
  15. package/backend/events/filters/builtin/twitch/index.d.ts +1 -1
  16. package/backend/events/filters/builtin/twitch/lifetime-gift-count.d.ts +1 -1
  17. package/backend/events/filters/builtin/twitch/raid-viewer-count.d.ts +1 -1
  18. package/backend/events/filters/builtin/twitch/sub-months.d.ts +1 -1
  19. package/backend/events/filters/builtin/twitch/watch-streak-count.d.ts +1 -1
  20. package/backend/integrations/builtin/streamloots/filters/chest-quantity.d.ts +1 -1
  21. package/backend/overlay-widgets/overlay-widgets-manager.d.ts +1 -1
  22. package/backend/ranks/rank-ladder-helper.d.ts +1 -1
  23. package/backend/restrictions/builtin/index.d.ts +1 -1
  24. package/backend/scripts/executors/plugin-executor.d.ts +2 -1
  25. package/backend/scripts/executors/script-executor.interface.d.ts +2 -1
  26. package/backend/webhooks/webhook-config-manager.d.ts +12 -1
  27. package/index.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/types/accounts.d.ts +1 -2
  30. package/types/auth.d.ts +1 -10
  31. package/types/channel-rewards.d.ts +1 -5
  32. package/types/chat.d.ts +9 -31
  33. package/types/commands.d.ts +11 -31
  34. package/types/counters.d.ts +1 -2
  35. package/types/currency.d.ts +1 -3
  36. package/types/discord.d.ts +0 -1
  37. package/types/effects.d.ts +9 -42
  38. package/types/events.d.ts +3 -36
  39. package/types/expressionish.d.ts +2 -22
  40. package/types/games.d.ts +1 -4
  41. package/types/hotkeys.d.ts +1 -3
  42. package/types/http-server.d.ts +2 -14
  43. package/types/icons.d.ts +1 -1
  44. package/types/import.d.ts +7 -34
  45. package/types/index.d.ts +1 -1
  46. package/types/integrations.d.ts +41 -65
  47. package/types/moderation.d.ts +1 -8
  48. package/types/modules/event-manager.d.ts +2 -10
  49. package/types/modules/frontend-communicator.d.ts +5 -21
  50. package/types/modules/index.d.ts +1 -1
  51. package/types/notifications.d.ts +1 -6
  52. package/types/overlay-widgets.d.ts +11 -34
  53. package/types/parameters.d.ts +26 -182
  54. package/types/plugins.d.ts +20 -58
  55. package/types/power-ups.d.ts +0 -2
  56. package/types/pronouns.d.ts +1 -2
  57. package/types/quick-actions.d.ts +1 -3
  58. package/types/quotes.d.ts +1 -3
  59. package/types/ranks.d.ts +1 -2
  60. package/types/restrictions.d.ts +7 -24
  61. package/types/roles.d.ts +1 -3
  62. package/types/script-api.d.ts +5 -59
  63. package/types/settings.d.ts +7 -7
  64. package/types/setups.d.ts +2 -4
  65. package/types/sort-tags.d.ts +1 -1
  66. package/types/timers.d.ts +1 -5
  67. package/types/triggers.d.ts +12 -23
  68. package/types/ui/angular.d.ts +5 -26
  69. package/types/ui/effect-helper-service.d.ts +1 -2
  70. package/types/ui/effect-queues-service.d.ts +8 -4
  71. package/types/ui/firebot-root-scope.d.ts +0 -1
  72. package/types/ui/index.d.ts +1 -1
  73. package/types/ui/modal-factory.d.ts +5 -13
  74. package/types/ui/modal-service.d.ts +3 -2
  75. package/types/ui/ng-toast.d.ts +5 -1
  76. package/types/ui/object-copy-helper.d.ts +0 -1
  77. package/types/ui/platform-service.d.ts +1 -1
  78. package/types/ui/preset-effect-lists-service.d.ts +1 -6
  79. package/types/ui/settings-service.d.ts +0 -1
  80. package/types/ui-extensions.d.ts +9 -16
  81. package/types/util-types.d.ts +7 -33
  82. package/types/variable-macros.d.ts +1 -1
  83. package/types/variables.d.ts +5 -19
  84. package/types/viewers.d.ts +1 -3
  85. package/types/webhooks.d.ts +6 -1
  86. package/types/websocket.d.ts +8 -46
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import type { EffectInstance, EffectList, EffectType } from "./effects";
3
2
  import type { Trigger } from "./triggers";
4
3
  import type { Awaitable } from "./util-types";
@@ -13,11 +12,9 @@ import type { UIExtension } from "./ui-extensions";
13
12
  import type { OverlayWidgetType } from "./overlay-widgets";
14
13
  import type { PluginHttpRouteDefinition } from "./http-server";
15
14
  import type { CustomWebSocketHandler } from "./websocket";
16
-
15
+ import type { PluginWebhooks } from "./webhooks";
17
16
  type NoResult = Awaitable<void>;
18
-
19
17
  type GenericParameters = Record<string, unknown>;
20
-
21
18
  export type InstalledPluginConfig<Params extends GenericParameters = GenericParameters> = {
22
19
  id: string;
23
20
  fileName: string;
@@ -25,41 +22,31 @@ export type InstalledPluginConfig<Params extends GenericParameters = GenericPara
25
22
  legacyImport?: boolean;
26
23
  parameters: Params;
27
24
  };
28
-
29
25
  export type ScriptContext<Params extends FirebotParams = FirebotParams> = {
30
26
  trigger?: Trigger;
31
27
  parameters: Params;
32
28
  };
33
-
34
29
  type DynamicObject<T> = T | ((context: ScriptContext) => Awaitable<T>);
35
30
  type DynamicArray<T> = Array<T | ((context: ScriptContext) => Awaitable<T>)>;
36
-
37
31
  export type ScriptType = "script" | "plugin";
38
-
39
32
  interface ManifestDescription {
40
33
  short: string;
41
34
  long?: string;
42
35
  }
43
-
44
36
  interface ManifestFirebotVersion {
45
37
  major: number;
46
38
  minor?: number;
47
39
  patch?: number;
48
40
  }
49
-
50
41
  export interface Manifest {
51
42
  name: string;
52
43
  version: string;
53
44
  author: string;
54
45
  description: string | ManifestDescription;
55
-
56
- // keywords?: string[];
57
-
58
46
  /**
59
47
  * A link to the plugin's source code repository
60
48
  */
61
49
  repo?: string;
62
-
63
50
  /**
64
51
  * A link to the plugin's website
65
52
  * If the repo is on GitHub and the website is not specified, it will default to the GitHub repo URL.
@@ -70,10 +57,8 @@ export interface Manifest {
70
57
  * If the repo is on GitHub and support is not specified, it will default to the GitHub issues URL.
71
58
  */
72
59
  support?: string;
73
-
74
60
  minimumFirebotVersion?: ManifestFirebotVersion;
75
61
  maximumFirebotVersion?: ManifestFirebotVersion;
76
-
77
62
  /**
78
63
  * A FontAwesome icon name shown in the UI (eg. "fa-cogs").
79
64
  */
@@ -82,34 +67,26 @@ export interface Manifest {
82
67
  * A hex color code (eg. "#FF0000") used for the icon.
83
68
  */
84
69
  color?: string;
85
-
86
70
  /**
87
71
  * If true, the plugin will be initialized before parameters are shown to the user,
88
72
  * allowing the plugin to provide custom parameter types that can be used in its own parametersSchema.
89
73
  */
90
74
  initBeforeShowingParams?: boolean;
91
-
92
75
  type: ScriptType;
93
76
  }
94
-
95
77
  type EffectScriptResult = {
96
78
  success: boolean;
97
79
  errorMessage?: string;
98
80
  effects?: EffectList | Array<EffectInstance>;
99
81
  onEffectsDone?: () => Awaitable<void>;
100
82
  };
101
-
102
-
103
83
  export interface ScriptBase<Params extends FirebotParams = FirebotParams> {
104
84
  manifest: Manifest;
105
-
106
85
  parametersSchema?: FirebotParameterArray<Params>;
107
86
  }
108
-
109
87
  export interface EffectScript<Params extends FirebotParams = FirebotParams> extends ScriptBase<Params> {
110
88
  run: (context: ScriptContext<Params>) => Awaitable<void | EffectScriptResult>;
111
89
  }
112
-
113
90
  export interface Plugin<Params extends FirebotParams = FirebotParams> extends ScriptBase<Params> {
114
91
  /**
115
92
  * Automatically handles registration with appropriate managers for definitions
@@ -131,51 +108,42 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
131
108
  overlayWidgets?: DynamicArray<OverlayWidgetType<any, any>>;
132
109
  httpRoutes?: DynamicObject<PluginHttpRouteDefinition>;
133
110
  websocketListener?: DynamicObject<CustomWebSocketHandler>;
111
+ webhooks?: DynamicObject<PluginWebhooks>;
134
112
  };
135
-
136
113
  /** Called when the plugin is loaded */
137
114
  onLoad?: (context: ScriptContext<Params>, isInstalling?: boolean) => NoResult;
138
-
139
115
  /** Called when Firebot is closing or plugin is disabled / removed */
140
116
  onUnload?: (context: ScriptContext<Params>, isUninstalling?: boolean) => NoResult;
141
-
142
117
  /** Called when the user updates plugin-specific parameters */
143
118
  onParameterUpdate?: (context: ScriptContext<Params>) => NoResult;
144
119
  }
145
-
146
120
  export type ScriptDetails = Pick<ScriptBase, "manifest" | "parametersSchema">;
147
-
148
121
  export type InstalledPlugin = {
149
122
  config: InstalledPluginConfig;
150
123
  details: ScriptDetails;
151
124
  };
152
-
153
- /* Legacy types */
154
- type LegacyScriptParameters = Record<
155
- string,
156
- {
157
-
158
- type: any;
159
- title?: string;
160
- description?: string;
161
- secondaryDescription?: string;
162
- tip?: string;
163
- showBottomHr?: boolean;
164
- validation?: {
165
- required?: boolean;
166
- };
167
- value?: unknown;
168
- default?: unknown;
169
- }
170
- >;
171
-
125
+ type LegacyScriptParameters = Record<string, {
126
+ type: any;
127
+ title?: string;
128
+ description?: string;
129
+ secondaryDescription?: string;
130
+ tip?: string;
131
+ showBottomHr?: boolean;
132
+ validation?: {
133
+ required?: boolean;
134
+ };
135
+ value?: unknown;
136
+ default?: unknown;
137
+ }>;
172
138
  export type LegacyScriptReturnObject = {
173
139
  success: boolean;
174
140
  errorMessage?: string;
175
- effects: unknown[] | { id: string, list: unknown[] };
141
+ effects: unknown[] | {
142
+ id: string;
143
+ list: unknown[];
144
+ };
176
145
  callback?: VoidFunction;
177
146
  };
178
-
179
147
  type LegacyRunRequest = {
180
148
  parameters: Record<string, unknown>;
181
149
  modules: Record<string, unknown>;
@@ -191,7 +159,6 @@ type LegacyRunRequest = {
191
159
  };
192
160
  trigger: Trigger;
193
161
  };
194
-
195
162
  type LegacyCustomScriptManifest = {
196
163
  name: string;
197
164
  description: string;
@@ -202,23 +169,18 @@ type LegacyCustomScriptManifest = {
202
169
  initBeforeShowingParams?: boolean;
203
170
  firebotVersion?: "5";
204
171
  };
205
-
206
172
  export type LegacyScriptData = {
207
173
  id: string;
208
174
  name: string;
209
175
  scriptName: string;
210
176
  parameters: LegacyScriptParameters;
211
177
  };
212
-
213
178
  export type LegacyCustomScript = {
214
179
  getScriptManifest(): Awaitable<LegacyCustomScriptManifest>;
215
180
  getDefaultParameters?: () => LegacyScriptParameters;
216
- run(
217
- runRequest: LegacyRunRequest
218
- ): Awaitable<void | LegacyScriptReturnObject>;
181
+ run(runRequest: LegacyRunRequest): Awaitable<void | LegacyScriptReturnObject>;
219
182
  parametersUpdated?: (parameters: Record<string, unknown>) => Awaitable<void>;
220
183
  stop?: () => Awaitable<void>;
221
184
  };
222
-
223
185
  export type FirebotScriptApi = import("./script-api").FirebotScriptApi;
224
186
  export type { ScriptLoggerApi, ScriptWebhooksApi, ScriptWebhook, ScriptWebhookEvent } from "./script-api";
@@ -1,13 +1,11 @@
1
1
  import type { CustomPowerUp } from "../backend/streaming-platforms/twitch/api/resource/power-ups";
2
2
  import type { EffectList } from "./effects";
3
-
4
3
  export type SavedPowerUp = {
5
4
  id: string;
6
5
  twitchData: CustomPowerUp;
7
6
  effects?: EffectList;
8
7
  sortTags?: string[];
9
8
  };
10
-
11
9
  export type PowerUpRedemptionMetadata = {
12
10
  username: string;
13
11
  userId: string;
@@ -4,8 +4,7 @@ export type Pronoun = {
4
4
  object: string;
5
5
  singular: boolean;
6
6
  };
7
-
8
7
  export type UserPronoun = {
9
8
  primary: string;
10
9
  secondary?: string;
11
- };
10
+ };
@@ -1,6 +1,5 @@
1
1
  import type { EffectList } from "./effects";
2
2
  import type { Awaitable } from "./util-types";
3
-
4
3
  export type QuickActionDefinition = {
5
4
  id: string;
6
5
  name: string;
@@ -11,8 +10,7 @@ export type QuickActionDefinition = {
11
10
  promptForArgs?: boolean;
12
11
  effectList?: EffectList;
13
12
  };
14
-
15
13
  export type SystemQuickAction = {
16
14
  definition: QuickActionDefinition;
17
15
  onTriggerEvent(): Awaitable<void>;
18
- };
16
+ };
package/types/quotes.d.ts CHANGED
@@ -2,7 +2,6 @@ export type QuoteAutoid = {
2
2
  _id: "__autoid__";
3
3
  seq: number;
4
4
  };
5
-
6
5
  export type Quote = {
7
6
  _id?: number;
8
7
  createdAt?: string;
@@ -11,7 +10,6 @@ export type Quote = {
11
10
  originator: string;
12
11
  text: string;
13
12
  };
14
-
15
13
  export type FormattedQuote = Omit<Quote, "_id"> & {
16
14
  id: number;
17
- };
15
+ };
package/types/ranks.d.ts CHANGED
@@ -3,7 +3,6 @@ export type Rank = {
3
3
  name: string;
4
4
  value?: number;
5
5
  };
6
-
7
6
  export type RankLadder = {
8
7
  id: string;
9
8
  name: string;
@@ -20,4 +19,4 @@ export type RankLadder = {
20
19
  showBadgeInChat?: boolean;
21
20
  };
22
21
  ranks: Rank[];
23
- };
22
+ };
@@ -1,15 +1,13 @@
1
+ import type ng from "angular";
1
2
  import type { Trigger, TriggerType, TriggersObject } from "./triggers";
2
3
  import type { Awaitable } from "./util-types";
3
-
4
4
  interface RestrictionScope<RestrictionModel> extends ng.IScope {
5
5
  restriction: Restriction<RestrictionModel>;
6
6
  restrictionDefinition: RestrictionType<RestrictionModel>;
7
7
  restrictionMode: RestrictionMode;
8
8
  [x: string]: any;
9
9
  }
10
-
11
10
  export type RestrictionMode = "all" | "any" | "none";
12
-
13
11
  export type RestrictionType<RestrictionModel = unknown> = {
14
12
  definition: {
15
13
  id: string;
@@ -19,26 +17,11 @@ export type RestrictionType<RestrictionModel = unknown> = {
19
17
  };
20
18
  failedReasonWhenInverted?: string;
21
19
  optionsTemplate: string;
22
- optionsController?: (
23
- $scope: RestrictionScope<RestrictionModel>,
24
- ...args: any[]
25
- ) => void;
26
- optionsValueDisplay?: (
27
- restriction: RestrictionModel,
28
- ...args: any[]
29
- ) => string;
30
- predicate(
31
- triggerData: Trigger,
32
- restrictionData: RestrictionModel,
33
- inherited?: boolean
34
- ): Awaitable<boolean>;
35
- onSuccessful?: (
36
- triggerData: Trigger,
37
- restrictionData: RestrictionModel,
38
- inherited?: boolean
39
- ) => Awaitable<void>;
20
+ optionsController?: ($scope: RestrictionScope<RestrictionModel>, ...args: any[]) => void;
21
+ optionsValueDisplay?: (restriction: RestrictionModel, ...args: any[]) => string;
22
+ predicate(triggerData: Trigger, restrictionData: RestrictionModel, inherited?: boolean): Awaitable<boolean>;
23
+ onSuccessful?: (triggerData: Trigger, restrictionData: RestrictionModel, inherited?: boolean) => Awaitable<void>;
40
24
  };
41
-
42
25
  export type Restriction<RestrictionModel = unknown> = {
43
26
  id: string;
44
27
  type: string;
@@ -47,7 +30,6 @@ export type Restriction<RestrictionModel = unknown> = {
47
30
  } & {
48
31
  [x: string]: unknown;
49
32
  };
50
-
51
33
  export type RestrictionData = {
52
34
  /**
53
35
  * Sets the command to only trigger when all/any/none of the restrictions pass.
@@ -62,4 +44,5 @@ export type RestrictionData = {
62
44
  restrictions: Restriction[];
63
45
  sendAsReply?: boolean;
64
46
  invertCondition?: boolean;
65
- };
47
+ };
48
+ export {};
package/types/roles.d.ts CHANGED
@@ -2,7 +2,6 @@ export interface FirebotRole {
2
2
  id: string;
3
3
  name: string;
4
4
  }
5
-
6
5
  export type CustomRole = {
7
6
  id: string;
8
7
  name: string;
@@ -13,9 +12,8 @@ export type CustomRole = {
13
12
  }>;
14
13
  showBadgeInChat?: boolean;
15
14
  };
16
-
17
15
  export type LegacyCustomRole = {
18
16
  id: string;
19
17
  name: string;
20
18
  viewers: string[];
21
- };
19
+ };
@@ -1,9 +1,3 @@
1
- /// <reference types="node" />
2
-
3
- // Public contract types for the Firebot Script API.
4
- // Everything a custom script can touch via `require("@crowbartools/firebot-types")`
5
- // should be defined here
6
-
7
1
  import type { TriggeredEvent } from "./events";
8
2
  import type { RunEffectsContext } from "./effects";
9
3
  import type { TwitchApi } from "../backend/streaming-platforms/twitch/api";
@@ -11,47 +5,32 @@ import type { Notification } from "./notifications";
11
5
  import type { FirebotAccount } from "./accounts";
12
6
  import type { FirebotSettingsTypes } from "./settings";
13
7
  import type { InstalledPlugin } from "./plugins";
14
-
15
8
  export type ScriptLogMethod = (message: string, ...meta: unknown[]) => void;
16
-
17
9
  export interface ScriptLoggerApi {
18
10
  debug: ScriptLogMethod;
19
11
  info: ScriptLogMethod;
20
12
  warn: ScriptLogMethod;
21
13
  error: ScriptLogMethod;
22
14
  }
23
-
24
15
  export interface ScriptWebhook {
25
16
  id: string;
26
17
  name: string;
27
18
  }
28
-
29
19
  export interface ScriptWebhookEvent {
30
20
  webhook: ScriptWebhook;
31
21
  payload: unknown;
32
22
  rawPayload?: string;
33
23
  headers: Record<string, string>;
34
24
  }
35
-
36
25
  export type ScriptWebhookEventHandler = (event: ScriptWebhookEvent) => void;
37
-
38
26
  export interface ScriptWebhooksApi {
39
- /** Create a new webhook (or return the existing one with the same name). */
40
- save(name: string): ScriptWebhook | null;
41
27
  /** Look up a webhook by name. */
42
28
  get(name: string): ScriptWebhook | null;
43
- /** Delete a webhook by name. Returns true if one was removed. */
44
- delete(name: string): boolean;
45
29
  /** All webhooks owned by this script. */
46
30
  list(): ScriptWebhook[];
47
31
  /** Public URL for a webhook by name, or null if not found. */
48
32
  getUrl(name: string): string | null;
49
- /**
50
- * Subscribe to webhook events for this script. Returns an `unsubscribe` func
51
- */
52
- onReceived(handler: ScriptWebhookEventHandler): () => void;
53
33
  }
54
-
55
34
  /**
56
35
  * Simple per-script storage scoped to the script's data directory.
57
36
  * Provides helpers for storing/loading JSON values
@@ -60,7 +39,6 @@ export interface ScriptWebhooksApi {
60
39
  export interface ScriptStorageApi {
61
40
  /** Absolute path to this script's data directory. */
62
41
  readonly path: string;
63
-
64
42
  /** Save a value as JSON under the given key. The key becomes the filename with a `.json` extension. */
65
43
  setJson(key: string, value: unknown): Promise<void>;
66
44
  /**
@@ -70,7 +48,6 @@ export interface ScriptStorageApi {
70
48
  getJson<T = unknown>(key: string): Promise<T | null>;
71
49
  /** Delete the JSON value stored under the given key. No-op if missing. */
72
50
  deleteJson(key: string): Promise<void>;
73
-
74
51
  /** Check whether a file exists in the data directory. */
75
52
  fileExists(name: string): Promise<boolean>;
76
53
  /** Read a file's raw bytes. Returns `null` if it doesn't exist. */
@@ -82,36 +59,26 @@ export interface ScriptStorageApi {
82
59
  /** Delete a file. No-op if it doesn't exist. */
83
60
  deleteFile(name: string): Promise<void>;
84
61
  }
85
-
86
62
  export type ScriptEventHandler = (event: TriggeredEvent) => void;
87
-
88
63
  export interface ScriptEventsApi {
89
64
  /**
90
65
  * Subscribe to all Firebot events as they trigger. Returns an `unsubscribe`
91
66
  * function.
92
67
  */
93
68
  onTriggered(handler: ScriptEventHandler): () => void;
94
-
95
69
  /**
96
70
  * Manually trigger a Firebot event.
97
71
  */
98
- trigger(
99
- sourceId: string,
100
- eventId: string,
101
- meta?: Record<string, unknown>
102
- ): Promise<void>;
72
+ trigger(sourceId: string, eventId: string, meta?: Record<string, unknown>): Promise<void>;
103
73
  }
104
-
105
74
  export interface ScriptEffectsApi {
106
75
  /**
107
76
  * Register an existing effect to be available for an event.
108
77
  * Useful for surfacing built-in effects on script provided events.
109
78
  */
110
79
  addEventToEffect(effectId: string, eventSourceId: string, eventId: string): void;
111
-
112
80
  /** Reverse of `addEventToEffect`. */
113
81
  removeEventFromEffect(effectId: string, eventSourceId: string, eventId: string): void;
114
-
115
82
  /**
116
83
  * Run an effect list. Respects the list's run mode and effect queue, if any.
117
84
  * Resolves once the effects have been run (queued lists resolve
@@ -119,12 +86,10 @@ export interface ScriptEffectsApi {
119
86
  */
120
87
  processEffects(context: RunEffectsContext): Promise<unknown>;
121
88
  }
122
-
123
89
  export interface ScriptTwitchApi {
124
90
  /** The full Twitch API surface. See {@linkcode TwitchApi}. */
125
91
  api: typeof TwitchApi;
126
92
  }
127
-
128
93
  /**
129
94
  * Access to this plugin's saved parameter values (the settings configured by
130
95
  * the user)
@@ -132,7 +97,6 @@ export interface ScriptTwitchApi {
132
97
  export interface ScriptParametersApi {
133
98
  getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
134
99
  }
135
-
136
100
  export interface ScriptNotificationsApi {
137
101
  /**
138
102
  * Create a new notification. Pass `permanentlySave` as `true` to persist it
@@ -148,39 +112,25 @@ export interface ScriptNotificationsApi {
148
112
  /** Delete all of this script's notifications. */
149
113
  clearAll(): void;
150
114
  }
151
-
152
115
  export interface ScriptFrontendCommunicatorApi {
153
116
  /** Send a synchronous event to the frontend. */
154
117
  send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
155
-
156
118
  /**
157
119
  * Send an asynchronous event to the frontend and await the reply it sends
158
120
  * back.
159
121
  */
160
- fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(
161
- eventName: string,
162
- data?: ExpectedArg
163
- ): Promise<ReturnPayload>;
164
-
122
+ fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
165
123
  /**
166
124
  * Handle a synchronous event triggered by the frontend. Returns an
167
125
  * `unsubscribe` function.
168
126
  */
169
- on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
170
- eventName: string,
171
- callback: (...args: ExpectedArgs) => ReturnPayload
172
- ): () => void;
173
-
127
+ on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => ReturnPayload): () => void;
174
128
  /**
175
129
  * Handle an asynchronous event triggered by the frontend. Returns an
176
130
  * `unsubscribe` function.
177
131
  */
178
- onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
179
- eventName: string,
180
- callback: (...args: ExpectedArgs) => Promise<ReturnPayload>
181
- ): () => void;
132
+ onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => Promise<ReturnPayload>): () => void;
182
133
  }
183
-
184
134
  export interface ScriptSettingsApi {
185
135
  /**
186
136
  * Get a Firebot setting value or its default
@@ -190,28 +140,24 @@ export interface ScriptSettingsApi {
190
140
  */
191
141
  getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
192
142
  }
193
-
194
143
  export interface ScriptPluginsApi {
195
144
  /**
196
145
  * Get a list of currently installed plugins installed by the user
197
146
  */
198
147
  getInstalledPlugins(): Promise<Array<InstalledPlugin>>;
199
148
  }
200
-
201
149
  export interface Accounts {
202
150
  streamer: FirebotAccount;
203
151
  bot: FirebotAccount;
204
152
  }
205
-
206
153
  export interface ScriptWebServerApi {
207
154
  /**
208
155
  * Sends a custom event over the internal Firebot WebSocket server
209
156
  * @param name Name of the event to send. Full event name will be `custom-event:{name}`
210
157
  * @param data Any optional data you would like to send with the event
211
158
  */
212
- sendWebSocketEvent(name: string, data?: unknown);
159
+ sendWebSocketEvent(name: string, data?: unknown): any;
213
160
  }
214
-
215
161
  export interface FirebotScriptApi {
216
162
  /** Running Firebot version, e.g. `"5.67.0"`. */
217
163
  version: string;
@@ -1,22 +1,19 @@
1
- export enum FirebotAutoUpdateLevel {
1
+ export declare enum FirebotAutoUpdateLevel {
2
2
  Off = 0,
3
3
  Bugfix = 1,
4
4
  Feature = 2,
5
5
  MajorRelease = 3,
6
6
  Betas = 4
7
7
  }
8
-
9
8
  export type FirebotAudioDevice = {
10
9
  label: string;
11
10
  deviceId: string;
12
11
  };
13
-
14
12
  export type FirebotGlobalValue = {
15
13
  name: string;
16
14
  secret?: boolean;
17
15
  value: string;
18
16
  };
19
-
20
17
  export type FirebotSettingsTypes = {
21
18
  ActiveChatUserListTimeout: number;
22
19
  ActiveProfiles: string[];
@@ -51,7 +48,10 @@ export type FirebotSettingsTypes = {
51
48
  ChatShowFfzEmotes: boolean;
52
49
  ChatShowSevenTvEmotes: boolean;
53
50
  ChatShowSharedChatInfo: boolean;
54
- ChatTaggedNotificationSound: { name: string, path?: string | undefined };
51
+ ChatTaggedNotificationSound: {
52
+ name: string;
53
+ path?: string | undefined;
54
+ };
55
55
  ChatTaggedNotificationVolume: number;
56
56
  ChatTimestamps: boolean;
57
57
  ClearChatFeedMode: "never" | "onlyStreamer" | "always";
@@ -73,7 +73,7 @@ export type FirebotSettingsTypes = {
73
73
  EventSetSettings: Record<string, {
74
74
  position: number;
75
75
  }>;
76
- EventSettings: object; // Pretty sure this is no longer used
76
+ EventSettings: object;
77
77
  FirstTimeUse: boolean;
78
78
  ForceOverlayEffectsToContinueOnRefresh: boolean;
79
79
  GlobalValues: Array<FirebotGlobalValue>;
@@ -125,4 +125,4 @@ export type FirebotSettingsTypes = {
125
125
  WebServerPort: number;
126
126
  WhileLoopEnabled: boolean;
127
127
  WysiwygBackground: "black" | "white";
128
- };
128
+ };
package/types/setups.d.ts CHANGED
@@ -11,16 +11,13 @@ import type { CustomRole, LegacyCustomRole } from "./roles";
11
11
  import type { FirebotGlobalValue } from "./settings";
12
12
  import type { ScheduledTask, Timer } from "./timers";
13
13
  import type { VariableMacro } from "./variable-macros";
14
-
15
14
  export type SetupImportQuestion = {
16
15
  replaceToken: string;
17
16
  answer: string;
18
17
  };
19
-
20
18
  type FirebotSetupGlobalValue = FirebotGlobalValue & {
21
19
  id: string;
22
20
  };
23
-
24
21
  export type FirebotSetup = {
25
22
  name: string;
26
23
  description: string;
@@ -46,4 +43,5 @@ export type FirebotSetup = {
46
43
  overlayWidgetConfigs: OverlayWidgetConfig[];
47
44
  globalValues: FirebotSetupGlobalValue[];
48
45
  };
49
- };
46
+ };
47
+ export {};
@@ -1,4 +1,4 @@
1
1
  export interface SortTag {
2
2
  id: string;
3
3
  name: string;
4
- }
4
+ }
package/types/timers.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import type { DateTime } from "luxon";
2
-
3
2
  import type { EffectList } from "./effects";
4
-
5
3
  export type Timer = {
6
4
  id: string;
7
5
  name: string;
@@ -12,7 +10,6 @@ export type Timer = {
12
10
  effects: EffectList;
13
11
  sortTags: string[];
14
12
  };
15
-
16
13
  export type TimerIntervalTracker = {
17
14
  timerId: string;
18
15
  onlyWhenLive: boolean;
@@ -23,7 +20,6 @@ export type TimerIntervalTracker = {
23
20
  intervalId: number | NodeJS.Timeout;
24
21
  startedAt: DateTime;
25
22
  };
26
-
27
23
  export type ScheduledTask = {
28
24
  id: string;
29
25
  name: string;
@@ -33,4 +29,4 @@ export type ScheduledTask = {
33
29
  onlyWhenLive: boolean;
34
30
  effects: EffectList;
35
31
  sortTags: string[];
36
- };
32
+ };