@crowbartools/firebot-types 5.67.0-alpha26 → 5.67.0-alpha28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -674
- package/backend/chat/active-user-handler.d.ts +7 -1
- package/backend/chat/frontend-chat-manager.d.ts +36 -0
- package/backend/common/connection-manager.d.ts +40 -0
- package/backend/common/profile-manager.d.ts +3 -0
- package/backend/core/update-manager.d.ts +16 -0
- package/backend/currency/currency-manager.d.ts +1 -0
- package/backend/effects/builtin/overlay-widgets/update-rotating-text.d.ts +12 -0
- package/backend/events/activity-feed-manager.d.ts +8 -1
- package/backend/events/event-manager.d.ts +1 -1
- package/backend/overlay-widgets/builtin-types/index.d.ts +3 -3
- package/backend/overlay-widgets/builtin-types/rotating-text/rotating-text.d.ts +18 -0
- package/backend/plugins/executors/plugin-executor.interface.d.ts +2 -1
- package/backend/plugins/plugin-api/namespaces/currency.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/viewers.d.ts +2 -0
- package/backend/plugins/plugin-manager.d.ts +19 -7
- package/backend/roles/twitch-roles-manager.d.ts +4 -0
- package/backend/streaming-platforms/twitch/api/eventsub/eventsub-chat-helpers.d.ts +1 -0
- package/backend/streaming-platforms/twitch/api/eventsub/eventsub-client.d.ts +1 -0
- package/backend/streaming-platforms/twitch/api/resource/moderation.d.ts +1 -1
- package/backend/streaming-platforms/twitch/events/bits.d.ts +1 -1
- package/backend/ui-extensions/ui-extension-manager.d.ts +4 -2
- package/backend/utils/index.d.ts +1 -0
- package/backend/utils/versions.d.ts +9 -0
- package/backend/viewers/viewer-database.d.ts +3 -1
- package/backend/viewers/viewer-metadata-manager.d.ts +3 -0
- package/backend/viewers/viewer-online-status-manager.d.ts +1 -1
- package/package.json +1 -1
- package/server/http-server-manager.d.ts +2 -2
- package/server/websocket-server-manager.d.ts +5 -3
- package/shared/compare-versions.d.ts +21 -0
- package/types/chat.d.ts +76 -0
- package/types/events.d.ts +9 -0
- package/types/integrations.d.ts +1 -2
- package/types/overlay-widgets.d.ts +1 -0
- package/types/parameters.d.ts +1 -0
- package/types/plugin-api.d.ts +306 -89
- package/types/plugins.d.ts +55 -32
- package/types/ui/modal-factory.d.ts +9 -0
- package/types/ui-extensions.d.ts +3 -1
- package/types/viewers.d.ts +9 -0
- package/types/websocket.d.ts +12 -1
- package/backend/chat/frontend-chat-helpers.d.ts +0 -14
package/types/plugins.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { EffectType, PluginAdditionalEffectEvents } from "./effects";
|
|
|
2
2
|
import type { Trigger } from "./triggers";
|
|
3
3
|
import type { Awaitable } from "./util-types";
|
|
4
4
|
import type { PluginAdditionalVariableEvents, ReplaceVariable } from "./variables";
|
|
5
|
-
import type { EventFilter, EventSource } from "./events";
|
|
5
|
+
import type { EventFilter, EventSource, PluginAdditionalFilterEvents } from "./events";
|
|
6
6
|
import type { SystemCommand } from "./commands";
|
|
7
7
|
import type { RestrictionType } from "./restrictions";
|
|
8
8
|
import type { FirebotParams, FirebotParameterArray } from "./parameters";
|
|
@@ -11,11 +11,31 @@ import type { Integration } from "./integrations";
|
|
|
11
11
|
import type { FrontendListener, UIExtension } from "./ui-extensions";
|
|
12
12
|
import type { OverlayWidgetType } from "./overlay-widgets";
|
|
13
13
|
import type { PluginHttpRouteDefinition } from "./http-server";
|
|
14
|
-
import type {
|
|
14
|
+
import type { PluginWebSocketHandler } from "./websocket";
|
|
15
15
|
import type { PluginWebhooks } from "./webhooks";
|
|
16
16
|
import { ConditionType } from "./conditions";
|
|
17
17
|
type NoResult = Awaitable<void>;
|
|
18
18
|
type GenericParameters = Record<string, unknown>;
|
|
19
|
+
type FontAwesomeIcon = {
|
|
20
|
+
type: "font-awesome";
|
|
21
|
+
/**
|
|
22
|
+
* A FontAwesome icon name shown in the UI (eg. "fa-cogs").
|
|
23
|
+
*/
|
|
24
|
+
name: `fa-${string}`;
|
|
25
|
+
/**
|
|
26
|
+
* A css color value (eg. "#FF0000") used for the icon.
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
};
|
|
30
|
+
type CustomIcon = {
|
|
31
|
+
type: "custom";
|
|
32
|
+
url: string;
|
|
33
|
+
/**
|
|
34
|
+
* A css color value (eg. "#FF0000") used for the background of the icon.
|
|
35
|
+
*/
|
|
36
|
+
backgroundColor?: string;
|
|
37
|
+
};
|
|
38
|
+
export type PluginIcon = FontAwesomeIcon | CustomIcon;
|
|
19
39
|
export type ManagedPluginManifest = {
|
|
20
40
|
name: string;
|
|
21
41
|
author: string;
|
|
@@ -35,16 +55,20 @@ export type ManagedPluginManifest = {
|
|
|
35
55
|
minimumFirebotVersion?: ManifestFirebotVersion;
|
|
36
56
|
maximumFirebotVersion?: ManifestFirebotVersion;
|
|
37
57
|
};
|
|
38
|
-
export type
|
|
58
|
+
export type ManagedPluginBase = {
|
|
39
59
|
author: string;
|
|
40
60
|
name: string;
|
|
41
61
|
version: string;
|
|
42
62
|
};
|
|
43
|
-
export type
|
|
63
|
+
export type ManagedPlugin = ManagedPluginBase & {
|
|
44
64
|
manifest: ManagedPluginManifest;
|
|
45
65
|
};
|
|
66
|
+
export type ManagedPluginExtended = ManagedPlugin & {
|
|
67
|
+
installed: boolean;
|
|
68
|
+
installedVersion?: string;
|
|
69
|
+
};
|
|
46
70
|
export type ManagedPluginUpdateRequest = {
|
|
47
|
-
plugins: Array<
|
|
71
|
+
plugins: Array<ManagedPluginBase>;
|
|
48
72
|
firebotVersion: ManifestFirebotVersion;
|
|
49
73
|
};
|
|
50
74
|
export type InstalledPluginConfig<Params extends GenericParameters = GenericParameters> = {
|
|
@@ -52,7 +76,7 @@ export type InstalledPluginConfig<Params extends GenericParameters = GenericPara
|
|
|
52
76
|
fileName: string;
|
|
53
77
|
enabled?: boolean;
|
|
54
78
|
legacyImport?: boolean;
|
|
55
|
-
managedPluginDetails?:
|
|
79
|
+
managedPluginDetails?: ManagedPluginBase;
|
|
56
80
|
parameters: Params;
|
|
57
81
|
};
|
|
58
82
|
export type PluginContext<Params extends FirebotParams = FirebotParams> = {
|
|
@@ -71,30 +95,22 @@ export interface ManifestFirebotVersion {
|
|
|
71
95
|
minor?: number;
|
|
72
96
|
patch?: number;
|
|
73
97
|
}
|
|
74
|
-
|
|
75
|
-
type: "font-awesome";
|
|
98
|
+
export interface Manifest {
|
|
76
99
|
/**
|
|
77
|
-
*
|
|
100
|
+
* Name of the plugin
|
|
78
101
|
*/
|
|
79
|
-
name:
|
|
102
|
+
name: string;
|
|
80
103
|
/**
|
|
81
|
-
*
|
|
104
|
+
* Version of the plugin
|
|
82
105
|
*/
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
type CustomIcon = {
|
|
86
|
-
type: "custom";
|
|
87
|
-
url: string;
|
|
106
|
+
version: string;
|
|
88
107
|
/**
|
|
89
|
-
*
|
|
108
|
+
* Author of the plugin
|
|
90
109
|
*/
|
|
91
|
-
backgroundColor?: string;
|
|
92
|
-
};
|
|
93
|
-
export type PluginIcon = FontAwesomeIcon | CustomIcon;
|
|
94
|
-
export interface Manifest {
|
|
95
|
-
name: string;
|
|
96
|
-
version: string;
|
|
97
110
|
author: string;
|
|
111
|
+
/**
|
|
112
|
+
* Description of the plugin
|
|
113
|
+
*/
|
|
98
114
|
description: string | ManifestDescription;
|
|
99
115
|
/**
|
|
100
116
|
* An array of strings that describe or categorize your plugin
|
|
@@ -105,8 +121,8 @@ export interface Manifest {
|
|
|
105
121
|
*/
|
|
106
122
|
repo?: string;
|
|
107
123
|
/**
|
|
108
|
-
* A link to the plugin's website
|
|
109
|
-
*
|
|
124
|
+
* A link to the plugin's website. If the repo is on GitHub and the website
|
|
125
|
+
* is not specified, it will default to the GitHub repo URL.
|
|
110
126
|
*/
|
|
111
127
|
website?: string;
|
|
112
128
|
/**
|
|
@@ -114,20 +130,27 @@ export interface Manifest {
|
|
|
114
130
|
* If the repo is on GitHub and support is not specified, it will default to the GitHub issues URL.
|
|
115
131
|
*/
|
|
116
132
|
support?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The lowest Firebot version this plugin is compatible with
|
|
135
|
+
*/
|
|
117
136
|
minimumFirebotVersion?: ManifestFirebotVersion;
|
|
137
|
+
/**
|
|
138
|
+
* The highest Firebot version this plugin is compatible with
|
|
139
|
+
*/
|
|
118
140
|
maximumFirebotVersion?: ManifestFirebotVersion;
|
|
119
141
|
/**
|
|
120
142
|
* The icon to be displayed for the plugin.
|
|
121
143
|
*/
|
|
122
144
|
icon?: PluginIcon;
|
|
123
|
-
/**
|
|
124
|
-
* If true, the plugin will be initialized before parameters are shown to the user,
|
|
125
|
-
* allowing the plugin to provide custom parameter types that can be used in its own parametersSchema.
|
|
126
|
-
*/
|
|
127
|
-
initBeforeShowingParams?: boolean;
|
|
128
145
|
}
|
|
129
146
|
export interface PluginBase<Params extends FirebotParams = FirebotParams> {
|
|
147
|
+
/**
|
|
148
|
+
* Basic information about the plugin
|
|
149
|
+
*/
|
|
130
150
|
manifest: Manifest;
|
|
151
|
+
/**
|
|
152
|
+
* Defines the user-specified parameters for this plugin
|
|
153
|
+
*/
|
|
131
154
|
parametersSchema?: FirebotParameterArray<Params>;
|
|
132
155
|
}
|
|
133
156
|
export interface Plugin<Params extends FirebotParams = FirebotParams> extends PluginBase<Params> {
|
|
@@ -152,10 +175,11 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Pl
|
|
|
152
175
|
uiExtensions?: DynamicArray<UIExtension>;
|
|
153
176
|
overlayWidgets?: DynamicArray<OverlayWidgetType<any, any>>;
|
|
154
177
|
httpRoutes?: DynamicObject<PluginHttpRouteDefinition>;
|
|
155
|
-
websocketListener?: DynamicObject<
|
|
178
|
+
websocketListener?: DynamicObject<PluginWebSocketHandler>;
|
|
156
179
|
webhooks?: DynamicObject<PluginWebhooks>;
|
|
157
180
|
additionalEffectEvents?: DynamicArray<PluginAdditionalEffectEvents>;
|
|
158
181
|
additionalVariableEvents?: DynamicArray<PluginAdditionalVariableEvents>;
|
|
182
|
+
additionalFilterEvents?: DynamicArray<PluginAdditionalFilterEvents>;
|
|
159
183
|
};
|
|
160
184
|
/** Called when the plugin is loaded */
|
|
161
185
|
onLoad?: (context: PluginContext<Params>, isInstalling?: boolean) => NoResult;
|
|
@@ -213,7 +237,6 @@ type LegacyCustomScriptManifest = {
|
|
|
213
237
|
author: string;
|
|
214
238
|
website?: string;
|
|
215
239
|
startupOnly?: boolean;
|
|
216
|
-
initBeforeShowingParams?: boolean;
|
|
217
240
|
firebotVersion?: "5";
|
|
218
241
|
};
|
|
219
242
|
export type LegacyScriptData = {
|
|
@@ -19,4 +19,13 @@ export type ModalFactory = {
|
|
|
19
19
|
trigger?: TriggerType;
|
|
20
20
|
triggerMeta?: unknown;
|
|
21
21
|
}, callback: (result: T) => void, dismissCallback?: () => void) => void;
|
|
22
|
+
showConfirmationModal: (options: {
|
|
23
|
+
title: string;
|
|
24
|
+
question: string;
|
|
25
|
+
tip?: string;
|
|
26
|
+
cancelLabel?: string;
|
|
27
|
+
cancelBtnType?: string;
|
|
28
|
+
confirmLabel?: string;
|
|
29
|
+
confirmBtnType?: string;
|
|
30
|
+
}) => Promise<boolean>;
|
|
22
31
|
};
|
package/types/ui-extensions.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ export type AngularJsPage = BasePage & {
|
|
|
13
13
|
};
|
|
14
14
|
export type IframePage = BasePage & {
|
|
15
15
|
type: 'iframe';
|
|
16
|
+
url: string;
|
|
16
17
|
};
|
|
18
|
+
export type UiExtensionPage = AngularJsPage | IframePage;
|
|
17
19
|
export type AngularJsFactory = {
|
|
18
20
|
name: string;
|
|
19
21
|
function: Function;
|
|
@@ -80,7 +82,7 @@ export type UIExtension = {
|
|
|
80
82
|
/**
|
|
81
83
|
* Adds new sidebar entries under an "Extensions" category
|
|
82
84
|
*/
|
|
83
|
-
pages?:
|
|
85
|
+
pages?: UiExtensionPage[];
|
|
84
86
|
/**
|
|
85
87
|
* Add your own AngularJS services, components, directives, filters
|
|
86
88
|
*/
|
package/types/viewers.d.ts
CHANGED
|
@@ -26,3 +26,12 @@ export interface BasicViewer {
|
|
|
26
26
|
profilePicUrl?: string;
|
|
27
27
|
}
|
|
28
28
|
export type NewFirebotViewer = BasicViewer & Partial<Omit<FirebotViewer, "_id" | "username" | "displayName" | "twitchRoles" | "profilePicUrl">>;
|
|
29
|
+
export type FrontendViewer = {
|
|
30
|
+
id: string;
|
|
31
|
+
username: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
roles: string[];
|
|
34
|
+
profilePicUrl: string;
|
|
35
|
+
active: boolean;
|
|
36
|
+
disableViewerList?: boolean;
|
|
37
|
+
};
|
package/types/websocket.d.ts
CHANGED
|
@@ -23,10 +23,21 @@ export interface InvokePluginMessage extends InvokeMessage {
|
|
|
23
23
|
name: "plugin";
|
|
24
24
|
pluginName: string;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface PluginWebSocketHandler {
|
|
27
27
|
pluginName: string;
|
|
28
28
|
handler: (data: unknown) => Awaitable<void>;
|
|
29
29
|
}
|
|
30
|
+
export interface InvokeOverlayRequestMessage extends InvokeMessage {
|
|
31
|
+
name: "overlay-request";
|
|
32
|
+
data: {
|
|
33
|
+
name: string;
|
|
34
|
+
data?: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface OverlayRequestWebSocketHandler<TData extends Record<string, unknown> = Record<string, unknown>, TResponse = unknown> {
|
|
38
|
+
name: string;
|
|
39
|
+
handler: (data: TData) => Awaitable<TResponse>;
|
|
40
|
+
}
|
|
30
41
|
export type OverlayConnectedData = {
|
|
31
42
|
instanceName: string;
|
|
32
43
|
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FirebotChatMessage } from "../../types";
|
|
2
|
-
declare class FirebotFrontendChatHelpers {
|
|
3
|
-
private logger;
|
|
4
|
-
private _pendingMessageCache;
|
|
5
|
-
private sendChatMessageToChatWidget;
|
|
6
|
-
sendChatMessageToFrontend(chatMessage: FirebotChatMessage): void;
|
|
7
|
-
private deleteMessageFromChatWidget;
|
|
8
|
-
deleteMessageFromFrontend(messageId: string, animate?: boolean): void;
|
|
9
|
-
deleteUserMessagesFromFrontend(username: string): void;
|
|
10
|
-
clearChatFeed(moderatorName: string): void;
|
|
11
|
-
updateMessageAutomodStatus(messageId: string, newStatus: FirebotChatMessage["autoModStatus"], resolverName: string, resolverId: string, flaggedPhrases: string[]): void;
|
|
12
|
-
}
|
|
13
|
-
declare const frontendChatHelpers: FirebotFrontendChatHelpers;
|
|
14
|
-
export { frontendChatHelpers as FirebotFrontendChatHelpers };
|