@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,27 +1,12 @@
1
1
  import ng from "angular";
2
2
  import type { TriggerType, TriggersObject, Trigger } from "./triggers";
3
3
  import type { Awaitable } from "./util-types";
4
-
5
4
  type Func<T> = (...args: unknown[]) => T;
6
-
7
- interface EffectScope<EffectModel> extends ng.IScope {
5
+ export interface EffectScope<EffectModel> extends ng.IScope {
8
6
  effect: EffectModel;
9
7
  [x: string]: any;
10
8
  }
11
-
12
- export type EffectCategory =
13
- | "common"
14
- | "twitch"
15
- | "moderation"
16
- | "chat based"
17
- | "dashboard"
18
- | "overlay"
19
- | "fun"
20
- | "integrations"
21
- | "firebot control"
22
- | "advanced"
23
- | "scripting";
24
-
9
+ export type EffectCategory = "common" | "twitch" | "moderation" | "chat based" | "dashboard" | "overlay" | "fun" | "integrations" | "firebot control" | "advanced" | "scripting";
25
10
  export type EffectTriggerResponse = {
26
11
  success: boolean;
27
12
  execution?: {
@@ -32,35 +17,33 @@ export type EffectTriggerResponse = {
32
17
  [x: string]: unknown;
33
18
  };
34
19
  };
35
-
36
20
  export type EffectOutput = {
37
21
  label: string;
38
22
  description: string;
39
23
  defaultName: string;
40
24
  };
41
-
42
25
  export type EffectDependencies = {
43
26
  twitch?: boolean;
44
27
  integrations?: Record<string, boolean>;
45
28
  };
46
-
47
29
  export type OverlayExtension<OverlayData = unknown> = {
48
30
  dependencies?: {
49
31
  globalStyles?: string;
50
32
  css?: string[];
51
- js?: Array<string | { module: boolean, url: string }>;
33
+ js?: Array<string | {
34
+ module: boolean;
35
+ url: string;
36
+ }>;
52
37
  };
53
38
  event: {
54
39
  name: string;
55
40
  onOverlayEvent: (data: OverlayData) => void;
56
41
  };
57
42
  };
58
-
59
43
  export type OverlayDimensions = {
60
44
  width: number;
61
45
  height: number;
62
46
  };
63
-
64
47
  export type OverlayPosition = {
65
48
  position: string;
66
49
  customCoords?: {
@@ -71,29 +54,23 @@ export type OverlayPosition = {
71
54
  };
72
55
  zIndex?: number;
73
56
  };
74
-
75
57
  export type OverlayRotation = {
76
58
  rotation: number;
77
59
  rotType: "deg" | "rad" | "turn";
78
60
  };
79
-
80
61
  export type OverlayEnterExitAnimations = {
81
62
  enterAnimation: string;
82
63
  enterDuration: number;
83
-
84
64
  inbetweenAnimation: string;
85
65
  inbetweenDuration: number;
86
66
  inbetweenDelay: number;
87
67
  inbetweenRepeat: number;
88
-
89
68
  exitAnimation: string;
90
69
  exitDuration: number;
91
70
  };
92
-
93
71
  export type OverlayInstance = {
94
72
  overlayInstance: string;
95
73
  };
96
-
97
74
  export type EffectDefinition<EffectModel = unknown> = {
98
75
  id: string;
99
76
  name: string;
@@ -125,7 +102,6 @@ export type EffectDefinition<EffectModel = unknown> = {
125
102
  */
126
103
  isNoOp?: boolean;
127
104
  };
128
-
129
105
  export type EffectInstance<EffectModel = unknown> = {
130
106
  id: string;
131
107
  type: string;
@@ -141,7 +117,6 @@ export type EffectInstance<EffectModel = unknown> = {
141
117
  } & {
142
118
  [x: string]: unknown;
143
119
  };
144
-
145
120
  export type EffectType<EffectModel = unknown, OverlayData = unknown> = {
146
121
  definition: EffectDefinition<EffectModel>;
147
122
  optionsTemplate: string;
@@ -158,9 +133,7 @@ export type EffectType<EffectModel = unknown, OverlayData = unknown> = {
158
133
  }) => Awaitable<void | boolean | EffectTriggerResponse>;
159
134
  overlayExtension?: OverlayExtension<OverlayData>;
160
135
  };
161
-
162
136
  export type EffectListRunMode = "all" | "random" | "sequential";
163
-
164
137
  export interface EffectList {
165
138
  id: string;
166
139
  list: EffectInstance[];
@@ -171,7 +144,6 @@ export interface EffectList {
171
144
  weighted?: boolean;
172
145
  dontRepeatUntilAllUsed?: boolean;
173
146
  }
174
-
175
147
  export type PresetEffectList = {
176
148
  id: string;
177
149
  name: string;
@@ -181,9 +153,7 @@ export type PresetEffectList = {
181
153
  effects: EffectList;
182
154
  sortTags: string[];
183
155
  };
184
-
185
156
  type QueueMode = "auto" | "interval" | "custom" | "manual";
186
-
187
157
  export type EffectQueueConfig = {
188
158
  id: string;
189
159
  name: string;
@@ -195,9 +165,7 @@ export type EffectQueueConfig = {
195
165
  length: number;
196
166
  queue: any[];
197
167
  };
198
-
199
168
  export type QueueStatus = "running" | "paused" | "idle" | "canceled";
200
-
201
169
  export type RunEffectsContext = {
202
170
  trigger: Trigger;
203
171
  effects: EffectList;
@@ -206,13 +174,11 @@ export type RunEffectsContext = {
206
174
  };
207
175
  [key: string]: unknown;
208
176
  };
209
-
210
- type QueueItem = {
177
+ export type QueueItem = {
211
178
  runEffectsContext: RunEffectsContext;
212
179
  duration?: number;
213
180
  priority?: "none" | "high";
214
181
  };
215
-
216
182
  export type QueueState = {
217
183
  status: QueueStatus;
218
184
  queuedItems: QueueItem[];
@@ -220,4 +186,5 @@ export type QueueState = {
220
186
  interval: number;
221
187
  mode: QueueMode;
222
188
  runEffectsImmediatelyWhenPaused?: boolean;
223
- };
189
+ };
190
+ export {};
package/types/events.d.ts CHANGED
@@ -1,26 +1,6 @@
1
1
  import type { EffectList } from "./effects";
2
2
  import type { Awaitable } from "./util-types";
3
-
4
- export type ComparisonType =
5
- | "is"
6
- | "is not"
7
- | "greater than"
8
- | "greater than or equal to"
9
- | "less than"
10
- | "less than or equal to"
11
- | "include"
12
- | "doesn't include"
13
- | "contains"
14
- | "doesn't contain"
15
- | "doesn't start with"
16
- | "starts with"
17
- | "doesn't end with"
18
- | "ends with"
19
- | "matches regex"
20
- | "doesn't matches regex"
21
- | "matches regex (case insensitive)"
22
- | "doesn't match regex (case insensitive)";
23
-
3
+ export type ComparisonType = "is" | "is not" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "include" | "doesn't include" | "contains" | "doesn't contain" | "doesn't start with" | "starts with" | "doesn't end with" | "ends with" | "matches regex" | "doesn't matches regex" | "matches regex (case insensitive)" | "doesn't match regex (case insensitive)";
24
4
  export type EventDefinition = {
25
5
  id: string;
26
6
  name: string;
@@ -35,34 +15,28 @@ export type EventDefinition = {
35
15
  excludeFromChatFeed?: boolean;
36
16
  };
37
17
  };
38
-
39
18
  export type EventSource = {
40
19
  id: string;
41
20
  name: string;
42
21
  description?: string;
43
22
  events: EventDefinition[];
44
23
  };
45
-
46
24
  export type PresetValue = {
47
25
  value: any;
48
26
  display: string;
49
27
  };
50
-
51
28
  export type FilterSettings = {
52
29
  type: string;
53
30
  comparisonType: ComparisonType;
54
31
  value: any;
55
32
  };
56
-
57
33
  export type EventSourceAndId = {
58
34
  eventSourceId: string;
59
35
  eventId: string;
60
36
  };
61
-
62
37
  export type EventData = EventSourceAndId & {
63
38
  eventMeta: Record<string, any>;
64
39
  };
65
-
66
40
  export type EventFilter = {
67
41
  id: string;
68
42
  name: string;
@@ -73,17 +47,12 @@ export type EventFilter = {
73
47
  presetValues?(...args: unknown[]): Awaitable<PresetValue[]>;
74
48
  valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
75
49
  getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
76
- predicate(
77
- filterSettings: FilterSettings,
78
- eventData: EventData
79
- ): Awaitable<boolean>;
50
+ predicate(filterSettings: FilterSettings, eventData: EventData): Awaitable<boolean>;
80
51
  };
81
-
82
52
  export type EventFilterData = {
83
53
  mode: "inclusive" | "exclusive";
84
54
  filters: FilterSettings[];
85
55
  };
86
-
87
56
  export type EventSettings = {
88
57
  id: string;
89
58
  type: string;
@@ -93,17 +62,15 @@ export type EventSettings = {
93
62
  effects: EffectList;
94
63
  [x: string]: unknown;
95
64
  };
96
-
97
65
  export type EventGroup = {
98
66
  id: string;
99
67
  events: EventSettings[];
100
68
  active?: boolean;
101
69
  };
102
-
103
70
  export type TriggeredEvent = {
104
71
  event: EventDefinition;
105
72
  source: EventSource;
106
73
  meta: Record<string, unknown>;
107
74
  isManual: boolean;
108
75
  isRetrigger: boolean;
109
- };
76
+ };
@@ -1,11 +1,9 @@
1
1
  type ExpressionishBaseToken = {
2
2
  type: "TEXT" | "VARIABLE" | "LOOKUP" | "IF" | "LOGICAL" | "CONDITION" | "UNKNOWN";
3
-
4
3
  /**
5
4
  * Rough character position of the token within the input string
6
5
  */
7
6
  position: number;
8
-
9
7
  /**
10
8
  * Depends on token type.
11
9
  *
@@ -16,59 +14,41 @@ type ExpressionishBaseToken = {
16
14
  * `CONDITION` or `LOGICAL`: operator
17
15
  */
18
16
  value: string;
19
-
20
17
  };
21
-
22
18
  type ExpressionishTokenWithArguments = {
23
19
  /**
24
20
  * Arguments to resolve then pass to calling registered handler
25
21
  */
26
22
  arguments: Array<ExpressionishToken>;
27
23
  };
28
-
29
24
  type ExpressionishTextToken = ExpressionishBaseToken & {
30
25
  type: "TEXT";
31
26
  };
32
-
33
27
  type ExpressionishLookupToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
34
28
  type: "LOOKUP";
35
-
36
29
  /**
37
30
  * Lookup prefix
38
31
  */
39
32
  prefix: string;
40
33
  };
41
-
42
34
  type ExpressionishVariableToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
43
35
  type: "VARIABLE";
44
36
  };
45
-
46
37
  type ExpressionishComparisonToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
47
38
  type: "CONDITION";
48
39
  };
49
-
50
40
  type ExpressionishLogicToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
51
41
  type: "LOGICAL";
52
42
  };
53
-
54
43
  type ExpressionishIfToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
55
44
  type: "IF";
56
-
57
45
  /**
58
46
  * Condition used for evaluation
59
47
  */
60
48
  condition: ExpressionishLogicToken | ExpressionishComparisonToken;
61
49
  };
62
-
63
50
  type ExpressionishUnknownToken = ExpressionishBaseToken & {
64
51
  type: "UNKNOWN";
65
52
  };
66
-
67
- export type ExpressionishToken =
68
- | ExpressionishTextToken
69
- | ExpressionishLookupToken
70
- | ExpressionishVariableToken
71
- | ExpressionishComparisonToken
72
- | ExpressionishLogicToken
73
- | ExpressionishIfToken
74
- | ExpressionishUnknownToken;
53
+ export type ExpressionishToken = ExpressionishTextToken | ExpressionishLookupToken | ExpressionishVariableToken | ExpressionishComparisonToken | ExpressionishLogicToken | ExpressionishIfToken | ExpressionishUnknownToken;
54
+ export {};
package/types/games.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import type { FirebotParamCategory } from "./parameters";
2
-
3
2
  export type GameSettings = {
4
3
  active: boolean;
5
4
  settings?: Record<string, Record<string, unknown>>;
6
5
  };
7
-
8
6
  export type GameDefinition = {
9
7
  id: string;
10
8
  name: string;
@@ -14,9 +12,8 @@ export type GameDefinition = {
14
12
  active?: boolean;
15
13
  settingCategories: Record<string, FirebotParamCategory<Record<string, unknown>>>;
16
14
  };
17
-
18
15
  export type FirebotGame = GameDefinition & {
19
16
  onLoad: (settings: GameSettings) => void;
20
17
  onUnload: (settings: GameSettings) => void;
21
18
  onSettingsUpdate: (settings: GameSettings) => void;
22
- };
19
+ };
@@ -1,12 +1,10 @@
1
1
  import type { EffectList } from "./effects";
2
-
3
2
  export type FirebotHotkey = {
4
3
  id: string;
5
4
  name: string;
6
5
  active: boolean;
7
- // Electron accelerator string (see https://www.electronjs.org/docs/latest/api/accelerator)
8
6
  code: string;
9
7
  warning: string;
10
8
  effects: EffectList;
11
9
  sortTags: string[];
12
- };
10
+ };
@@ -1,23 +1,11 @@
1
1
  import type { Request, Response } from "express";
2
2
  import type { Awaitable } from "./util-types";
3
-
4
- export type HttpMethod =
5
- | "GET"
6
- | "POST"
7
- | "PUT"
8
- | "PATCH"
9
- | "DELETE"
10
- | "HEAD"
11
- | "CONNECT"
12
- | "OPTIONS"
13
- | "TRACE";
14
-
3
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE";
15
4
  export interface CustomHttpRoute {
16
5
  path: string;
17
6
  method: HttpMethod;
18
7
  handler: (req: Request, res: Response) => Awaitable<void>;
19
8
  }
20
-
21
9
  /**
22
10
  * Defines custom HTTP routes that plugins can add to the internal Firebot HTTP server.
23
11
  * Paths can contain multiple levels and parameters (e.g. `/item/:id`).
@@ -28,4 +16,4 @@ export interface CustomHttpRoute {
28
16
  export interface PluginHttpRouteDefinition {
29
17
  prefix: string;
30
18
  routes: Array<CustomHttpRoute>;
31
- }
19
+ }
package/types/icons.d.ts CHANGED
@@ -3,4 +3,4 @@ export type FontAwesomeIcon = {
3
3
  className: string;
4
4
  style: string;
5
5
  searchTerms: string[];
6
- };
6
+ };
package/types/import.d.ts CHANGED
@@ -1,69 +1,42 @@
1
1
  import type { Quote } from "./quotes";
2
2
  import type { FileFilter, Awaitable } from "./util-types";
3
-
4
3
  export interface LoadRequest {
5
4
  appId: string;
6
5
  filepath: string;
7
6
  }
8
-
9
7
  export interface LoadResult<T = unknown[]> {
10
8
  success: boolean;
11
9
  data?: T;
12
10
  error?: string;
13
11
  }
14
-
15
12
  export type ParsedQuotes = {
16
13
  quotes: Quote[];
17
14
  };
18
-
19
15
  export type ParsedViewers<V = unknown> = {
20
16
  viewers: V[];
21
17
  ranks: string[];
22
18
  };
23
-
24
19
  export interface ImportRequest<Data = unknown, Settings = unknown> {
25
20
  appId: string;
26
21
  data: Data;
27
22
  settings: Settings;
28
23
  }
29
-
30
24
  export interface ImportResult {
31
25
  success: boolean;
32
26
  error?: string;
33
27
  }
34
-
35
28
  type CustomImporterSettings = {
36
29
  quotes?: unknown;
37
30
  viewers?: unknown;
38
31
  };
39
-
40
- export type ThirdPartyImporter<
41
- Settings extends CustomImporterSettings = CustomImporterSettings,
42
- ViewerType = unknown
43
- > = {
32
+ export type ThirdPartyImporter<Settings extends CustomImporterSettings = CustomImporterSettings, ViewerType = unknown> = {
44
33
  id: string;
45
34
  appName: string;
46
35
  defaultSettings?: Settings;
47
36
  filetypes: FileFilter[];
48
-
49
- loadQuotes?: (
50
- filename: string,
51
- settings?: Settings["quotes"]
52
- ) => Awaitable<LoadResult<ParsedQuotes>>;
53
-
54
- importQuotes?: (
55
- quotes: Quote[],
56
- settings: Settings["quotes"]
57
- ) => Awaitable<ImportResult>;
58
-
59
- loadViewers?: (
60
- filename: string,
61
- settings?: Settings["viewers"]
62
- ) => Awaitable<LoadResult<ParsedViewers>>;
63
-
64
- importViewers?: (
65
- viewers: ViewerType[],
66
- settings: Settings["viewers"],
67
- abortSignal: AbortSignal
68
- ) => Awaitable<ImportResult>;
69
- };
37
+ loadQuotes?: (filename: string, settings?: Settings["quotes"]) => Awaitable<LoadResult<ParsedQuotes>>;
38
+ importQuotes?: (quotes: Quote[], settings: Settings["quotes"]) => Awaitable<ImportResult>;
39
+ loadViewers?: (filename: string, settings?: Settings["viewers"]) => Awaitable<LoadResult<ParsedViewers>>;
40
+ importViewers?: (viewers: ViewerType[], settings: Settings["viewers"], abortSignal: AbortSignal) => Awaitable<ImportResult>;
41
+ };
42
+ export {};
package/types/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export * from "./variable-macros";
41
41
  export * from "./variables";
42
42
  export * from "./viewers";
43
43
  export * from "./webhooks";
44
- export * from "./websocket";
44
+ export * from "./websocket";
@@ -1,93 +1,69 @@
1
- import type {
2
- FirebotParameterCategories,
3
- FirebotParams
4
- } from "./parameters";
1
+ import type { FirebotParameterCategories } from "./parameters";
5
2
  import type { Awaitable, ObjectOfUnknowns } from "./util-types";
6
-
7
- export type Integration<Params extends FirebotParams = FirebotParams> = {
3
+ export type IntegrationParams = Record<string, Record<string, unknown>>;
4
+ export type Integration<Params extends IntegrationParams = IntegrationParams> = {
8
5
  definition: IntegrationDefinition<Params>;
9
6
  integration: IntegrationController<Params>;
10
7
  };
11
-
12
- export type IntegrationDefinition<
13
- Params extends FirebotParams = FirebotParams
14
- > = {
8
+ export type IntegrationDefinition<Params extends IntegrationParams = IntegrationParams> = {
15
9
  id: string;
16
10
  name: string;
17
11
  description: string;
18
12
  connectionToggle?: boolean;
19
13
  configurable?: boolean;
20
14
  settingCategories: FirebotParameterCategories<Params>;
21
- } & (
22
- | {
23
- linkType: "id";
24
- idDetails: {
25
- steps: string;
26
- };
27
- }
28
- | {
29
- linkType: "auth";
30
- authProviderDetails: {
15
+ } & ({
16
+ linkType: "id";
17
+ idDetails: {
18
+ steps: string;
19
+ };
20
+ } | {
21
+ linkType: "auth";
22
+ authProviderDetails: {
23
+ id: string;
24
+ name: string;
25
+ redirectUriHost?: string;
26
+ client: {
31
27
  id: string;
32
- name: string;
33
- redirectUriHost?: string;
34
- client: {
35
- id: string;
36
- secret: string;
37
- };
38
- auth: {
39
- tokenHost: string;
40
- tokenPath: string;
41
- authorizePath: string;
42
- };
43
- autoRefreshToken?: boolean;
44
- scopes: string;
28
+ secret: string;
29
+ };
30
+ auth: {
31
+ tokenHost: string;
32
+ tokenPath: string;
33
+ authorizePath: string;
45
34
  };
46
- }
47
- | { linkType: "other" | "none" }
48
- );
49
-
35
+ autoRefreshToken?: boolean;
36
+ scopes: string;
37
+ };
38
+ } | {
39
+ linkType: "other" | "none";
40
+ });
50
41
  export interface IntegrationEvents {
51
42
  connected: (id: string) => void;
52
43
  disconnected: (id: string) => void;
53
44
  "settings-update": (id: string, settings: Record<string, any>) => void;
54
45
  }
55
-
56
- type LinkData =
57
- | {
58
- accountId: string;
59
- }
60
- | {
61
- auth: Record<string, unknown>;
62
- }
63
- | null;
64
-
65
- export type IntegrationData<Params extends FirebotParams = FirebotParams> = {
46
+ type LinkData = {
47
+ accountId: string;
48
+ } | {
49
+ auth: Record<string, unknown>;
50
+ } | null;
51
+ export type IntegrationData<Params extends IntegrationParams = IntegrationParams> = {
66
52
  settings: any;
67
53
  userSettings?: Params;
68
54
  oauth?: any;
69
55
  accountId?: string;
70
56
  };
71
-
72
- export interface IntegrationController<
73
- Params extends FirebotParams = FirebotParams
74
- > {
57
+ export interface IntegrationController<Params extends IntegrationParams = IntegrationParams> {
75
58
  connected: boolean;
76
- init(
77
- linked: boolean,
78
- integrationData: IntegrationData<Params>
79
- ): Awaitable<void>;
59
+ init(linked: boolean, integrationData: IntegrationData<Params>): Awaitable<void>;
80
60
  link?(linkData: LinkData): Awaitable<void>;
81
- connect?(
82
- integrationData: IntegrationData<Params>
83
- ): Awaitable<void>;
61
+ connect?(integrationData: IntegrationData<Params>): Awaitable<void>;
84
62
  disconnect?(): Awaitable<void>;
85
- onUserSettingsUpdate?(
86
- integrationData: IntegrationData<Params>
87
- ): Awaitable<void>;
63
+ onUserSettingsUpdate?(integrationData: IntegrationData<Params>): Awaitable<void>;
88
64
  }
89
-
90
- type IntegrationWithUnknowns = {
65
+ export type IntegrationWithUnknowns = {
91
66
  definition: IntegrationDefinition & ObjectOfUnknowns;
92
67
  integration: IntegrationController & ObjectOfUnknowns;
93
- };
68
+ };
69
+ export {};
@@ -2,38 +2,31 @@ export type ModerationTerm = {
2
2
  text: string;
3
3
  createdAt: number;
4
4
  };
5
-
6
5
  export type ModerationUser = {
7
6
  id: string;
8
7
  username: string;
9
8
  displayName: string;
10
9
  };
11
-
12
10
  export type AllowedUser = {
13
11
  id: string;
14
12
  username: string;
15
13
  displayName: string;
16
14
  createdAt: number;
17
15
  };
18
-
19
16
  export type BannedWords = {
20
17
  words: ModerationTerm[];
21
18
  };
22
-
23
19
  export type BannedRegularExpressions = {
24
20
  regularExpressions: ModerationTerm[];
25
21
  };
26
-
27
22
  export type AllowList = {
28
23
  urls: ModerationTerm[];
29
24
  users: AllowedUser[];
30
25
  };
31
-
32
26
  export type ModerationImportRequest = {
33
27
  filePath: string;
34
28
  delimiter: "newline" | "comma" | "space";
35
29
  };
36
-
37
30
  export type ChatModerationSettings = {
38
31
  bannedWordList: {
39
32
  enabled: boolean;
@@ -56,4 +49,4 @@ export type ChatModerationSettings = {
56
49
  outputMessage?: string;
57
50
  };
58
51
  exemptRoles: string[];
59
- };
52
+ };