@crowbartools/firebot-types 5.67.0-alpha27 → 5.67.0-alpha29

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.
@@ -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;
@@ -101,6 +101,7 @@ declare class PluginManager {
101
101
  private loadPluginIsolated;
102
102
  private isValidPlugin;
103
103
  private searchForCommunityPlugins;
104
+ private trackCommunityPluginDownload;
104
105
  private downloadAndSaveCommunityPlugin;
105
106
  private installCommunityPlugin;
106
107
  private updateCommunityPlugin;
@@ -2,6 +2,7 @@ declare class TwitchEventSubClient {
2
2
  private logger;
3
3
  private _eventSubListener;
4
4
  private _subscriptions;
5
+ private ensureViewerExists;
5
6
  private createSubscriptions;
6
7
  createClient(): void;
7
8
  removeSubscriptions(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowbartools/firebot-types",
3
- "version": "5.67.0-alpha27",
3
+ "version": "5.67.0-alpha29",
4
4
  "description": "Type definitions and plugin API for Firebot plugins.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -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, CustomWebSocketHandler, Awaitable } from "../types";
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: CustomWebSocketHandler["handler"]): boolean;
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 { CustomWebSocketHandler, WidgetOverlayEvent } from "../types";
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 customHandlers;
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: CustomWebSocketHandler["handler"]): boolean;
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>;
@@ -26,6 +26,7 @@ export type BaseParameter = {
26
26
  pattern?: string;
27
27
  };
28
28
  default?: unknown;
29
+ allowReplaceVariables?: boolean;
29
30
  };
30
31
  export type StringParameter = BaseParameter & {
31
32
  type: "string";