@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.
Files changed (43) hide show
  1. package/LICENSE +674 -674
  2. package/backend/chat/active-user-handler.d.ts +7 -1
  3. package/backend/chat/frontend-chat-manager.d.ts +36 -0
  4. package/backend/common/connection-manager.d.ts +40 -0
  5. package/backend/common/profile-manager.d.ts +3 -0
  6. package/backend/core/update-manager.d.ts +16 -0
  7. package/backend/currency/currency-manager.d.ts +1 -0
  8. package/backend/effects/builtin/overlay-widgets/update-rotating-text.d.ts +12 -0
  9. package/backend/events/activity-feed-manager.d.ts +8 -1
  10. package/backend/events/event-manager.d.ts +1 -1
  11. package/backend/overlay-widgets/builtin-types/index.d.ts +3 -3
  12. package/backend/overlay-widgets/builtin-types/rotating-text/rotating-text.d.ts +18 -0
  13. package/backend/plugins/executors/plugin-executor.interface.d.ts +2 -1
  14. package/backend/plugins/plugin-api/namespaces/currency.d.ts +2 -0
  15. package/backend/plugins/plugin-api/namespaces/viewers.d.ts +2 -0
  16. package/backend/plugins/plugin-manager.d.ts +19 -7
  17. package/backend/roles/twitch-roles-manager.d.ts +4 -0
  18. package/backend/streaming-platforms/twitch/api/eventsub/eventsub-chat-helpers.d.ts +1 -0
  19. package/backend/streaming-platforms/twitch/api/eventsub/eventsub-client.d.ts +1 -0
  20. package/backend/streaming-platforms/twitch/api/resource/moderation.d.ts +1 -1
  21. package/backend/streaming-platforms/twitch/events/bits.d.ts +1 -1
  22. package/backend/ui-extensions/ui-extension-manager.d.ts +4 -2
  23. package/backend/utils/index.d.ts +1 -0
  24. package/backend/utils/versions.d.ts +9 -0
  25. package/backend/viewers/viewer-database.d.ts +3 -1
  26. package/backend/viewers/viewer-metadata-manager.d.ts +3 -0
  27. package/backend/viewers/viewer-online-status-manager.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/server/http-server-manager.d.ts +2 -2
  30. package/server/websocket-server-manager.d.ts +5 -3
  31. package/shared/compare-versions.d.ts +21 -0
  32. package/types/chat.d.ts +76 -0
  33. package/types/events.d.ts +9 -0
  34. package/types/integrations.d.ts +1 -2
  35. package/types/overlay-widgets.d.ts +1 -0
  36. package/types/parameters.d.ts +1 -0
  37. package/types/plugin-api.d.ts +306 -89
  38. package/types/plugins.d.ts +55 -32
  39. package/types/ui/modal-factory.d.ts +9 -0
  40. package/types/ui-extensions.d.ts +3 -1
  41. package/types/viewers.d.ts +9 -0
  42. package/types/websocket.d.ts +12 -1
  43. package/backend/chat/frontend-chat-helpers.d.ts +0 -14
@@ -27,12 +27,17 @@ type Events = {
27
27
  "user:offline": (userId: string) => void;
28
28
  };
