@crowbartools/firebot-types 5.67.0-alpha11 → 5.67.0-alpha13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/events/filters/builtin/firebot/index.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/new-currency-amount.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/new-view-time.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/previous-currency-amount.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/previous-view-time.d.ts +1 -1
- package/backend/events/filters/builtin/index.d.ts +1 -1
- package/backend/events/filters/builtin/third-party/donation-amount.d.ts +1 -1
- package/backend/events/filters/builtin/third-party/index.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/bits-badge-tier.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/chat-mode-duration.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/cheer-bits-amount.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/gift-count.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/gift-duration.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/index.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/lifetime-gift-count.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/raid-viewer-count.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/sub-months.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/watch-streak-count.d.ts +1 -1
- package/backend/integrations/builtin/streamloots/filters/chest-quantity.d.ts +1 -1
- package/backend/overlay-widgets/overlay-widgets-manager.d.ts +1 -1
- package/backend/ranks/rank-ladder-helper.d.ts +1 -1
- package/backend/restrictions/builtin/index.d.ts +1 -1
- package/backend/scripts/script-api/namespaces/http-server.d.ts +2 -0
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/types/accounts.d.ts +1 -2
- package/types/auth.d.ts +1 -10
- package/types/channel-rewards.d.ts +1 -5
- package/types/chat.d.ts +9 -31
- package/types/commands.d.ts +11 -31
- package/types/counters.d.ts +1 -2
- package/types/currency.d.ts +1 -3
- package/types/discord.d.ts +0 -1
- package/types/effects.d.ts +9 -42
- package/types/events.d.ts +3 -36
- package/types/expressionish.d.ts +2 -22
- package/types/games.d.ts +1 -4
- package/types/hotkeys.d.ts +1 -3
- package/types/http-server.d.ts +2 -14
- package/types/icons.d.ts +1 -1
- package/types/import.d.ts +7 -34
- package/types/index.d.ts +1 -1
- package/types/integrations.d.ts +41 -65
- package/types/moderation.d.ts +1 -8
- package/types/modules/event-manager.d.ts +2 -10
- package/types/modules/frontend-communicator.d.ts +5 -21
- package/types/modules/index.d.ts +1 -1
- package/types/notifications.d.ts +1 -6
- package/types/overlay-widgets.d.ts +11 -34
- package/types/parameters.d.ts +26 -182
- package/types/plugins.d.ts +18 -58
- package/types/power-ups.d.ts +0 -2
- package/types/pronouns.d.ts +1 -2
- package/types/quick-actions.d.ts +1 -3
- package/types/quotes.d.ts +1 -3
- package/types/ranks.d.ts +1 -2
- package/types/restrictions.d.ts +7 -24
- package/types/roles.d.ts +1 -3
- package/types/script-api.d.ts +14 -49
- package/types/settings.d.ts +7 -7
- package/types/setups.d.ts +2 -4
- package/types/sort-tags.d.ts +1 -1
- package/types/timers.d.ts +1 -5
- package/types/triggers.d.ts +12 -23
- package/types/ui/angular.d.ts +5 -26
- package/types/ui/effect-helper-service.d.ts +1 -2
- package/types/ui/effect-queues-service.d.ts +8 -4
- package/types/ui/firebot-root-scope.d.ts +0 -1
- package/types/ui/index.d.ts +1 -1
- package/types/ui/modal-factory.d.ts +5 -13
- package/types/ui/modal-service.d.ts +3 -2
- package/types/ui/ng-toast.d.ts +5 -1
- package/types/ui/object-copy-helper.d.ts +0 -1
- package/types/ui/platform-service.d.ts +1 -1
- package/types/ui/preset-effect-lists-service.d.ts +1 -6
- package/types/ui/settings-service.d.ts +0 -1
- package/types/ui-extensions.d.ts +9 -16
- package/types/util-types.d.ts +7 -33
- package/types/variable-macros.d.ts +1 -1
- package/types/variables.d.ts +5 -19
- package/types/viewers.d.ts +1 -3
- package/types/webhooks.d.ts +1 -1
- package/types/websocket.d.ts +8 -46
package/types/plugins.d.ts
CHANGED
|
@@ -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,8 @@ 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
|
-
|
|
17
15
|
type NoResult = Awaitable<void>;
|
|
18
|
-
|
|
19
16
|
type GenericParameters = Record<string, unknown>;
|
|
20
|
-
|
|
21
17
|
export type InstalledPluginConfig<Params extends GenericParameters = GenericParameters> = {
|
|
22
18
|
id: string;
|
|
23
19
|
fileName: string;
|
|
@@ -25,41 +21,31 @@ export type InstalledPluginConfig<Params extends GenericParameters = GenericPara
|
|
|
25
21
|
legacyImport?: boolean;
|
|
26
22
|
parameters: Params;
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
export type ScriptContext<Params extends FirebotParams = FirebotParams> = {
|
|
30
25
|
trigger?: Trigger;
|
|
31
26
|
parameters: Params;
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
type DynamicObject<T> = T | ((context: ScriptContext) => Awaitable<T>);
|
|
35
29
|
type DynamicArray<T> = Array<T | ((context: ScriptContext) => Awaitable<T>)>;
|
|
36
|
-
|
|
37
30
|
export type ScriptType = "script" | "plugin";
|
|
38
|
-
|
|
39
31
|
interface ManifestDescription {
|
|
40
32
|
short: string;
|
|
41
33
|
long?: string;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
35
|
interface ManifestFirebotVersion {
|
|
45
36
|
major: number;
|
|
46
37
|
minor?: number;
|
|
47
38
|
patch?: number;
|
|
48
39
|
}
|
|
49
|
-
|
|
50
40
|
export interface Manifest {
|
|
51
41
|
name: string;
|
|
52
42
|
version: string;
|
|
53
43
|
author: string;
|
|
54
44
|
description: string | ManifestDescription;
|
|
55
|
-
|
|
56
|
-
// keywords?: string[];
|
|
57
|
-
|
|
58
45
|
/**
|
|
59
46
|
* A link to the plugin's source code repository
|
|
60
47
|
*/
|
|
61
48
|
repo?: string;
|
|
62
|
-
|
|
63
49
|
/**
|
|
64
50
|
* A link to the plugin's website
|
|
65
51
|
* If the repo is on GitHub and the website is not specified, it will default to the GitHub repo URL.
|
|
@@ -70,10 +56,8 @@ export interface Manifest {
|
|
|
70
56
|
* If the repo is on GitHub and support is not specified, it will default to the GitHub issues URL.
|
|
71
57
|
*/
|
|
72
58
|
support?: string;
|
|
73
|
-
|
|
74
59
|
minimumFirebotVersion?: ManifestFirebotVersion;
|
|
75
60
|
maximumFirebotVersion?: ManifestFirebotVersion;
|
|
76
|
-
|
|
77
61
|
/**
|
|
78
62
|
* A FontAwesome icon name shown in the UI (eg. "fa-cogs").
|
|
79
63
|
*/
|
|
@@ -82,34 +66,26 @@ export interface Manifest {
|
|
|
82
66
|
* A hex color code (eg. "#FF0000") used for the icon.
|
|
83
67
|
*/
|
|
84
68
|
color?: string;
|
|
85
|
-
|
|
86
69
|
/**
|
|
87
70
|
* If true, the plugin will be initialized before parameters are shown to the user,
|
|
88
71
|
* allowing the plugin to provide custom parameter types that can be used in its own parametersSchema.
|
|
89
72
|
*/
|
|
90
73
|
initBeforeShowingParams?: boolean;
|
|
91
|
-
|
|
92
74
|
type: ScriptType;
|
|
93
75
|
}
|
|
94
|
-
|
|
95
76
|
type EffectScriptResult = {
|
|
96
77
|
success: boolean;
|
|
97
78
|
errorMessage?: string;
|
|
98
79
|
effects?: EffectList | Array<EffectInstance>;
|
|
99
80
|
onEffectsDone?: () => Awaitable<void>;
|
|
100
81
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
82
|
export interface ScriptBase<Params extends FirebotParams = FirebotParams> {
|
|
104
83
|
manifest: Manifest;
|
|
105
|
-
|
|
106
84
|
parametersSchema?: FirebotParameterArray<Params>;
|
|
107
85
|
}
|
|
108
|
-
|
|
109
86
|
export interface EffectScript<Params extends FirebotParams = FirebotParams> extends ScriptBase<Params> {
|
|
110
87
|
run: (context: ScriptContext<Params>) => Awaitable<void | EffectScriptResult>;
|
|
111
88
|
}
|
|
112
|
-
|
|
113
89
|
export interface Plugin<Params extends FirebotParams = FirebotParams> extends ScriptBase<Params> {
|
|
114
90
|
/**
|
|
115
91
|
* Automatically handles registration with appropriate managers for definitions
|
|
@@ -132,50 +108,40 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
|
|
|
132
108
|
httpRoutes?: DynamicObject<PluginHttpRouteDefinition>;
|
|
133
109
|
websocketListener?: DynamicObject<CustomWebSocketHandler>;
|
|
134
110
|
};
|
|
135
|
-
|
|
136
111
|
/** Called when the plugin is loaded */
|
|
137
112
|
onLoad?: (context: ScriptContext<Params>, isInstalling?: boolean) => NoResult;
|
|
138
|
-
|
|
139
113
|
/** Called when Firebot is closing or plugin is disabled / removed */
|
|
140
114
|
onUnload?: (context: ScriptContext<Params>, isUninstalling?: boolean) => NoResult;
|
|
141
|
-
|
|
142
115
|
/** Called when the user updates plugin-specific parameters */
|
|
143
116
|
onParameterUpdate?: (context: ScriptContext<Params>) => NoResult;
|
|
144
117
|
}
|
|
145
|
-
|
|
146
118
|
export type ScriptDetails = Pick<ScriptBase, "manifest" | "parametersSchema">;
|
|
147
|
-
|
|
148
119
|
export type InstalledPlugin = {
|
|
149
120
|
config: InstalledPluginConfig;
|
|
150
121
|
details: ScriptDetails;
|
|
151
122
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
string
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
required?: boolean;
|
|
166
|
-
};
|
|
167
|
-
value?: unknown;
|
|
168
|
-
default?: unknown;
|
|
169
|
-
}
|
|
170
|
-
>;
|
|
171
|
-
|
|
123
|
+
type LegacyScriptParameters = Record<string, {
|
|
124
|
+
type: any;
|
|
125
|
+
title?: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
secondaryDescription?: string;
|
|
128
|
+
tip?: string;
|
|
129
|
+
showBottomHr?: boolean;
|
|
130
|
+
validation?: {
|
|
131
|
+
required?: boolean;
|
|
132
|
+
};
|
|
133
|
+
value?: unknown;
|
|
134
|
+
default?: unknown;
|
|
135
|
+
}>;
|
|
172
136
|
export type LegacyScriptReturnObject = {
|
|
173
137
|
success: boolean;
|
|
174
138
|
errorMessage?: string;
|
|
175
|
-
effects: unknown[] | {
|
|
139
|
+
effects: unknown[] | {
|
|
140
|
+
id: string;
|
|
141
|
+
list: unknown[];
|
|
142
|
+
};
|
|
176
143
|
callback?: VoidFunction;
|
|
177
144
|
};
|
|
178
|
-
|
|
179
145
|
type LegacyRunRequest = {
|
|
180
146
|
parameters: Record<string, unknown>;
|
|
181
147
|
modules: Record<string, unknown>;
|
|
@@ -191,7 +157,6 @@ type LegacyRunRequest = {
|
|
|
191
157
|
};
|
|
192
158
|
trigger: Trigger;
|
|
193
159
|
};
|
|
194
|
-
|
|
195
160
|
type LegacyCustomScriptManifest = {
|
|
196
161
|
name: string;
|
|
197
162
|
description: string;
|
|
@@ -202,23 +167,18 @@ type LegacyCustomScriptManifest = {
|
|
|
202
167
|
initBeforeShowingParams?: boolean;
|
|
203
168
|
firebotVersion?: "5";
|
|
204
169
|
};
|
|
205
|
-
|
|
206
170
|
export type LegacyScriptData = {
|
|
207
171
|
id: string;
|
|
208
172
|
name: string;
|
|
209
173
|
scriptName: string;
|
|
210
174
|
parameters: LegacyScriptParameters;
|
|
211
175
|
};
|
|
212
|
-
|
|
213
176
|
export type LegacyCustomScript = {
|
|
214
177
|
getScriptManifest(): Awaitable<LegacyCustomScriptManifest>;
|
|
215
178
|
getDefaultParameters?: () => LegacyScriptParameters;
|
|
216
|
-
run(
|
|
217
|
-
runRequest: LegacyRunRequest
|
|
218
|
-
): Awaitable<void | LegacyScriptReturnObject>;
|
|
179
|
+
run(runRequest: LegacyRunRequest): Awaitable<void | LegacyScriptReturnObject>;
|
|
219
180
|
parametersUpdated?: (parameters: Record<string, unknown>) => Awaitable<void>;
|
|
220
181
|
stop?: () => Awaitable<void>;
|
|
221
182
|
};
|
|
222
|
-
|
|
223
183
|
export type FirebotScriptApi = import("./script-api").FirebotScriptApi;
|
|
224
184
|
export type { ScriptLoggerApi, ScriptWebhooksApi, ScriptWebhook, ScriptWebhookEvent } from "./script-api";
|
package/types/power-ups.d.ts
CHANGED
|
@@ -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;
|
package/types/pronouns.d.ts
CHANGED
package/types/quick-actions.d.ts
CHANGED
|
@@ -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
package/types/restrictions.d.ts
CHANGED
|
@@ -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
|
-
|
|
24
|
-
|
|
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
|
+
};
|
package/types/script-api.d.ts
CHANGED
|
@@ -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,30 +5,24 @@ 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
27
|
/** Create a new webhook (or return the existing one with the same name). */
|
|
40
28
|
save(name: string): ScriptWebhook | null;
|
|
@@ -51,7 +39,6 @@ export interface ScriptWebhooksApi {
|
|
|
51
39
|
*/
|
|
52
40
|
onReceived(handler: ScriptWebhookEventHandler): () => void;
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
/**
|
|
56
43
|
* Simple per-script storage scoped to the script's data directory.
|
|
57
44
|
* Provides helpers for storing/loading JSON values
|
|
@@ -60,7 +47,6 @@ export interface ScriptWebhooksApi {
|
|
|
60
47
|
export interface ScriptStorageApi {
|
|
61
48
|
/** Absolute path to this script's data directory. */
|
|
62
49
|
readonly path: string;
|
|
63
|
-
|
|
64
50
|
/** Save a value as JSON under the given key. The key becomes the filename with a `.json` extension. */
|
|
65
51
|
setJson(key: string, value: unknown): Promise<void>;
|
|
66
52
|
/**
|
|
@@ -70,7 +56,6 @@ export interface ScriptStorageApi {
|
|
|
70
56
|
getJson<T = unknown>(key: string): Promise<T | null>;
|
|
71
57
|
/** Delete the JSON value stored under the given key. No-op if missing. */
|
|
72
58
|
deleteJson(key: string): Promise<void>;
|
|
73
|
-
|
|
74
59
|
/** Check whether a file exists in the data directory. */
|
|
75
60
|
fileExists(name: string): Promise<boolean>;
|
|
76
61
|
/** Read a file's raw bytes. Returns `null` if it doesn't exist. */
|
|
@@ -82,36 +67,26 @@ export interface ScriptStorageApi {
|
|
|
82
67
|
/** Delete a file. No-op if it doesn't exist. */
|
|
83
68
|
deleteFile(name: string): Promise<void>;
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
export type ScriptEventHandler = (event: TriggeredEvent) => void;
|
|
87
|
-
|
|
88
71
|
export interface ScriptEventsApi {
|
|
89
72
|
/**
|
|
90
73
|
* Subscribe to all Firebot events as they trigger. Returns an `unsubscribe`
|
|
91
74
|
* function.
|
|
92
75
|
*/
|
|
93
76
|
onTriggered(handler: ScriptEventHandler): () => void;
|
|
94
|
-
|
|
95
77
|
/**
|
|
96
78
|
* Manually trigger a Firebot event.
|
|
97
79
|
*/
|
|
98
|
-
trigger(
|
|
99
|
-
sourceId: string,
|
|
100
|
-
eventId: string,
|
|
101
|
-
meta?: Record<string, unknown>
|
|
102
|
-
): Promise<void>;
|
|
80
|
+
trigger(sourceId: string, eventId: string, meta?: Record<string, unknown>): Promise<void>;
|
|
103
81
|
}
|
|
104
|
-
|
|
105
82
|
export interface ScriptEffectsApi {
|
|
106
83
|
/**
|
|
107
84
|
* Register an existing effect to be available for an event.
|
|
108
85
|
* Useful for surfacing built-in effects on script provided events.
|
|
109
86
|
*/
|
|
110
87
|
addEventToEffect(effectId: string, eventSourceId: string, eventId: string): void;
|
|
111
|
-
|
|
112
88
|
/** Reverse of `addEventToEffect`. */
|
|
113
89
|
removeEventFromEffect(effectId: string, eventSourceId: string, eventId: string): void;
|
|
114
|
-
|
|
115
90
|
/**
|
|
116
91
|
* Run an effect list. Respects the list's run mode and effect queue, if any.
|
|
117
92
|
* Resolves once the effects have been run (queued lists resolve
|
|
@@ -119,12 +94,10 @@ export interface ScriptEffectsApi {
|
|
|
119
94
|
*/
|
|
120
95
|
processEffects(context: RunEffectsContext): Promise<unknown>;
|
|
121
96
|
}
|
|
122
|
-
|
|
123
97
|
export interface ScriptTwitchApi {
|
|
124
98
|
/** The full Twitch API surface. See {@linkcode TwitchApi}. */
|
|
125
99
|
api: typeof TwitchApi;
|
|
126
100
|
}
|
|
127
|
-
|
|
128
101
|
/**
|
|
129
102
|
* Access to this plugin's saved parameter values (the settings configured by
|
|
130
103
|
* the user)
|
|
@@ -132,7 +105,6 @@ export interface ScriptTwitchApi {
|
|
|
132
105
|
export interface ScriptParametersApi {
|
|
133
106
|
getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
134
107
|
}
|
|
135
|
-
|
|
136
108
|
export interface ScriptNotificationsApi {
|
|
137
109
|
/**
|
|
138
110
|
* Create a new notification. Pass `permanentlySave` as `true` to persist it
|
|
@@ -148,39 +120,25 @@ export interface ScriptNotificationsApi {
|
|
|
148
120
|
/** Delete all of this script's notifications. */
|
|
149
121
|
clearAll(): void;
|
|
150
122
|
}
|
|
151
|
-
|
|
152
123
|
export interface ScriptFrontendCommunicatorApi {
|
|
153
124
|
/** Send a synchronous event to the frontend. */
|
|
154
125
|
send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
|
|
155
|
-
|
|
156
126
|
/**
|
|
157
127
|
* Send an asynchronous event to the frontend and await the reply it sends
|
|
158
128
|
* back.
|
|
159
129
|
*/
|
|
160
|
-
fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(
|
|
161
|
-
eventName: string,
|
|
162
|
-
data?: ExpectedArg
|
|
163
|
-
): Promise<ReturnPayload>;
|
|
164
|
-
|
|
130
|
+
fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
|
|
165
131
|
/**
|
|
166
132
|
* Handle a synchronous event triggered by the frontend. Returns an
|
|
167
133
|
* `unsubscribe` function.
|
|
168
134
|
*/
|
|
169
|
-
on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
|
|
170
|
-
eventName: string,
|
|
171
|
-
callback: (...args: ExpectedArgs) => ReturnPayload
|
|
172
|
-
): () => void;
|
|
173
|
-
|
|
135
|
+
on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => ReturnPayload): () => void;
|
|
174
136
|
/**
|
|
175
137
|
* Handle an asynchronous event triggered by the frontend. Returns an
|
|
176
138
|
* `unsubscribe` function.
|
|
177
139
|
*/
|
|
178
|
-
onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
|
|
179
|
-
eventName: string,
|
|
180
|
-
callback: (...args: ExpectedArgs) => Promise<ReturnPayload>
|
|
181
|
-
): () => void;
|
|
140
|
+
onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => Promise<ReturnPayload>): () => void;
|
|
182
141
|
}
|
|
183
|
-
|
|
184
142
|
export interface ScriptSettingsApi {
|
|
185
143
|
/**
|
|
186
144
|
* Get a Firebot setting value or its default
|
|
@@ -190,19 +148,24 @@ export interface ScriptSettingsApi {
|
|
|
190
148
|
*/
|
|
191
149
|
getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
|
|
192
150
|
}
|
|
193
|
-
|
|
194
151
|
export interface ScriptPluginsApi {
|
|
195
152
|
/**
|
|
196
153
|
* Get a list of currently installed plugins installed by the user
|
|
197
154
|
*/
|
|
198
155
|
getInstalledPlugins(): Promise<Array<InstalledPlugin>>;
|
|
199
156
|
}
|
|
200
|
-
|
|
201
157
|
export interface Accounts {
|
|
202
158
|
streamer: FirebotAccount;
|
|
203
159
|
bot: FirebotAccount;
|
|
204
160
|
}
|
|
205
|
-
|
|
161
|
+
export interface ScriptWebServerApi {
|
|
162
|
+
/**
|
|
163
|
+
* Sends a custom event over the internal Firebot WebSocket server
|
|
164
|
+
* @param name Name of the event to send. Full event name will be `custom-event:{name}`
|
|
165
|
+
* @param data Any optional data you would like to send with the event
|
|
166
|
+
*/
|
|
167
|
+
sendWebSocketEvent(name: string, data?: unknown): any;
|
|
168
|
+
}
|
|
206
169
|
export interface FirebotScriptApi {
|
|
207
170
|
/** Running Firebot version, e.g. `"5.67.0"`. */
|
|
208
171
|
version: string;
|
|
@@ -230,4 +193,6 @@ export interface FirebotScriptApi {
|
|
|
230
193
|
notifications: ScriptNotificationsApi;
|
|
231
194
|
/** Access to installed plugins. */
|
|
232
195
|
plugins: ScriptPluginsApi;
|
|
196
|
+
/** Firebot internal web server functions. */
|
|
197
|
+
webServer: ScriptWebServerApi;
|
|
233
198
|
}
|
package/types/settings.d.ts
CHANGED
|
@@ -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: {
|
|
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;
|
|
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 {};
|
package/types/sort-tags.d.ts
CHANGED
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
|
+
};
|