@crowbartools/firebot-types 5.67.0-alpha27 → 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/backend/effects/builtin/overlay-widgets/update-rotating-text.d.ts +12 -0
- package/backend/overlay-widgets/builtin-types/index.d.ts +1 -1
- 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/streaming-platforms/twitch/api/eventsub/eventsub-client.d.ts +1 -0
- package/package.json +1 -1
- package/server/http-server-manager.d.ts +2 -2
- package/server/websocket-server-manager.d.ts +5 -3
- package/types/events.d.ts +9 -0
- package/types/overlay-widgets.d.ts +1 -0
- package/types/parameters.d.ts +1 -0
- package/types/plugin-api.d.ts +280 -146
- package/types/plugins.d.ts +30 -5
- package/types/websocket.d.ts +12 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EffectType } from "../../../../types";
|
|
2
|
+
declare const model: EffectType<{
|
|
3
|
+
rotatingTextWidgetId: string;
|
|
4
|
+
action: "add" | "remove" | "set";
|
|
5
|
+
texts?: string[];
|
|
6
|
+
variableEvaluation?: "dynamic" | "onRun";
|
|
7
|
+
removeMode?: "first" | "last" | "position" | "matching";
|
|
8
|
+
removePosition?: number;
|
|
9
|
+
removeValue?: string;
|
|
10
|
+
removeExactMatch?: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export = model;
|
|
@@ -28,7 +28,7 @@ declare const _default: (import("../../../types").OverlayWidgetType<import("./ch
|
|
|
28
28
|
fontOptions?: import("../../../types").FontOptions;
|
|
29
29
|
horizontalAlignment: "left" | "center" | "right";
|
|
30
30
|
verticalAlignment: "top" | "center" | "bottom";
|
|
31
|
-
}, {}> | import("../../../types").OverlayWidgetType<{
|
|
31
|
+
}, {}> | import("../../../types").OverlayWidgetType<import("./rotating-text/rotating-text").RotatingTextSettings, import("./rotating-text/rotating-text").RotatingTextState> | import("../../../types").OverlayWidgetType<{
|
|
32
32
|
format?: string;
|
|
33
33
|
fontOptions?: import("../../../types").FontOptions;
|
|
34
34
|
horizontalAlignment: "left" | "center" | "right";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { OverlayWidgetType, OverlayWidgetConfig, FontOptions, Animation } from "../../../../types";
|
|
2
|
+
export declare const ROTATING_TEXT_TYPE_ID = "firebot:rotating-text";
|
|
3
|
+
export type RotatingTextSettings = {
|
|
4
|
+
texts: string[];
|
|
5
|
+
intervalSeconds: number;
|
|
6
|
+
randomizeOrder: boolean;
|
|
7
|
+
fontOptions?: FontOptions;
|
|
8
|
+
horizontalAlignment: "left" | "center" | "right";
|
|
9
|
+
verticalAlignment: "top" | "center" | "bottom";
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
backgroundBorderRadius: number;
|
|
12
|
+
addDropShadow: boolean;
|
|
13
|
+
textEnterAnimation: Animation;
|
|
14
|
+
textExitAnimation: Animation;
|
|
15
|
+
};
|
|
16
|
+
export type RotatingTextState = Record<string, never>;
|
|
17
|
+
export type RotatingTextWidgetConfig = OverlayWidgetConfig<RotatingTextSettings, RotatingTextState>;
|
|
18
|
+
export declare const rotatingText: OverlayWidgetType<RotatingTextSettings, RotatingTextState>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InstalledPluginConfig, LegacyCustomScript, PluginBase, Awaitable, PluginDetails, AdditionalVariableEvent, AdditionalEffectEvent } from "../../../types";
|
|
1
|
+
import { InstalledPluginConfig, LegacyCustomScript, PluginBase, Awaitable, PluginDetails, AdditionalVariableEvent, AdditionalEffectEvent, AdditionalFilterEvent } from "../../../types";
|
|
2
2
|
import type { PluginApiContext } from "../plugin-api";
|
|
3
3
|
declare abstract class IBasePluginExecutor {
|
|
4
4
|
abstract canHandle(plugin: PluginBase | LegacyCustomScript): Awaitable<boolean>;
|
|
@@ -24,6 +24,7 @@ export interface PluginRegistrations {
|
|
|
24
24
|
websocketListenerName?: string;
|
|
25
25
|
additionalVariableEvents?: AdditionalVariableEvent[];
|
|
26
26
|
additionalEffectEvents?: AdditionalEffectEvent[];
|
|
27
|
+
additionalFilterEvents?: AdditionalFilterEvent[];
|
|
27
28
|
}
|
|
28
29
|
export type PluginExecutionResult = {
|
|
29
30
|
success: true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
2
|
import { Express, Request, Response, Router } from "express";
|
|
3
3
|
import http from "http";
|
|
4
|
-
import type { HttpMethod, CustomHttpRoute, PluginHttpRouteDefinition,
|
|
4
|
+
import type { HttpMethod, CustomHttpRoute, PluginHttpRouteDefinition, PluginWebSocketHandler, Awaitable } from "../types";
|
|
5
5
|
interface ServerInstance {
|
|
6
6
|
name: string;
|
|
7
7
|
port: number;
|
|
@@ -63,7 +63,7 @@ declare class HttpServerManager extends EventEmitter {
|
|
|
63
63
|
};
|
|
64
64
|
private getCustomRoutePathFromRoot;
|
|
65
65
|
private removeCustomRoute;
|
|
66
|
-
registerCustomWebSocketListener(pluginName: string, handler:
|
|
66
|
+
registerCustomWebSocketListener(pluginName: string, handler: PluginWebSocketHandler["handler"]): boolean;
|
|
67
67
|
unregisterCustomWebSocketListener(pluginName: string): boolean;
|
|
68
68
|
}
|
|
69
69
|
declare const manager: HttpServerManager;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
2
|
import http from "http";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PluginWebSocketHandler, WidgetOverlayEvent, OverlayRequestWebSocketHandler } from "../types";
|
|
4
4
|
declare class WebSocketServerManager extends EventEmitter {
|
|
5
5
|
private logger;
|
|
6
6
|
overlayHasClients: boolean;
|
|
7
7
|
private server;
|
|
8
|
-
private
|
|
8
|
+
private pluginHandlers;
|
|
9
|
+
private overlayRequestHandlers;
|
|
9
10
|
constructor();
|
|
10
11
|
createServer(httpServer: http.Server): void;
|
|
11
12
|
sendToOverlay(eventName: string, meta?: Record<string, unknown>, overlayInstance?: string): void;
|
|
@@ -15,8 +16,9 @@ declare class WebSocketServerManager extends EventEmitter {
|
|
|
15
16
|
triggerEvent(eventType: string, payload: unknown): void;
|
|
16
17
|
reportClientsToFrontend(isDefaultServerStarted: boolean): void;
|
|
17
18
|
getNumberOfOverlayClients(): number;
|
|
18
|
-
registerCustomWebSocketListener(pluginName: string, handler:
|
|
19
|
+
registerCustomWebSocketListener(pluginName: string, handler: PluginWebSocketHandler["handler"]): boolean;
|
|
19
20
|
unregisterCustomWebSocketListener(pluginName: string): boolean;
|
|
21
|
+
registerOverlayRequestHandler<TData extends Record<string, unknown> = Record<string, unknown>, TResponse = unknown>(handler: OverlayRequestWebSocketHandler<TData, TResponse>): boolean;
|
|
20
22
|
}
|
|
21
23
|
declare const manager: WebSocketServerManager;
|
|
22
24
|
export { manager as WebSocketServerManager };
|
package/types/events.d.ts
CHANGED
|
@@ -53,6 +53,15 @@ export type EventFilterData = {
|
|
|
53
53
|
mode: "inclusive" | "exclusive";
|
|
54
54
|
filters: FilterSettings[];
|
|
55
55
|
};
|
|
56
|
+
export type AdditionalFilterEvent = {
|
|
57
|
+
filterId: string;
|
|
58
|
+
eventSourceId: string;
|
|
59
|
+
eventId: string;
|
|
60
|
+
};
|
|
61
|
+
export type PluginAdditionalFilterEvents = {
|
|
62
|
+
filterId: string;
|
|
63
|
+
events: Array<EventSourceAndId>;
|
|
64
|
+
};
|
|
56
65
|
export type EventSettings = {
|
|
57
66
|
id: string;
|
|
58
67
|
type: string;
|
|
@@ -276,6 +276,7 @@ export interface IOverlayWidgetEventUtils {
|
|
|
276
276
|
stylesToString(styles: Record<string, string | number | undefined>): string;
|
|
277
277
|
getFontOptionsStyles(fontOptions?: FontOptions): Record<string, string | number | undefined>;
|
|
278
278
|
sendMessageToFirebot(messageName: string, messageData?: unknown): void;
|
|
279
|
+
invokeFirebotRequest<TData extends Record<string, unknown> = Record<string, unknown>, TResponse = unknown>(requestName: string, requestData?: TData): Promise<TResponse>;
|
|
279
280
|
}
|
|
280
281
|
export interface IOverlayWidgetInitUtils {
|
|
281
282
|
getWidgetContainerElements(): NodeListOf<HTMLElement>;
|
package/types/parameters.d.ts
CHANGED
package/types/plugin-api.d.ts
CHANGED
|
@@ -10,58 +10,96 @@ import type { ReplaceVariable, VariableConfig } from "./variables";
|
|
|
10
10
|
import type { FilterConfig, PresetFilterConfig, TextFilterConfig } from "../backend/events/filters/filter-factory";
|
|
11
11
|
import type { FirebotViewer } from "./viewers";
|
|
12
12
|
import type { Currency } from "./currency";
|
|
13
|
+
export interface Accounts {
|
|
14
|
+
/** Streamer account information */
|
|
15
|
+
streamer: FirebotAccount;
|
|
16
|
+
/** Bot account information. May be null if user has not logged in with a bot account. */
|
|
17
|
+
bot: FirebotAccount;
|
|
18
|
+
}
|
|
13
19
|
export type PluginLogMethod = (message: string, ...meta: unknown[]) => void;
|
|
14
20
|
export interface PluginLoggerApi {
|
|
21
|
+
/** Log a message at the debug log level. These may not appear in log files if the user has not enabled debug logging. */
|
|
15
22
|
debug: PluginLogMethod;
|
|
23
|
+
/** Log a message at the info log level */
|
|
16
24
|
info: PluginLogMethod;
|
|
25
|
+
/** Log a message at the warn log level */
|
|
17
26
|
warn: PluginLogMethod;
|
|
27
|
+
/** Log a message at the error log level */
|
|
18
28
|
error: PluginLogMethod;
|
|
19
29
|
}
|
|
20
|
-
export interface
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
export interface PluginSettingsApi {
|
|
31
|
+
/**
|
|
32
|
+
* Get a Firebot setting value or its default
|
|
33
|
+
*
|
|
34
|
+
* @param settingName Name of the setting to get
|
|
35
|
+
* @returns Setting value, or the default if one isn't explicitly set
|
|
36
|
+
*/
|
|
37
|
+
getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
|
|
27
38
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Simple per-plugin storage scoped to the plugin's data directory.
|
|
30
|
-
* Provides helpers for storing/loading JSON values
|
|
31
|
-
* plus generic file read/write for anything else.
|
|
32
|
-
*/
|
|
33
39
|
export interface PluginStorageApi {
|
|
34
40
|
/** Absolute path to this plugin's data directory. */
|
|
35
41
|
readonly path: string;
|
|
36
|
-
/** Save a value as JSON under the given key. The key becomes the filename with a `.json` extension. */
|
|
37
|
-
setJson(key: string, value: unknown): Promise<void>;
|
|
38
42
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
43
|
+
* Save a value as JSON under the given key. The key becomes the filename with a `.json` extension.
|
|
44
|
+
* @param key The name of the key to store
|
|
45
|
+
* @param value The value to store
|
|
41
46
|
*/
|
|
47
|
+
setJson(key: string, value: unknown): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Load a JSON value previously saved with {@linkcode setJson}
|
|
50
|
+
* @param key The name of the key to get
|
|
51
|
+
* @returns A `Promise` with either the data of type `T` or `null` if nothing has been stored under this key
|
|
52
|
+
*/
|
|
42
53
|
getJson<T = unknown>(key: string): Promise<T | null>;
|
|
43
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Delete the JSON value stored under the given key. No-op if missing.
|
|
56
|
+
* @param key The name of the key to delete
|
|
57
|
+
*/
|
|
44
58
|
deleteJson(key: string): Promise<void>;
|
|
45
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Check whether a file exists in the data directory.
|
|
61
|
+
* @param name Name of the file to check
|
|
62
|
+
* @returns A `Promise<boolean>` indicating if the file exists
|
|
63
|
+
*/
|
|
46
64
|
fileExists(name: string): Promise<boolean>;
|
|
47
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Read a file's raw bytes
|
|
67
|
+
* @param name Name of the file to read
|
|
68
|
+
* @returns A `Promise` with either a `Buffer` containing the file's contents, or `null` if the file doesn't exist
|
|
69
|
+
*/
|
|
48
70
|
readFile(name: string): Promise<Buffer | null>;
|
|
49
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Read a file as text
|
|
73
|
+
* @param name Name of the file to read
|
|
74
|
+
* @param encoding Encoding to use when reading the file
|
|
75
|
+
* @returns A `Promise` with either a `string` containing the file's contents, or `null` if the file doesn't exist
|
|
76
|
+
*/
|
|
50
77
|
readTextFile(name: string, encoding?: BufferEncoding): Promise<string | null>;
|
|
51
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Write contents to a file, creating any missing parent directories
|
|
80
|
+
* @param name Name of the file to write
|
|
81
|
+
* @param contents Data to store in the file
|
|
82
|
+
*/
|
|
52
83
|
writeFile(name: string, contents: string | Buffer | Uint8Array): Promise<void>;
|
|
53
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Delete a file. No-op if it doesn't exist.
|
|
86
|
+
* @param name Name of the file to delete
|
|
87
|
+
*/
|
|
54
88
|
deleteFile(name: string): Promise<void>;
|
|
55
89
|
}
|
|
56
90
|
export type PluginEventHandler = (event: TriggeredEvent) => void;
|
|
57
91
|
export interface PluginEventsApi {
|
|
58
92
|
/**
|
|
59
|
-
* Subscribe to all Firebot events as they trigger
|
|
60
|
-
*
|
|
93
|
+
* Subscribe to all Firebot events as they trigger
|
|
94
|
+
* @param hander Function to execute when an event is triggered
|
|
95
|
+
* @returns An `unsubscribe` function
|
|
61
96
|
*/
|
|
62
97
|
onTriggered(handler: PluginEventHandler): () => void;
|
|
63
98
|
/**
|
|
64
|
-
* Manually trigger a Firebot event
|
|
99
|
+
* Manually trigger a Firebot event
|
|
100
|
+
* @param sourceId Event source ID
|
|
101
|
+
* @param eventId Event ID
|
|
102
|
+
* @param meta (Optional) Any metadata to include with the event
|
|
65
103
|
*/
|
|
66
104
|
trigger(sourceId: string, eventId: string, meta?: Record<string, unknown>): Promise<void>;
|
|
67
105
|
}
|
|
@@ -70,113 +108,22 @@ export interface PluginEffectsApi {
|
|
|
70
108
|
* Run an effect list. Respects the list's run mode and effect queue, if any.
|
|
71
109
|
* Resolves once the effects have been run (queued lists resolve
|
|
72
110
|
* immediately).
|
|
111
|
+
* @param context An object containing the context of the effects to run,
|
|
112
|
+
* including any trigger data and effect outputs.
|
|
73
113
|
*/
|
|
74
114
|
processEffects(context: RunEffectsContext): Promise<unknown>;
|
|
75
115
|
}
|
|
76
|
-
export interface PluginTwitchApi {
|
|
77
|
-
/** The full Twitch API surface. See {@linkcode TwitchApi}. */
|
|
78
|
-
api: typeof TwitchApi;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Access to this plugin's saved parameter values (the settings configured by
|
|
82
|
-
* the user)
|
|
83
|
-
*/
|
|
84
|
-
export interface PluginParametersApi {
|
|
85
|
-
getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
86
|
-
}
|
|
87
|
-
export interface PluginNotificationsApi {
|
|
88
|
-
/**
|
|
89
|
-
* Create a new notification. Pass `permanentlySave` as `true` to persist it
|
|
90
|
-
* across restarts.
|
|
91
|
-
*/
|
|
92
|
-
add(notification: Pick<Notification, "title" | "message" | "type" | "metadata">, permanentlySave?: boolean): Notification;
|
|
93
|
-
/** Look up one of this plugin's notifications by id. */
|
|
94
|
-
get(id: string): Notification | null;
|
|
95
|
-
/** All notifications owned by this plugin. */
|
|
96
|
-
getAll(): Notification[];
|
|
97
|
-
/** Delete one of this plugin's notifications by id. */
|
|
98
|
-
delete(id: string): void;
|
|
99
|
-
/** Delete all of this plugin's notifications. */
|
|
100
|
-
clearAll(): void;
|
|
101
|
-
}
|
|
102
|
-
export interface PluginFrontendCommunicatorApi {
|
|
103
|
-
/** Send a synchronous event to the frontend. */
|
|
104
|
-
send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
|
|
105
|
-
/**
|
|
106
|
-
* Send an asynchronous event to the frontend and await the reply it sends
|
|
107
|
-
* back.
|
|
108
|
-
*/
|
|
109
|
-
fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
|
|
110
|
-
}
|
|
111
|
-
export interface PluginMessageEvent<TPayload = unknown> {
|
|
112
|
-
/** The pluginId of the plugin that sent the message. */
|
|
113
|
-
sender: string;
|
|
114
|
-
/** The provided payload. */
|
|
115
|
-
payload: TPayload;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Plugin-to-plugin messaging. Supports both fire-and-forget (`emit`/`on`/`off`)
|
|
119
|
-
* and request/response (`invoke`/`handle`) messaging over a shared event bus,
|
|
120
|
-
* based on Electron's IPC
|
|
121
|
-
*/
|
|
122
|
-
export interface ScopedIpc {
|
|
123
|
-
/** Broadcast a message on a channel. */
|
|
124
|
-
emit(channel: string, data: unknown): void;
|
|
125
|
-
/**
|
|
126
|
-
* Listen for messages on a channel.
|
|
127
|
-
* Returns an `unsubscribe` function.
|
|
128
|
-
*/
|
|
129
|
-
on<TPayload = unknown>(channel: string, callback: (event: PluginMessageEvent<TPayload>) => void): () => void;
|
|
130
|
-
/** Remove a previously registered `on` listener. */
|
|
131
|
-
off(channel: string, callback: (...args: never[]) => void): void;
|
|
132
|
-
/**
|
|
133
|
-
* Send a request on a channel and await a response. Rejects if
|
|
134
|
-
* no handler responds within a 10s timeout or if the handler throws.
|
|
135
|
-
*/
|
|
136
|
-
invoke<TRequestPayload = unknown, TResponseData = unknown>(channel: string, data?: TRequestPayload): Promise<TResponseData>;
|
|
137
|
-
/**
|
|
138
|
-
* Register the handler for a request channel.
|
|
139
|
-
*/
|
|
140
|
-
handle<TRequestPayload = unknown, TResponseData = unknown>(channel: string, handlerFn: (payload: TRequestPayload, sender: string) => Promise<TResponseData> | TResponseData): void;
|
|
141
|
-
}
|
|
142
|
-
export interface PluginSettingsApi {
|
|
143
|
-
/**
|
|
144
|
-
* Get a Firebot setting value or its default
|
|
145
|
-
*
|
|
146
|
-
* @param settingName Name of the setting to get
|
|
147
|
-
* @returns Setting value, or the default if one isn't explicitly set
|
|
148
|
-
*/
|
|
149
|
-
getSetting<SettingName extends keyof FirebotSettingsTypes>(settingName: SettingName): FirebotSettingsTypes[SettingName];
|
|
150
|
-
}
|
|
151
|
-
export interface PluginPluginsApi {
|
|
152
|
-
/**
|
|
153
|
-
* Get a list of currently installed plugins installed by the user
|
|
154
|
-
*/
|
|
155
|
-
getInstalledPlugins(): Promise<Array<InstalledPlugin>>;
|
|
156
|
-
}
|
|
157
|
-
export interface Accounts {
|
|
158
|
-
streamer: FirebotAccount;
|
|
159
|
-
bot: FirebotAccount;
|
|
160
|
-
}
|
|
161
|
-
export interface PluginWebServerApi {
|
|
162
|
-
/**
|
|
163
|
-
* Send 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
|
-
}
|
|
169
116
|
export interface PluginViewersApi {
|
|
170
117
|
/**
|
|
171
|
-
* Retrieve a Firebot user from the viewer database via their Twitch user ID
|
|
172
|
-
* Returns `undefined` if the viewer isn't in the database, or the viewer database is disabled.
|
|
118
|
+
* Retrieve a Firebot user from the viewer database via their Twitch user ID
|
|
173
119
|
* @param userId The viewer's Twitch user ID
|
|
120
|
+
* @returns A {@linkcode FirebotViewer} with the specified user ID, or `undefined` if the viewer isn't in the database or the viewer database is disabled
|
|
174
121
|
*/
|
|
175
122
|
getViewerByUserId(userId: string): Promise<FirebotViewer>;
|
|
176
123
|
/**
|
|
177
|
-
* Retrieve a Firebot user from the viewer database via their Twitch username
|
|
178
|
-
* Returns `undefined` if the viewer isn't in the database, or the viewer database is disabled.
|
|
124
|
+
* Retrieve a Firebot user from the viewer database via their Twitch username
|
|
179
125
|
* @param username The viewer's Twitch username
|
|
126
|
+
* @returns A {@linkcode FirebotViewer} with the specified username, or `undefined` if the viewer isn't in the database or the viewer database is disabled
|
|
180
127
|
*/
|
|
181
128
|
getViewerByUsername(username: string): Promise<FirebotViewer>;
|
|
182
129
|
/**
|
|
@@ -184,6 +131,7 @@ export interface PluginViewersApi {
|
|
|
184
131
|
* @param userId The viewer's Twitch user ID
|
|
185
132
|
* @param key Key of the metadata value to get
|
|
186
133
|
* @param propertyPath (Optional) Dot-notated property path
|
|
134
|
+
* @returns A `Promise` with the value, or `null` if it doesn't exist
|
|
187
135
|
*/
|
|
188
136
|
getViewerMetadataValue(userId: string, key: string, propertyPath: string): Promise<unknown>;
|
|
189
137
|
/**
|
|
@@ -204,91 +152,277 @@ export interface PluginViewersApi {
|
|
|
204
152
|
export interface PluginCurrencyApi {
|
|
205
153
|
/**
|
|
206
154
|
* Get an array of all currencies
|
|
155
|
+
* @returns An array of {@linkcode Currency}
|
|
207
156
|
*/
|
|
208
157
|
getAllCurrencies(): Array<Currency>;
|
|
209
158
|
/**
|
|
210
159
|
* Get a specific currency by its ID
|
|
211
|
-
* @param id ID of the currency
|
|
160
|
+
* @param id ID of the currency to get
|
|
161
|
+
* @returns The {@linkcode Currency} with the given ID, or `null` if it doesn't exist
|
|
212
162
|
*/
|
|
213
163
|
getCurrencyById(id: string): Currency;
|
|
214
164
|
/**
|
|
215
165
|
* Get a specific currency by its name
|
|
216
|
-
* @param name Name of the currency
|
|
166
|
+
* @param name Name of the currency to get
|
|
167
|
+
* @returns The {@linkcode Currency} with the given name, or `null` if it doesn't exist
|
|
217
168
|
*/
|
|
218
169
|
getCurrencyByName(name: string): Currency;
|
|
219
170
|
/**
|
|
220
171
|
* Get the amount of a viewer's currency
|
|
221
172
|
* @param userId The viewer's Twitch user ID
|
|
222
|
-
* @param currencyId The ID of the currency
|
|
173
|
+
* @param currencyId The ID of the currency to get
|
|
174
|
+
* @returns A `Promise` with the total of the specified currency the viewer currently has
|
|
223
175
|
*/
|
|
224
176
|
getViewerCurrency(userId: string, currencyId: string): Promise<number>;
|
|
225
177
|
/**
|
|
226
178
|
* Add to or subtract from a viewer's currency
|
|
227
179
|
* @param userId The viewer's Twitch user ID
|
|
228
|
-
* @param currencyId The ID of the currency
|
|
180
|
+
* @param currencyId The ID of the currency to adjust
|
|
229
181
|
* @param amount An amount to add to the specified currency for the viewer. Negative values will subtract that amount.
|
|
182
|
+
* @returns A `Promise` indicating if the adjustment to the viewer's currency was successful
|
|
230
183
|
*/
|
|
231
184
|
addOrSubtractViewerCurrency(userId: string, currencyId: string, amount: number): Promise<boolean>;
|
|
232
185
|
/**
|
|
233
186
|
* Set a viewer's currency to a specific amount
|
|
234
187
|
* @param userId The viewer's Twitch user ID
|
|
235
|
-
* @param currencyId The ID of the currency
|
|
188
|
+
* @param currencyId The ID of the currency to set
|
|
236
189
|
* @param amount The total amount of the specified currency the viewer should have
|
|
190
|
+
* @returns A `Promise` indicating if setting the viewer's currency was successful
|
|
237
191
|
*/
|
|
238
192
|
setViewerCurrency(userId: string, currencyId: string, amount: number): Promise<boolean>;
|
|
239
193
|
/**
|
|
240
|
-
* Get an array of viewers with
|
|
194
|
+
* Get an array of viewers with the highest amounts of a specific currency
|
|
241
195
|
* @param currencyId The ID of the currency
|
|
242
196
|
* @param count The total number of viewers to retrieve
|
|
197
|
+
* @returns A `Promise` with an array of {@linkcode FirebotViewer} representing the
|
|
198
|
+
* viewers that possess the specified currency, sorted by highest amount first
|
|
243
199
|
*/
|
|
244
200
|
getCurrencyLeaderboard(currencyId: string, count: number): Promise<Array<FirebotViewer>>;
|
|
245
201
|
}
|
|
202
|
+
export interface PluginTwitchApi {
|
|
203
|
+
/** The full Twitch API surface. See {@linkcode TwitchApi}. */
|
|
204
|
+
api: typeof TwitchApi;
|
|
205
|
+
}
|
|
206
|
+
export interface PluginParametersApi {
|
|
207
|
+
/**
|
|
208
|
+
* Get all parameter values for this plugin
|
|
209
|
+
* @returns A `Record<string, unknown>` containing the parameter names and their values
|
|
210
|
+
*/
|
|
211
|
+
getAll<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
212
|
+
}
|
|
213
|
+
export interface PluginFrontendCommunicatorApi {
|
|
214
|
+
/**
|
|
215
|
+
* Send a synchronous event to the frontend
|
|
216
|
+
* @param eventName Name of the event to send
|
|
217
|
+
* @param (Optional) Any data to send with the event
|
|
218
|
+
*/
|
|
219
|
+
send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
|
|
220
|
+
/**
|
|
221
|
+
* Send an asynchronous event to the frontend and await the reply it sends
|
|
222
|
+
* back
|
|
223
|
+
* @param eventName Name of the event to send
|
|
224
|
+
* @param (Optional) Any data to send with the event
|
|
225
|
+
* @returns A `Promise` with any response data received
|
|
226
|
+
*/
|
|
227
|
+
fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
|
|
228
|
+
}
|
|
229
|
+
export interface PluginMessageEvent<TPayload = unknown> {
|
|
230
|
+
/** The pluginId of the plugin that sent the message */
|
|
231
|
+
sender: string;
|
|
232
|
+
/** The provided payload */
|
|
233
|
+
payload: TPayload;
|
|
234
|
+
}
|
|
235
|
+
export interface ScopedIpc {
|
|
236
|
+
/**
|
|
237
|
+
* Broadcast a message on a channel
|
|
238
|
+
* @param channel Name of the channel to send on
|
|
239
|
+
* @param data Data to send with the message
|
|
240
|
+
*/
|
|
241
|
+
emit(channel: string, data: unknown): void;
|
|
242
|
+
/**
|
|
243
|
+
* Listen for messages on a channel
|
|
244
|
+
* @param channel Name of the channel to listen on
|
|
245
|
+
* @param callback A function that will get executed when a message is received
|
|
246
|
+
* @returns An `unsubscribe` function
|
|
247
|
+
*/
|
|
248
|
+
on<TPayload = unknown>(channel: string, callback: (event: PluginMessageEvent<TPayload>) => void): () => void;
|
|
249
|
+
/**
|
|
250
|
+
* Remove a previously registered {@linkcode on} listener
|
|
251
|
+
* @param channel Name of the channel to stop listening on
|
|
252
|
+
* @param callback The function that was used during registration
|
|
253
|
+
*/
|
|
254
|
+
off(channel: string, callback: (...args: never[]) => void): void;
|
|
255
|
+
/**
|
|
256
|
+
* Send a request on a channel and await a response. Rejects if
|
|
257
|
+
* no handler responds within a 10s timeout or if the handler throws.
|
|
258
|
+
* @param channel Name of the channel to invoke on
|
|
259
|
+
* @param data (Optional) Any data to send along with the request
|
|
260
|
+
* @returns A `Promise` with any response data received
|
|
261
|
+
*/
|
|
262
|
+
invoke<TRequestPayload = unknown, TResponseData = unknown>(channel: string, data?: TRequestPayload): Promise<TResponseData>;
|
|
263
|
+
/**
|
|
264
|
+
* Register the handler for a request channel
|
|
265
|
+
* @param channel Name of the channel to listen on
|
|
266
|
+
* @param handlerFn A function that is executed when a request
|
|
267
|
+
* is invoked on the specified channel using {@linkcode invoke}
|
|
268
|
+
*/
|
|
269
|
+
handle<TRequestPayload = unknown, TResponseData = unknown>(channel: string, handlerFn: (payload: TRequestPayload, sender: string) => Promise<TResponseData> | TResponseData): void;
|
|
270
|
+
}
|
|
271
|
+
export interface PluginNotificationsApi {
|
|
272
|
+
/**
|
|
273
|
+
* Create a new notification
|
|
274
|
+
* @param notification The notification to add
|
|
275
|
+
* @param permanentlySave (Optional) Set as `true` to persist the notification across Firebot restarts
|
|
276
|
+
* @returns The {@linkcode Notification} that was created
|
|
277
|
+
*/
|
|
278
|
+
add(notification: Pick<Notification, "title" | "message" | "type" | "metadata">, permanentlySave?: boolean): Notification;
|
|
279
|
+
/**
|
|
280
|
+
* Look up one of this plugin's notifications by ID
|
|
281
|
+
* @param id ID of the notification to retrieve
|
|
282
|
+
* @returns The {@linkcode Notification} with the given ID, or `null` if it doesn't exist
|
|
283
|
+
*/
|
|
284
|
+
get(id: string): Notification | null;
|
|
285
|
+
/**
|
|
286
|
+
* All notifications owned by this plugin
|
|
287
|
+
* @returns An array of {@linkcode Notification}
|
|
288
|
+
*/
|
|
289
|
+
getAll(): Array<Notification>;
|
|
290
|
+
/**
|
|
291
|
+
* Delete one of this plugin's notifications by ID
|
|
292
|
+
* @param id ID of the notification to delete
|
|
293
|
+
*/
|
|
294
|
+
delete(id: string): void;
|
|
295
|
+
/** Delete all of this plugin's notifications */
|
|
296
|
+
clearAll(): void;
|
|
297
|
+
}
|
|
298
|
+
export interface PluginPluginsApi {
|
|
299
|
+
/**
|
|
300
|
+
* Get a list of plugins currently installed by the user
|
|
301
|
+
* @returns A `Promise` with an array of {@linkcode InstalledPlugin} objects
|
|
302
|
+
*/
|
|
303
|
+
getInstalledPlugins(): Promise<Array<InstalledPlugin>>;
|
|
304
|
+
}
|
|
305
|
+
export interface PluginWebServerApi {
|
|
306
|
+
/**
|
|
307
|
+
* Send a custom event over the internal Firebot WebSocket server
|
|
308
|
+
* @param name Name of the event to send. Full event name will be `custom-event:{name}`
|
|
309
|
+
* @param data (Optional) Any data you would like to send with the event
|
|
310
|
+
*/
|
|
311
|
+
sendWebSocketEvent(name: string, data?: unknown): void;
|
|
312
|
+
/**
|
|
313
|
+
* Create a resource token for a file to be retrieved via the internal HTTP server (e.g. in an overlay).
|
|
314
|
+
* The URL format for retrieval is: `http://localhost:7472/resource/{token}`
|
|
315
|
+
* @param path Full file path of the resource
|
|
316
|
+
* @param ttl (Optional) Time (in seconds) to retain the resource token once it is retrieved the first time.
|
|
317
|
+
* Setting this to `null`/`undefined` will retain the token until Firebot exits.
|
|
318
|
+
* @returns A token representing the resource
|
|
319
|
+
*/
|
|
320
|
+
createResourceToken(path: string, ttl?: number): string;
|
|
321
|
+
}
|
|
322
|
+
export interface PluginWebhooksApi {
|
|
323
|
+
/**
|
|
324
|
+
* Look up a webhook by name
|
|
325
|
+
* @param name Name of the webhook
|
|
326
|
+
* @return The {@linkcode PluginWebhook} with the given name, or `null` if it doesn't exist
|
|
327
|
+
*/
|
|
328
|
+
get(name: string): PluginWebhook | null;
|
|
329
|
+
/**
|
|
330
|
+
* Get all webhooks owned by this plugin
|
|
331
|
+
* @returns An array of {@linkcode PluginWebhook}
|
|
332
|
+
*/
|
|
333
|
+
list(): Array<PluginWebhook>;
|
|
334
|
+
/**
|
|
335
|
+
* Get the public URL for a webhook by name
|
|
336
|
+
* @param name Name of the webhook
|
|
337
|
+
* @returns The webhook's URL, or `null` if it doesn't exist
|
|
338
|
+
*/
|
|
339
|
+
getUrl(name: string): string | null;
|
|
340
|
+
}
|
|
246
341
|
export interface PluginVariableFactoryApi {
|
|
342
|
+
/**
|
|
343
|
+
* Create a basic replace variable based on an event metadata value
|
|
344
|
+
* @param config Configuration data for the new variable
|
|
345
|
+
* @returns A {@linkcode ReplaceVariable} based on the specified config data
|
|
346
|
+
*/
|
|
247
347
|
createEventDataVariable(config: VariableConfig): ReplaceVariable;
|
|
248
348
|
}
|
|
249
349
|
export interface PluginEventFilterFactoryApi {
|
|
350
|
+
/**
|
|
351
|
+
* Create a basic event filter based on a text value
|
|
352
|
+
* @param config Configuration data for the new filter
|
|
353
|
+
* @returns An {@linkcode EventFilter} based on the specified config data
|
|
354
|
+
*/
|
|
250
355
|
createTextFilter(config: TextFilterConfig): EventFilter;
|
|
356
|
+
/**
|
|
357
|
+
* Create a basic event filter based on a numeric value
|
|
358
|
+
* @param config Configuration data for the new filter
|
|
359
|
+
* @returns An {@linkcode EventFilter} based on the specified config data
|
|
360
|
+
*/
|
|
251
361
|
createNumberFilter(config: FilterConfig): EventFilter;
|
|
362
|
+
/**
|
|
363
|
+
* Create a basic event filter based on either a text or numeric value
|
|
364
|
+
* @param config Configuration data for the new filter
|
|
365
|
+
* @returns An {@linkcode EventFilter} based on the specified config data
|
|
366
|
+
*/
|
|
252
367
|
createTextOrNumberFilter(config: TextFilterConfig): EventFilter;
|
|
368
|
+
/**
|
|
369
|
+
* Create a basic event filter based on a list of preset values
|
|
370
|
+
* @param config Configuration data for the new filter
|
|
371
|
+
* @returns An {@linkcode EventFilter} based on the specified config data
|
|
372
|
+
*/
|
|
253
373
|
createPresetFilter(config: PresetFilterConfig): EventFilter;
|
|
254
374
|
}
|
|
255
375
|
export interface FirebotPluginApi {
|
|
256
|
-
/** Running Firebot version, e.g. `"5.67.0"
|
|
376
|
+
/** Running Firebot version, e.g. `"5.67.0"` */
|
|
257
377
|
version: string;
|
|
258
|
-
/** The streamer and bot accounts currently in use
|
|
378
|
+
/** The user's streamer and bot accounts currently in use */
|
|
259
379
|
accounts: Accounts;
|
|
260
|
-
/**
|
|
380
|
+
/** A scoped logger */
|
|
261
381
|
logger: PluginLoggerApi;
|
|
262
|
-
/** Access to Firebot settings
|
|
382
|
+
/** Access to Firebot settings */
|
|
263
383
|
settings: PluginSettingsApi;
|
|
264
|
-
/**
|
|
265
|
-
|
|
266
|
-
|
|
384
|
+
/**
|
|
385
|
+
* Simple per-plugin storage scoped to the plugin's data directory.
|
|
386
|
+
* Provides helpers for storing/loading JSON values
|
|
387
|
+
* plus generic file read/write for anything else.
|
|
388
|
+
*/
|
|
267
389
|
storage: PluginStorageApi;
|
|
268
|
-
/** Subscribe to and trigger Firebot events
|
|
390
|
+
/** Subscribe to and trigger Firebot events */
|
|
269
391
|
events: PluginEventsApi;
|
|
270
|
-
/** Run effect lists
|
|
392
|
+
/** Run effect lists */
|
|
271
393
|
effects: PluginEffectsApi;
|
|
272
394
|
/** Access to the viewer database, including viewer metadata */
|
|
273
395
|
viewers: PluginViewersApi;
|
|
274
396
|
/** Access to currencies, including viewer currency amounts and leaderboards */
|
|
275
397
|
currency: PluginCurrencyApi;
|
|
276
|
-
/** Access to Firebot's Twitch API wrappers (Helix, chat, auth, etc)
|
|
398
|
+
/** Access to Firebot's Twitch API wrappers (Helix, chat, auth, etc) */
|
|
277
399
|
twitch: PluginTwitchApi;
|
|
278
|
-
/**
|
|
400
|
+
/**
|
|
401
|
+
* Access to this plugin's saved parameter values (the settings configured by
|
|
402
|
+
* the user)
|
|
403
|
+
*/
|
|
279
404
|
parameters: PluginParametersApi;
|
|
280
|
-
/**
|
|
405
|
+
/**
|
|
406
|
+
* Two-way messaging between the plugin and the Firebot frontend, including
|
|
407
|
+
* UI Extensions
|
|
408
|
+
*/
|
|
281
409
|
frontendCommunicator: PluginFrontendCommunicatorApi;
|
|
282
|
-
/**
|
|
410
|
+
/**
|
|
411
|
+
* Plugin-to-plugin messaging. Supports both fire-and-forget (`emit`/`on`/`off`)
|
|
412
|
+
* and request/response (`invoke`/`handle`) messaging over a shared event bus,
|
|
413
|
+
* based on Electron's IPC.
|
|
414
|
+
*/
|
|
283
415
|
messaging: ScopedIpc;
|
|
284
|
-
/**
|
|
416
|
+
/** In-app user notifications owned by this plugin */
|
|
285
417
|
notifications: PluginNotificationsApi;
|
|
286
|
-
/** Access to installed plugins
|
|
418
|
+
/** Access to installed plugins */
|
|
287
419
|
plugins: PluginPluginsApi;
|
|
288
|
-
/** Firebot internal web server functions
|
|
420
|
+
/** Firebot internal web server functions */
|
|
289
421
|
webServer: PluginWebServerApi;
|
|
290
|
-
/**
|
|
422
|
+
/** Webhooks owned by this plugin */
|
|
423
|
+
webhooks: PluginWebhooksApi;
|
|
424
|
+
/** Factory functions for creating basic replace variables */
|
|
291
425
|
variableFactory: PluginVariableFactoryApi;
|
|
292
|
-
/** Factory for creating event filters
|
|
426
|
+
/** Factory functions for creating basic event filters */
|
|
293
427
|
eventFilterFactory: PluginEventFilterFactoryApi;
|
|
294
428
|
}
|
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,7 +11,7 @@ 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>;
|
|
@@ -96,9 +96,21 @@ export interface ManifestFirebotVersion {
|
|
|
96
96
|
patch?: number;
|
|
97
97
|
}
|
|
98
98
|
export interface Manifest {
|
|
99
|
+
/**
|
|
100
|
+
* Name of the plugin
|
|
101
|
+
*/
|
|
99
102
|
name: string;
|
|
103
|
+
/**
|
|
104
|
+
* Version of the plugin
|
|
105
|
+
*/
|
|
100
106
|
version: string;
|
|
107
|
+
/**
|
|
108
|
+
* Author of the plugin
|
|
109
|
+
*/
|
|
101
110
|
author: string;
|
|
111
|
+
/**
|
|
112
|
+
* Description of the plugin
|
|
113
|
+
*/
|
|
102
114
|
description: string | ManifestDescription;
|
|
103
115
|
/**
|
|
104
116
|
* An array of strings that describe or categorize your plugin
|
|
@@ -109,8 +121,8 @@ export interface Manifest {
|
|
|
109
121
|
*/
|
|
110
122
|
repo?: string;
|
|
111
123
|
/**
|
|
112
|
-
* A link to the plugin's website
|
|
113
|
-
*
|
|
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.
|
|
114
126
|
*/
|
|
115
127
|
website?: string;
|
|
116
128
|
/**
|
|
@@ -118,7 +130,13 @@ export interface Manifest {
|
|
|
118
130
|
* If the repo is on GitHub and support is not specified, it will default to the GitHub issues URL.
|
|
119
131
|
*/
|
|
120
132
|
support?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The lowest Firebot version this plugin is compatible with
|
|
135
|
+
*/
|
|
121
136
|
minimumFirebotVersion?: ManifestFirebotVersion;
|
|
137
|
+
/**
|
|
138
|
+
* The highest Firebot version this plugin is compatible with
|
|
139
|
+
*/
|
|
122
140
|
maximumFirebotVersion?: ManifestFirebotVersion;
|
|
123
141
|
/**
|
|
124
142
|
* The icon to be displayed for the plugin.
|
|
@@ -126,7 +144,13 @@ export interface Manifest {
|
|
|
126
144
|
icon?: PluginIcon;
|
|
127
145
|
}
|
|
128
146
|
export interface PluginBase<Params extends FirebotParams = FirebotParams> {
|
|
147
|
+
/**
|
|
148
|
+
* Basic information about the plugin
|
|
149
|
+
*/
|
|
129
150
|
manifest: Manifest;
|
|
151
|
+
/**
|
|
152
|
+
* Defines the user-specified parameters for this plugin
|
|
153
|
+
*/
|
|
130
154
|
parametersSchema?: FirebotParameterArray<Params>;
|
|
131
155
|
}
|
|
132
156
|
export interface Plugin<Params extends FirebotParams = FirebotParams> extends PluginBase<Params> {
|
|
@@ -151,10 +175,11 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Pl
|
|
|
151
175
|
uiExtensions?: DynamicArray<UIExtension>;
|
|
152
176
|
overlayWidgets?: DynamicArray<OverlayWidgetType<any, any>>;
|
|
153
177
|
httpRoutes?: DynamicObject<PluginHttpRouteDefinition>;
|
|
154
|
-
websocketListener?: DynamicObject<
|
|
178
|
+
websocketListener?: DynamicObject<PluginWebSocketHandler>;
|
|
155
179
|
webhooks?: DynamicObject<PluginWebhooks>;
|
|
156
180
|
additionalEffectEvents?: DynamicArray<PluginAdditionalEffectEvents>;
|
|
157
181
|
additionalVariableEvents?: DynamicArray<PluginAdditionalVariableEvents>;
|
|
182
|
+
additionalFilterEvents?: DynamicArray<PluginAdditionalFilterEvents>;
|
|
158
183
|
};
|
|
159
184
|
/** Called when the plugin is loaded */
|
|
160
185
|
onLoad?: (context: PluginContext<Params>, isInstalling?: boolean) => NoResult;
|
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
|
};
|