29
29
  declare class ActiveUserHandler extends TypedEmitter<Events> {
30
- private logger;
30
+ private _logger;
31
+ private _cachedFrontendViewers;
31
32
  private readonly DEFAULT_ACTIVE_TIMEOUT;
32
33
  private readonly ONLINE_TIMEOUT;
33
34
  private _onlineUsers;
34
35
  private _activeUsers;
35
36
  constructor();
37
+ private sendViewerUpdateToFrontend;
38
+ private updateViewerActiveStatus;
39
+ updateOnlineViewerRoles(userId: string, roles: string[]): void;
40
+ private setUserOffline;
36
41
  /**
37
42
  * Check if user is active
38
43
  * @param usernameOrId Twitch username or user ID
@@ -50,6 +55,7 @@ declare class ActiveUserHandler extends TypedEmitter<Events> {
50
55
  addActiveUser(chatUser: ChatUser, includeInOnline?: boolean, forceActive?: boolean): Promise<void>;
51
56
  removeActiveUser(usernameOrId: string | number): void;
52
57
  clearAllActiveUsers(): void;
58
+ triggerUiRefresh(): void;
53
59
  }
54
60
  declare const handler: ActiveUserHandler;
55
61
  export { handler as ActiveUserHandler };
@@ -0,0 +1,36 @@
1
+ import type { DashboardChatFeedPowerUpData, DashboardChatFeedRewardData, FirebotChatMessage } from "../../types";
2
+ declare class FrontendChatManager {
3
+ private _logger;
4
+ private _chatFeedCache;
5
+ private _chatFeedCacheLimit;
6
+ private _pendingOverlayMessageCache;
7
+ constructor();
8
+ private addNewChatFeedItem;
9
+ private sendUpdatedFeedItemToDashboard;
10
+ sendAlertToDashboard(message: string, icon?: string): void;
11
+ sendRewardRedemptionToDashboard(redemption: DashboardChatFeedRewardData): void;
12
+ sendPowerUpRedemptionToDashboard(redemption: DashboardChatFeedPowerUpData): void;
13
+ private sendChatMessageToDashboard;
14
+ private sendChatMessageToChatWidget;
15
+ sendChatMessageToFrontend(chatMessage: FirebotChatMessage): void;
16
+ private deleteChatMessageFromDashboard;
17
+ private deleteChatMessageFromChatWidget;
18
+ deleteChatMessageFromFrontend(messageId: string, animate?: boolean): void;
19
+ private deleteUserMessagesFromDashboard;
20
+ deleteUserMessagesFromFrontend(username: string): void;
21
+ private clearDashboardChatFeed;
22
+ clearChatFeed(moderatorUsername: string): void;
23
+ private expireAutomodForChatMessage;
24
+ updateChatMessageAutomodStatus(messageId: string, newStatus: FirebotChatMessage["autoModStatus"], resolverName: string): void;
25
+ setChatMessageAutomodError(messageId: string, likelyExpired: boolean): void;
26
+ addCustomHighlightToDashboardChatMessage(highlightData: {
27
+ messageId: string;
28
+ customHighlightColor: string;
29
+ customBannerIcon: string;
30
+ customBannerText: string;
31
+ }): void;
32
+ hideChatMessageFromDashboard(messageId: string): void;
33
+ triggerUiRefresh(): void;
34
+ }
35
+ declare const manager: FrontendChatManager;
36
+ export { manager as FrontendChatManager };
@@ -0,0 +1,40 @@
1
+ import { TypedEmitter } from "tiny-typed-emitter";
2
+ import type { HelixStream } from "@twurple/api";
3
+ import { ConnectionState } from "../../shared/connection-constants";
4
+ type ServiceConnectionEventData = {
5
+ serviceId: string;
6
+ connectionState: ConnectionState;
7
+ };
8
+ type ServiceConnectionUpdateRequest = {
9
+ id: string;
10
+ action: boolean | "toggle";
11
+ };
12
+ type ConnectionManagerEvents = {
13
+ "streamerOnlineChange": (isOnline: boolean, stream: HelixStream) => void;
14
+ "service-connection-update": (event: ServiceConnectionEventData) => void;
15
+ };
16
+ declare class ConnectionManager extends TypedEmitter<ConnectionManagerEvents> {
17
+ private _logger;
18
+ private _currentStream;
19
+ private _onlineCheckIntervalId;
20
+ private _serviceConnectionStates;
21
+ private _connectionUpdateInProgress;
22
+ private _currentlyWaitingService;
23
+ constructor();
24
+ private onServiceConnectionUpdated;
25
+ private checkOnline;
26
+ startOnlineCheckInterval(): void;
27
+ get streamerIsOnline(): boolean;
28
+ get currentStream(): HelixStream | null;
29
+ get chatIsConnected(): boolean;
30
+ serviceIsConnected(serviceId: string): boolean;
31
+ private connectSidebarControlledServices;
32
+ private disconnectSidebarControlledServices;
33
+ updateChatConnection(shouldConnect: boolean): boolean;
34
+ updateIntegrationConnection(integrationId: string, shouldConnect: boolean): boolean;
35
+ updateServiceConnection(serviceId: string, shouldConnect: boolean): boolean;
36
+ updateConnectionForServices(services: ServiceConnectionUpdateRequest[]): Promise<void>;
37
+ triggerUiRefresh(): void;
38
+ }
39
+ declare const manager: ConnectionManager;
40
+ export { manager as ConnectionManager };
@@ -17,6 +17,9 @@ declare class ProfileManager {
17
17
  deletePathInProfile(filePath: string): void;
18
18
  getNewProfileName: () => string;
19
19
  hasProfileRename: () => boolean;
20
+ private getAccountInfo;
21
+ private getProfileDataForFrontend;
22
+ triggerUiRefresh(): void;
20
23
  }
21
24
  declare const manager: ProfileManager;
22
25
  export { manager as ProfileManager };
@@ -0,0 +1,16 @@
1
+ declare class UpdateManager {
2
+ private _logger;
3
+ private _octokit;
4
+ private _isCheckingForUpdates;
5
+ private _hasCheckedForUpdates;
6
+ private _updateDownloaded;
7
+ private _updateData;
8
+ constructor();
9
+ private shouldAutoUpdate;
10
+ private checkForUpdate;
11
+ private downloadUpdate;
12
+ private installUpdate;
13
+ triggerUiRefresh(): void;
14
+ }
15
+ declare const manager: UpdateManager;
16
+ export { manager as UpdateManager };
@@ -24,6 +24,7 @@ declare class CurrencyManager {
24
24
  adjustCurrencyForAllViewers(currencyId: string, value: string | number, ignoreDisable?: boolean, adjustType?: string): Promise<void>;
25
25
  addCurrencyToAllViewers(currencyId: string, value: number): Promise<void>;
26
26
  getViewerCurrencyAmount(username: string, currencyId: string): Promise<number>;
27
+ getViewerCurrencyAmountByUserId(userId: string, currencyId: string): Promise<number>;
27
28
  getViewerCurrencies(usernameOrId: string, isUsername?: boolean): Promise<Record<string, number>>;
28
29
  getViewerCurrencyRank(currencyId: string, usernameOrId: string, isUsername?: boolean): Promise<number>;
29
30
  getTopCurrencyPosition(currencyId: string, position?: number): Promise<FirebotViewer>;
@@ -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;
@@ -1,9 +1,11 @@
1
1
  import type { EventDefinition } from "../../types";
2
2
  declare class ActivityFeedManager {
3
+ private _previousActivity;
4
+ private _logger;
3
5
  isUSLocale: boolean;
4
6
  timeFormat: string;
5
- private _previousActivity;
6
7
  constructor();
8
+ private formatActivityForFrontend;
7
9
  handleTriggeredEvent(source: {
8
10
  id: string;
9
11
  name: string;
@@ -13,6 +15,11 @@ declare class ActivityFeedManager {
13
15
  }): void;
14
16
  retriggerLastActivity(): void;
15
17
  private retriggerActivity;
18
+ private toggleActivityAcknowledged;
19
+ updateAcknowledgedForAll(acknowledged: boolean): void;
20
+ private toggleAcknowledgedForAll;
21
+ private clearAllActivities;
22
+ triggerUiRefresh(): void;
16
23
  }
17
24
  declare const manager: ActivityFeedManager;
18
25
  export { manager as ActivityFeedManager };
@@ -20,7 +20,7 @@ declare class EventManager extends TypedEmitter<{
20
20
  getEventById(sourceId: string, eventId: string): EventDefinition;
21
21
  getAllEventSources(): RegisteredEventSource[];
22
22
  getAllEvents(): EventDefinition[];
23
- triggerEvent(eventSourceId: string, eventId: string, meta: Record<string, unknown>, isManual?: boolean, isRetrigger?: boolean, isSimulation?: boolean): Promise<void>;
23
+ triggerEvent(eventSourceId: string, eventId: string, meta?: Record<string, unknown>, isManual?: boolean, isRetrigger?: boolean, isSimulation?: boolean): Promise<void>;
24
24
  }
25
25
  declare const manager: EventManager;
26
26
  export { manager as EventManager };
@@ -1,4 +1,4 @@
1
- declare const _default: (import("../../../types").OverlayWidgetType<{
1
+ declare const _default: (import("../../../types").OverlayWidgetType<import("./chat/chat").ChatWidgetSettings, import("./chat/chat").ChatWidgetState> | import("../../../types").OverlayWidgetType<import("./chat/chat-advanced").AdvancedChatWidgetSettings, import("./chat/chat").ChatWidgetState> | import("../../../types").OverlayWidgetType<{
2
2
  title?: string;
3
3
  titleFontOptions?: import("../../../types").FontOptions;
4
4
  barColor: string;
@@ -28,7 +28,7 @@ declare const _default: (import("../../../types").OverlayWidgetType<{
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";
@@ -44,5 +44,5 @@ declare const _default: (import("../../../types").OverlayWidgetType<{
44
44
  imageType: "local" | "url";
45
45
  filepath: string;
46
46
  url: string;
47
- }, {}> | import("../../../types").OverlayWidgetType<import("./chat/chat").ChatWidgetSettings, import("./chat/chat").ChatWidgetState> | import("../../../types").OverlayWidgetType<import("./chat/chat-advanced").AdvancedChatWidgetSettings, import("./chat/chat").ChatWidgetState> | import("../../../types").OverlayWidgetType<import("./twitch-poll/twitch-poll").PollSettings, import("./twitch-poll/twitch-poll").PollState> | import("../../../types").OverlayWidgetType<import("./twitch-prediction/twitch-prediction").PredictionSettings, import("./twitch-prediction/twitch-prediction").PredictionState>)[];
47
+ }, {}> | import("../../../types").OverlayWidgetType<import("./twitch-poll/twitch-poll").PollSettings, import("./twitch-poll/twitch-poll").PollState> | import("../../../types").OverlayWidgetType<import("./twitch-prediction/twitch-prediction").PredictionSettings, import("./twitch-prediction/twitch-prediction").PredictionState>)[];
48
48
  export default _default;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import type { PluginCurrencyApi } from "../../../../types/plugin-api";
2
+ export declare const createCurrencyApi: import("../internal/define-namespace").PluginApiNamespaceFactory<PluginCurrencyApi>;
@@ -0,0 +1,2 @@
1
+ import type { PluginViewersApi } from "../../../../types/plugin-api";
2
+ export declare const createViewersApi: import("../internal/define-namespace").PluginApiNamespaceFactory<PluginViewersApi>;
@@ -9,15 +9,26 @@ type GetPluginDetailsResult = {
9
9
  success: false;
10
10
  error: string;
11
11
  };
12
+ type PluginInstallResult = {
13
+ success: true;
14
+ installedPlugin: InstalledPlugin;
15
+ } | {
16
+ success: false;
17
+ error: string;
18
+ };
12
19
  declare class PluginManager {
20
+ private _logger;
13
21
  private startingPlugins;
14
22
  private activePlugins;
23
+ private updateCheckInterval;
24
+ private pendingUpdates;
15
25
  private pendingApiInstances;
16
26
  private requireInterceptorInstalled;
17
27
  private pluginExecutors;
18
28
  private legacyEffectScriptExecutor;
19
29
  constructor();
20
30
  migrateLegacyStartUpScriptsToPlugins(): Promise<void>;
31
+ triggerUiRefresh(): Promise<void>;
21
32
  startPlugin(pluginConfig: InstalledPluginConfig, installing?: boolean): Promise<void>;
22
33
  private doStartPlugin;
23
34
  startPlugins(): Promise<void>;
@@ -32,7 +43,7 @@ declare class PluginManager {
32
43
  * Handle a config change. Starts/stops as needed, and on a still-enabled plugin
33
44
  * either re-loads (if file may have changed) or invokes onParameterUpdate.
34
45
  */
35
- reloadPluginConfig(pluginConfig: InstalledPluginConfig, isNewInstall?: boolean): Promise<void>;
46
+ reloadPluginConfig(pluginConfig: InstalledPluginConfig): Promise<void>;
36
47
  setPluginEnabled(pluginId: string, enabled: boolean): Promise<void>;
37
48
  getInstalledPlugins(): Promise<InstalledPlugin[]>;
38
49
  private doGetPluginDetailsByFileName;
@@ -45,16 +56,11 @@ declare class PluginManager {
45
56
  * Validates a file at any path on disk and copies it into the scripts folder.
46
57
  * Does NOT persist an InstalledPluginConfig — caller does that on save.
47
58
  */
48
- installPluginFromPath(sourcePath: string, overwrite?: boolean): Promise<GetPluginDetailsResult | {
59
+ installPluginFromPath(sourcePath: string, overwrite?: boolean): Promise<PluginInstallResult | {
49
60
  success: false;
50
61
  error: string;
51
62
  conflict?: boolean;
52
63
  }>;
53
- /**
54
- * Delete a copied plugin file that the user cancelled installing, but only
55
- * when no config currently references it.
56
- */
57
- cancelInstall(fileName: string): Promise<void>;
58
64
  /**
59
65
  * Called by PluginConfigManager when a config is deleted, so we can stop the
60
66
  * plugin.
@@ -94,6 +100,12 @@ declare class PluginManager {
94
100
  */
95
101
  private loadPluginIsolated;
96
102
  private isValidPlugin;
103
+ private searchForCommunityPlugins;
104
+ private downloadAndSaveCommunityPlugin;
105
+ private installCommunityPlugin;
106
+ private updateCommunityPlugin;
107
+ startCommunityPluginUpdateCheck(): void;
108
+ private checkForCommunityPluginUpdates;
97
109
  }
98
110
  declare const pluginManager: PluginManager;
99
111
  export { pluginManager as PluginManager };
@@ -13,6 +13,7 @@ declare class TwitchRolesManager extends TypedEmitter<Events> {
13
13
  private _vips;
14
14
  private _moderators;
15
15
  private _subscribers;
16
+ private _subscribersLastLoadedAt;
16
17
  constructor();
17
18
  setupListeners(): void;
18
19
  loadVips(): Promise<void>;
@@ -24,7 +25,10 @@ declare class TwitchRolesManager extends TypedEmitter<Events> {
24
25
  addModeratorToModeratorsList(viewer: BasicViewer): void;
25
26
  removeModeratorFromModeratorsList(userId: string): void;
26
27
  loadSubscribers(): Promise<void>;
28
+ private getMinutesSinceSubscribersLoaded;
27
29
  getSubscribers(): Subscriber[];
30
+ addSubscriberToSubscribersList(userId: string, username: string, displayName: string, tier: string): void;
31
+ removeSubscriberFromSubscribersList(userId: string): void;
28
32
  private getRoleForSubTier;
29
33
  }
30
34
  declare const twitchRolesManager: TwitchRolesManager;
@@ -38,6 +38,7 @@ declare class TwitchEventSubChatHelpers {
38
38
  cacheThirdPartyEmotes(): Promise<void>;
39
39
  cacheCheermotes(): Promise<void>;
40
40
  cacheChatAssets(): Promise<void>;
41
+ private sendAllEmotesToFrontend;
41
42
  private _mapCachedEmotesForFrontend;
42
43
  private getEmoteUrl;
43
44
  private accountTaggedInText;
@@ -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;
@@ -1,5 +1,5 @@
1
1
  import { type HelixBan, type HelixModerator, type UserIdResolvable } from "@twurple/api";
2
- import type { BasicViewer } from '../../../../../types/viewers';
2
+ import type { BasicViewer } from '../../../../../types';
3
3
  import { ApiResourceBase } from './api-resource-base';
4
4
  import type { TwitchApi } from "../";
5
5
  type ModerationEvents = {
@@ -1,4 +1,4 @@
1
- import { EventSubChannelBitsUseMessagePart } from "../api/twurple-private-types";
1
+ import type { EventSubChannelBitsUseMessagePart } from "../api/twurple-private-types";
2
2
  export declare function triggerCheer(username: string, userId: string, userDisplayName: string, bits: number, totalBits: number, cheerMessage: string, cheerMessageParts: EventSubChannelBitsUseMessagePart[]): void;
3
3
  export declare function triggerBitsBadgeUnlock(username: string, userId: string, userDisplayName: string, message: string, badgeTier: number): void;
4
4
  export declare function triggerPowerupMessageEffect(username: string, userId: string, userDisplayName: string, bits: number, totalBits: number, cheerMessage: string): void;
@@ -2,10 +2,12 @@ import type { UIExtension } from "../../types";
2
2
  declare class UIExtensionManager {
3
3
  private _logger;
4
4
  private _extensions;
5
+ private _pendingRemovals;
6
+ private _pendingRegistrations;
5
7
  private uiReady;
6
- constructor();
7
8
  registerUIExtension(extension: UIExtension, pluginId?: string): boolean;
8
- private setUIReadyForExtensions;
9
+ queueUIExtensionRemoval(extensionId: string): void;
10
+ setUIReadyForExtensions(): void;
9
11
  private prepareExtensionForFrontend;
10
12
  private prepareFunc;
11
13
  }
@@ -14,3 +14,4 @@ export { pick } from "./pick";
14
14
  export { stringify } from "./stringify";
15
15
  export { getEventIdFromTriggerData } from "./trigger-data";
16
16
  export { getUrlRegex } from "./url";
17
+ export { meetsFirebotVersionRequirement } from "./versions";
@@ -0,0 +1,9 @@
1
+ import type { ManifestFirebotVersion } from "../../types";
2
+ /**
3
+ * Checks whether a given Firebot version meets the provided minimum and/or maximum version spec
4
+ * @param current Current Firebot version
5
+ * @param min Minimum required Firebot version
6
+ * @param max Maximum compatible Firebot version
7
+ * @returns `true` if the supplied current version is within the constraints, or `false` if not
8
+ */
9
+ export declare const meetsFirebotVersionRequirement: (current: ManifestFirebotVersion, min?: ManifestFirebotVersion, max?: ManifestFirebotVersion) => boolean;
@@ -1,6 +1,6 @@
1
1
  import { TypedEmitter } from "tiny-typed-emitter";
2
2
  import Datastore from "@seald-io/nedb";
3
- import type { BasicViewer, FirebotViewer, NewFirebotViewer, Rank, RankLadder } from "../../types";
3
+ import type { BasicViewer, FirebotViewer, FrontendViewer, NewFirebotViewer, Rank, RankLadder } from "../../types";
4
4
  interface ViewerDbChangePacket {
5
5
  userId: string;
6
6
  field: string;
@@ -40,6 +40,7 @@ interface UserDetails {
40
40
  twitchData: Record<string, unknown>;
41
41
  streamerFollowsUser: boolean;
42
42
  userFollowsStreamer: boolean;
43
+ pronouns: string;
43
44
  }
44
45
  declare class ViewerDatabase extends TypedEmitter<{
45
46
  "viewer-database-loaded": () => void;
@@ -47,6 +48,7 @@ declare class ViewerDatabase extends TypedEmitter<{
47
48
  userId: string;
48
49
  url: string;
49
50
  }) => void;
51
+ "frontend-viewer-updated": (viewer: FrontendViewer) => void;
50
52
  }> {
51
53
  private logger;
52
54
  private _db;
@@ -9,10 +9,13 @@ declare class ViewerMetadataManager extends TypedEmitter<Events> {
9
9
  private logger;
10
10
  constructor();
11
11
  getViewerMetadata(username: string, key: string, propertyPath: string): Promise<unknown>;
12
+ getViewerMetadataByUserId(userId: string, key: string, propertyPath?: string): Promise<unknown>;
12
13
  getTopMetadataPosition(metadataKey: string, position?: number): Promise<FirebotViewer>;
13
14
  getTopMetadata(metadataKey: string, count: number): Promise<FirebotViewer[]>;
14
15
  updateViewerMetadata(username: string, key: string, value: string, propertyPath?: string): Promise<void>;
16
+ setViewerMetadataByUserId(userId: string, key: string, value: string, propertyPath?: string): Promise<void>;
15
17
  removeViewerMetadata(username: string, key: string): Promise<void>;
18
+ deleteViewerMetadataByUserId(userId: string, key: string): Promise<void>;
16
19
  }
17
20
  declare const viewerMetadataManager: ViewerMetadataManager;
18
21
  export = viewerMetadataManager;
@@ -1,6 +1,6 @@
1
1
  import type { BasicViewer, FirebotViewer } from "../../types";
2
2
  declare class ViewerOnlineStatusManager {
3
- private logger;
3
+ private _logger;
4
4
  private _updateLastSeenIntervalId;
5
5
  private _updateTimeIntervalId;
6
6
  constructor();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowbartools/firebot-types",
3
- "version": "5.67.0-alpha26",
3
+ "version": "5.67.0-alpha28",
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 };
@@ -0,0 +1,21 @@
1
+ declare enum UpdateType {
2
+ NONE = "none",
3
+ PREVIOUS_VERSION = "previousversion",// 1.0.0 -> 1.1.0-beta,
4
+ PRERELEASE = "prerelease",// 1.0.0 -> 1.1.0-beta
5
+ OFFICIAL = "official",// 1.0.0-beta -> 1.0.0
6
+ PATCH = "patch",// 1.0.0 -> 1.0.1
7
+ MINOR = "minor",// 1.0.0 -> 1.1.0
8
+ MAJOR = "major",// 1.0.0 -> 2.0.0,
9
+ MAJOR_PRERELEASE = "majorprerelease"
10
+ }
11
+ interface VersionInfo {
12
+ major: number;
13
+ minor?: number;
14
+ patch?: number;
15
+ prereleaseTag?: string;
16
+ prereleaseVersion?: number;
17
+ nightlyVersion?: string;
18
+ }
19
+ declare function parseVersion(version: string): VersionInfo;
20
+ declare function compareVersions(newVersion: string, currentVersion: string): UpdateType;
21
+ export { UpdateType, parseVersion, compareVersions };
package/types/chat.d.ts CHANGED
@@ -51,6 +51,7 @@ export type FirebotParsedMessagePart = {
51
51
  export type FirebotChatMessage = {
52
52
  id: string;
53
53
  timestamp?: number;
54
+ timestampDisplay?: string;
54
55
  username: string;
55
56
  userId: string;
56
57
  userDisplayName?: string;
@@ -83,6 +84,9 @@ export type FirebotChatMessage = {
83
84
  isAutoModHeld?: boolean;
84
85
  autoModStatus?: "pending" | "approved" | "denied" | "expired";
85
86
  autoModReason?: string;
87
+ autoModHeldMessageId?: string;
88
+ autoModResolvedBy?: string;
89
+ autoModErrorMessage?: string;
86
90
  isFirstChat?: boolean;
87
91
  isReturningChatter?: boolean;
88
92
  isRaider?: boolean;
@@ -113,6 +117,12 @@ export type FirebotChatMessage = {
113
117
  cost: number;
114
118
  imageUrl: string;
115
119
  };
120
+ powerUp?: {
121
+ id: string;
122
+ name: string;
123
+ bits: number;
124
+ imageUrl: string;
125
+ };
116
126
  isGigantified?: boolean;
117
127
  };
118
128
  export type FirebotEmote = {
@@ -134,4 +144,70 @@ export type SharedChatParticipant = {
134
144
  broadcasterDisplayName: string;
135
145
  profilePictureUrl: string;
136
146
  };
147
+ type DashboardChatFeedItemType = "message" | "alert" | "reward-redemption" | "power-up-redemption";
148
+ type DashboardChatFeedItemBase = {
149
+ id: string;
150
+ type: DashboardChatFeedItemType;
151
+ };
152
+ export type DashboardChatMessageData = FirebotChatMessage & {
153
+ deleted?: boolean;
154
+ isHiddenFromChatFeed?: boolean;
155
+ customHighlightColor?: string;
156
+ customBannerIcon?: string;
157
+ customBannerText?: string;
158
+ };
159
+ export type DashboardChatFeedMessageItem = DashboardChatFeedItemBase & {
160
+ type: "message";
161
+ data: DashboardChatMessageData;
162
+ rewardMatched?: boolean;
163
+ powerUpMatched?: boolean;
164
+ };
165
+ export type DashboardChatFeedAlertItem = DashboardChatFeedItemBase & {
166
+ type: "alert";
167
+ message: string;
168
+ icon: string;
169
+ };
170
+ export type DashboardChatFeedRewardData = {
171
+ id: string;
172
+ status: string;
173
+ messageText: string;
174
+ user: {
175
+ id: string;
176
+ username: string;
177
+ displayName: string;
178
+ };
179
+ reward: {
180
+ id: string;
181
+ name: string;
182
+ cost: number;
183
+ imageUrl: string;
184
+ };
185
+ };
186
+ export type DashboardChatFeedRewardItem = DashboardChatFeedItemBase & {
187
+ type: "reward-redemption";
188
+ data: DashboardChatFeedRewardData;
189
+ rewardMatched?: boolean;
190
+ };
191
+ export type DashboardChatFeedPowerUpData = {
192
+ id: string;
193
+ status: string;
194
+ messageText: string;
195
+ user: {
196
+ id: string;
197
+ username: string;
198
+ displayName: string;
199
+ };
200
+ powerUp: {
201
+ id: string;
202
+ name: string;
203
+ bits: number;
204
+ imageUrl: string;
205
+ };
206
+ };
207
+ export type DashboardChatFeedPowerUpItem = DashboardChatFeedItemBase & {
208
+ type: "power-up-redemption";
209
+ data: DashboardChatFeedPowerUpData;
210
+ powerUpMatched?: boolean;
211
+ };
212
+ export type DashboardChatFeedItem = DashboardChatFeedMessageItem | DashboardChatFeedAlertItem | DashboardChatFeedRewardItem | DashboardChatFeedPowerUpItem;
137
213
  export {};