@crowbartools/firebot-types 5.67.0-alpha1
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 -0
- package/README.md +43 -0
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/package.json +44 -0
- package/types/accounts.d.ts +13 -0
- package/types/auth.d.ts +51 -0
- package/types/channel-rewards.d.ts +63 -0
- package/types/chat.d.ts +159 -0
- package/types/commands.d.ts +138 -0
- package/types/counters.d.ts +13 -0
- package/types/currency.d.ts +15 -0
- package/types/discord.d.ts +10 -0
- package/types/effects.d.ts +223 -0
- package/types/events.d.ts +99 -0
- package/types/expressionish.d.ts +74 -0
- package/types/games.d.ts +22 -0
- package/types/goals.d.ts +7 -0
- package/types/hotkeys.d.ts +12 -0
- package/types/icons.d.ts +6 -0
- package/types/import.d.ts +69 -0
- package/types/index.d.ts +40 -0
- package/types/integrations.d.ts +93 -0
- package/types/moderation.d.ts +59 -0
- package/types/modules/event-manager.d.ts +29 -0
- package/types/modules/frontend-communicator.d.ts +53 -0
- package/types/modules/index.d.ts +2 -0
- package/types/overlay-widgets.d.ts +240 -0
- package/types/parameters.d.ts +414 -0
- package/types/plugins.d.ts +201 -0
- package/types/power-ups.d.ts +20 -0
- package/types/pronouns.d.ts +11 -0
- package/types/quick-actions.d.ts +18 -0
- package/types/quotes.d.ts +17 -0
- package/types/ranks.d.ts +23 -0
- package/types/restrictions.d.ts +65 -0
- package/types/roles.d.ts +21 -0
- package/types/script-api.d.ts +95 -0
- package/types/settings.d.ts +131 -0
- package/types/setups.d.ts +49 -0
- package/types/sort-tags.d.ts +4 -0
- package/types/timers.d.ts +36 -0
- package/types/triggers.d.ts +61 -0
- package/types/ui/angular.d.ts +31 -0
- package/types/ui/backend-communicator.d.ts +8 -0
- package/types/ui/effect-helper-service.d.ts +5 -0
- package/types/ui/effect-queues-service.d.ts +10 -0
- package/types/ui/firebot-root-scope.d.ts +5 -0
- package/types/ui/index.d.ts +12 -0
- package/types/ui/modal-factory.d.ts +30 -0
- package/types/ui/modal-service.d.ts +21 -0
- package/types/ui/ng-toast.d.ts +3 -0
- package/types/ui/object-copy-helper.d.ts +9 -0
- package/types/ui/platform-service.d.ts +7 -0
- package/types/ui/preset-effect-lists-service.d.ts +20 -0
- package/types/ui/settings-service.d.ts +5 -0
- package/types/util-types.d.ts +52 -0
- package/types/variable-macros.d.ts +7 -0
- package/types/variables.d.ts +59 -0
- package/types/viewers.d.ts +30 -0
- package/types/webhooks.d.ts +5 -0
- package/types/websocket.d.ts +70 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Trigger, TriggerType, TriggersObject } from "./triggers";
|
|
2
|
+
import type { Awaitable } from "./util-types";
|
|
3
|
+
|
|
4
|
+
interface RestrictionScope<RestrictionModel> extends ng.IScope {
|
|
5
|
+
restriction: Restriction<RestrictionModel>;
|
|
6
|
+
restrictionDefinition: RestrictionType<RestrictionModel>;
|
|
7
|
+
restrictionMode: RestrictionMode;
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type RestrictionMode = "all" | "any" | "none";
|
|
12
|
+
|
|
13
|
+
export type RestrictionType<RestrictionModel = unknown> = {
|
|
14
|
+
definition: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
triggers?: TriggerType[] | TriggersObject;
|
|
19
|
+
};
|
|
20
|
+
failedReasonWhenInverted?: string;
|
|
21
|
+
optionsTemplate: string;
|
|
22
|
+
optionsController?: (
|
|
23
|
+
$scope: RestrictionScope<RestrictionModel>,
|
|
24
|
+
...args: any[]
|
|
25
|
+
) => void;
|
|
26
|
+
optionsValueDisplay?: (
|
|
27
|
+
restriction: RestrictionModel,
|
|
28
|
+
...args: any[]
|
|
29
|
+
) => string;
|
|
30
|
+
predicate(
|
|
31
|
+
triggerData: Trigger,
|
|
32
|
+
restrictionData: RestrictionModel,
|
|
33
|
+
inherited?: boolean
|
|
34
|
+
): Awaitable<boolean>;
|
|
35
|
+
onSuccessful?: (
|
|
36
|
+
triggerData: Trigger,
|
|
37
|
+
restrictionData: RestrictionModel,
|
|
38
|
+
inherited?: boolean
|
|
39
|
+
) => Awaitable<void>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type Restriction<RestrictionModel = unknown> = {
|
|
43
|
+
id: string;
|
|
44
|
+
type: string;
|
|
45
|
+
} & {
|
|
46
|
+
[K in keyof RestrictionModel]: RestrictionModel[K];
|
|
47
|
+
} & {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type RestrictionData = {
|
|
52
|
+
/**
|
|
53
|
+
* Sets the command to only trigger when all/any/none of the restrictions pass.
|
|
54
|
+
*/
|
|
55
|
+
mode?: RestrictionMode;
|
|
56
|
+
/**
|
|
57
|
+
* If a chat message should be sent when the restrictions are not met.
|
|
58
|
+
*/
|
|
59
|
+
sendFailMessage?: boolean;
|
|
60
|
+
useCustomFailMessage?: boolean;
|
|
61
|
+
failMessage?: string;
|
|
62
|
+
restrictions: Restriction[];
|
|
63
|
+
sendAsReply?: boolean;
|
|
64
|
+
invertCondition?: boolean;
|
|
65
|
+
};
|
package/types/roles.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FirebotRole {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type CustomRole = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
viewers: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
username: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}>;
|
|
14
|
+
showBadgeInChat?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type LegacyCustomRole = {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
viewers: string[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
// Public contract types for the Firebot Script API.
|
|
4
|
+
//
|
|
5
|
+
// Everything a custom script can touch via `require("@crowbartools/firebot-types")`
|
|
6
|
+
// should be defined here
|
|
7
|
+
|
|
8
|
+
export type ScriptLogMethod = (message: string, ...meta: unknown[]) => void;
|
|
9
|
+
|
|
10
|
+
export interface ScriptLoggerApi {
|
|
11
|
+
debug: ScriptLogMethod;
|
|
12
|
+
info: ScriptLogMethod;
|
|
13
|
+
warn: ScriptLogMethod;
|
|
14
|
+
error: ScriptLogMethod;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ScriptWebhook {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ScriptWebhookEvent {
|
|
23
|
+
webhook: ScriptWebhook;
|
|
24
|
+
payload: unknown;
|
|
25
|
+
rawPayload?: string;
|
|
26
|
+
headers: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ScriptWebhookEventHandler = (event: ScriptWebhookEvent) => void;
|
|
30
|
+
|
|
31
|
+
export interface ScriptWebhooksApi {
|
|
32
|
+
/** Create a new webhook (or return the existing one with the same name). */
|
|
33
|
+
save(name: string): ScriptWebhook | null;
|
|
34
|
+
/** Look up a webhook by name. */
|
|
35
|
+
get(name: string): ScriptWebhook | null;
|
|
36
|
+
/** Delete a webhook by name. Returns true if one was removed. */
|
|
37
|
+
delete(name: string): boolean;
|
|
38
|
+
/** All webhooks owned by this script. */
|
|
39
|
+
list(): ScriptWebhook[];
|
|
40
|
+
/** Public URL for a webhook by name, or null if not found. */
|
|
41
|
+
getUrl(name: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Subscribe to webhook events for this script. Returns an `unsubscribe` func
|
|
44
|
+
*/
|
|
45
|
+
onReceived(handler: ScriptWebhookEventHandler): () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ScriptFsDirEntry {
|
|
49
|
+
/** File or directory name */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Path relative to the script's data dir */
|
|
52
|
+
relativePath: string;
|
|
53
|
+
isFile: boolean;
|
|
54
|
+
isDirectory: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ScriptFsApi {
|
|
58
|
+
/** Absolute path to this script's data directory. Read-only. */
|
|
59
|
+
readonly dataDir: string;
|
|
60
|
+
|
|
61
|
+
/** Resolve a sandboxed relative path to an absolute one. Throws on escape. */
|
|
62
|
+
resolve(relativePath: string): string;
|
|
63
|
+
|
|
64
|
+
exists(relativePath: string): Promise<boolean>;
|
|
65
|
+
|
|
66
|
+
readText(relativePath: string, encoding?: BufferEncoding): Promise<string>;
|
|
67
|
+
writeText(relativePath: string, contents: string, encoding?: BufferEncoding): Promise<void>;
|
|
68
|
+
|
|
69
|
+
readBytes(relativePath: string): Promise<Buffer>;
|
|
70
|
+
writeBytes(relativePath: string, contents: Buffer | Uint8Array): Promise<void>;
|
|
71
|
+
|
|
72
|
+
/** Read JSON. Returns `null` if the file doesn't exist. */
|
|
73
|
+
readJson(relativePath: string): Promise<unknown>;
|
|
74
|
+
/** Write JSON pretty-printed with 2-space indent. */
|
|
75
|
+
writeJson(relativePath: string, value: unknown): Promise<void>;
|
|
76
|
+
|
|
77
|
+
/** Create a directory (and any missing parents). */
|
|
78
|
+
mkdir(relativePath: string): Promise<void>;
|
|
79
|
+
/** Delete a file or directory recursively. No-op if it doesn't exist. */
|
|
80
|
+
remove(relativePath: string): Promise<void>;
|
|
81
|
+
|
|
82
|
+
/** List immediate children of a directory (defaults to the data dir root). */
|
|
83
|
+
list(relativePath?: string): Promise<ScriptFsDirEntry[]>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface FirebotScriptApi {
|
|
87
|
+
/** Running Firebot version, e.g. `"5.65.0"`. */
|
|
88
|
+
version: string;
|
|
89
|
+
/** Scoped logger. */
|
|
90
|
+
logger: ScriptLoggerApi;
|
|
91
|
+
/** Webhooks owned by this script. */
|
|
92
|
+
webhooks: ScriptWebhooksApi;
|
|
93
|
+
/** Sandboxed filesystem rooted at this script's data directory. */
|
|
94
|
+
fs: ScriptFsApi;
|
|
95
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export declare enum FirebotAutoUpdateLevel {
|
|
2
|
+
Off = 0,
|
|
3
|
+
Bugfix = 1,
|
|
4
|
+
Feature = 2,
|
|
5
|
+
MajorRelease = 3,
|
|
6
|
+
Betas = 4
|
|
7
|
+
}
|
|
8
|
+
export type FirebotAudioDevice = {
|
|
9
|
+
label: string;
|
|
10
|
+
deviceId: string;
|
|
11
|
+
};
|
|
12
|
+
export type FirebotGlobalValue = {
|
|
13
|
+
name: string;
|
|
14
|
+
secret?: boolean;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
export type FirebotSettingsTypes = {
|
|
18
|
+
ActiveChatUserListTimeout: number;
|
|
19
|
+
ActiveProfiles: string[];
|
|
20
|
+
AllowChatCreatedCommandsToRunEffects: boolean;
|
|
21
|
+
AllowCommandsInSharedChat: boolean;
|
|
22
|
+
AllowQuoteCSVDownloads: boolean;
|
|
23
|
+
AllowedActivityEvents: string[];
|
|
24
|
+
AudioOutputDevice: FirebotAudioDevice;
|
|
25
|
+
AutoFlagBots: boolean;
|
|
26
|
+
AutoUpdateLevel: FirebotAutoUpdateLevel;
|
|
27
|
+
BackupBeforeUpdates: boolean;
|
|
28
|
+
BackupIgnoreResources: boolean;
|
|
29
|
+
BackupKeepAll: boolean;
|
|
30
|
+
BackupLocation: string;
|
|
31
|
+
BackupLocationReset: boolean;
|
|
32
|
+
BackupOnceADay: boolean;
|
|
33
|
+
BackupOnExit: boolean;
|
|
34
|
+
ChatAlternateBackgrounds: boolean;
|
|
35
|
+
ChatAvatars: boolean;
|
|
36
|
+
ChatCompactMode: boolean;
|
|
37
|
+
ChatCustomFontFamily: string;
|
|
38
|
+
ChatCustomFontFamilyEnabled: boolean;
|
|
39
|
+
ChatCustomFontSize: number;
|
|
40
|
+
ChatCustomFontSizeEnabled: boolean;
|
|
41
|
+
ChatGetAllEmotes: boolean;
|
|
42
|
+
ChatHideBotAccountMessages: boolean;
|
|
43
|
+
ChatHideDeletedMessages: boolean;
|
|
44
|
+
ChatHideWhispers: boolean;
|
|
45
|
+
ChatPronouns: boolean;
|
|
46
|
+
ChatReverseOrder: boolean;
|
|
47
|
+
ChatShowBttvEmotes: boolean;
|
|
48
|
+
ChatShowFfzEmotes: boolean;
|
|
49
|
+
ChatShowSevenTvEmotes: boolean;
|
|
50
|
+
ChatShowSharedChatInfo: boolean;
|
|
51
|
+
ChatTaggedNotificationSound: {
|
|
52
|
+
name: string;
|
|
53
|
+
path?: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
ChatTaggedNotificationVolume: number;
|
|
56
|
+
ChatTimestamps: boolean;
|
|
57
|
+
ClearChatFeedMode: "never" | "onlyStreamer" | "always";
|
|
58
|
+
ClearCustomScriptCache: boolean;
|
|
59
|
+
ConnectOnLaunch: boolean;
|
|
60
|
+
CopiedOverlayVersion: string;
|
|
61
|
+
DashboardLayout: {
|
|
62
|
+
dashboardViewerList: string;
|
|
63
|
+
dashboardChatWindow: string;
|
|
64
|
+
dashboardActivityFeed: string;
|
|
65
|
+
};
|
|
66
|
+
DebugMode: boolean;
|
|
67
|
+
DefaultEffectLabelsEnabled: boolean;
|
|
68
|
+
DefaultModerationUser: "streamer" | "bot";
|
|
69
|
+
DefaultRewardTab: "powerups" | "rewards" | "queue";
|
|
70
|
+
DefaultToAdvancedCommandMode: boolean;
|
|
71
|
+
DefaultTtsVoiceId: string;
|
|
72
|
+
DeleteProfile: string;
|
|
73
|
+
EventSetSettings: Record<string, {
|
|
74
|
+
position: number;
|
|
75
|
+
}>;
|
|
76
|
+
EventSettings: object;
|
|
77
|
+
FirstTimeUse: boolean;
|
|
78
|
+
ForceOverlayEffectsToContinueOnRefresh: boolean;
|
|
79
|
+
GlobalValues: Array<FirebotGlobalValue>;
|
|
80
|
+
IgnoreSubsequentSubEventsAfterCommunitySub: boolean;
|
|
81
|
+
JustUpdated: boolean;
|
|
82
|
+
LastBackupDate: Date;
|
|
83
|
+
LegacySortTagsImported: boolean;
|
|
84
|
+
LoggedInProfile: string;
|
|
85
|
+
MaxBackupCount: number | "All";
|
|
86
|
+
MinimizeToTray: boolean;
|
|
87
|
+
NotifyOnBeta: boolean;
|
|
88
|
+
OpenEffectQueueMonitorOnLaunch: boolean;
|
|
89
|
+
OpenStreamPreviewOnLaunch: boolean;
|
|
90
|
+
OverlayResolution: {
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
};
|
|
94
|
+
OverlayInstances: string[];
|
|
95
|
+
PersistCustomVariables: boolean;
|
|
96
|
+
PresetRecursionLimit: boolean;
|
|
97
|
+
QuickActions: Record<string, {
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
position: number;
|
|
100
|
+
}>;
|
|
101
|
+
RunCustomScripts: boolean;
|
|
102
|
+
SeenAdvancedCommandModePopup: boolean;
|
|
103
|
+
ShowAdBreakIndicator: boolean;
|
|
104
|
+
ShowActivityFeed: boolean;
|
|
105
|
+
ShowActivityFeedEventsInChat: boolean;
|
|
106
|
+
ShowChatViewerList: boolean;
|
|
107
|
+
ShowHypeTrainIndicator: boolean;
|
|
108
|
+
ShowUptimeStat: boolean;
|
|
109
|
+
ShowViewerCountStat: boolean;
|
|
110
|
+
SidebarControlledServices: string[];
|
|
111
|
+
SidebarExpanded: boolean;
|
|
112
|
+
SoundsEnabled: "On" | "Off";
|
|
113
|
+
StreamerExemptFromCooldowns: boolean;
|
|
114
|
+
Theme: string;
|
|
115
|
+
TriggerUpcomingAdBreakMinutes: number;
|
|
116
|
+
TtsVoiceRate: number;
|
|
117
|
+
TtsVoiceVolume: number;
|
|
118
|
+
UseExperimentalTwitchClipUrlResolver: boolean;
|
|
119
|
+
UseOverlayInstances: boolean;
|
|
120
|
+
ViewerDB: boolean;
|
|
121
|
+
ViewerListPageSize: number;
|
|
122
|
+
WebhookDebugLogs: boolean;
|
|
123
|
+
WebOnlineCheckin: boolean;
|
|
124
|
+
WebServerPort: number;
|
|
125
|
+
WhileLoopEnabled: boolean;
|
|
126
|
+
WysiwygBackground: "black" | "white";
|
|
127
|
+
};
|
|
128
|
+
export declare const FirebotGlobalSettings: Partial<Record<keyof FirebotSettingsTypes, boolean>>;
|
|
129
|
+
export declare const FirebotSettingsDefaults: FirebotSettingsTypes;
|
|
130
|
+
/** Anything in `SettingsTypes` not listed here will resolve to "/settings/settingName" (e.g. "/settings/autoFlagBots") */
|
|
131
|
+
export declare const FirebotSettingsPaths: Partial<Record<keyof FirebotSettingsTypes, string>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CommandDefinition } from "./commands";
|
|
2
|
+
import type { Counter } from "./counters";
|
|
3
|
+
import type { Currency } from "./currency";
|
|
4
|
+
import type { EffectQueueConfig, PresetEffectList } from "./effects";
|
|
5
|
+
import type { EventGroup, EventSettings } from "./events";
|
|
6
|
+
import type { FirebotHotkey } from "./hotkeys";
|
|
7
|
+
import type { OverlayWidgetConfig } from "./overlay-widgets";
|
|
8
|
+
import type { QuickActionDefinition } from "./quick-actions";
|
|
9
|
+
import type { RankLadder } from "./ranks";
|
|
10
|
+
import type { CustomRole, LegacyCustomRole } from "./roles";
|
|
11
|
+
import type { FirebotGlobalValue } from "./settings";
|
|
12
|
+
import type { ScheduledTask, Timer } from "./timers";
|
|
13
|
+
import type { VariableMacro } from "./variable-macros";
|
|
14
|
+
|
|
15
|
+
export type SetupImportQuestion = {
|
|
16
|
+
replaceToken: string;
|
|
17
|
+
answer: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type FirebotSetupGlobalValue = FirebotGlobalValue & {
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type FirebotSetup = {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
author: string;
|
|
28
|
+
version: number;
|
|
29
|
+
importQuestions: SetupImportQuestion[];
|
|
30
|
+
requireCurrency: boolean;
|
|
31
|
+
components: {
|
|
32
|
+
commands: CommandDefinition[];
|
|
33
|
+
counters: Counter[];
|
|
34
|
+
currencies: Currency[];
|
|
35
|
+
effectQueues: EffectQueueConfig[];
|
|
36
|
+
events: EventSettings[];
|
|
37
|
+
eventGroups: EventGroup[];
|
|
38
|
+
hotkeys: FirebotHotkey[];
|
|
39
|
+
presetEffectLists: PresetEffectList[];
|
|
40
|
+
timers: Timer[];
|
|
41
|
+
scheduledTasks: ScheduledTask[];
|
|
42
|
+
variableMacros: VariableMacro[];
|
|
43
|
+
viewerRoles: (LegacyCustomRole | CustomRole)[];
|
|
44
|
+
viewerRankLadders: RankLadder[];
|
|
45
|
+
quickActions: QuickActionDefinition[];
|
|
46
|
+
overlayWidgetConfigs: OverlayWidgetConfig[];
|
|
47
|
+
globalValues: FirebotSetupGlobalValue[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DateTime } from "luxon";
|
|
2
|
+
|
|
3
|
+
import type { EffectList } from "./effects";
|
|
4
|
+
|
|
5
|
+
export type Timer = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
active: boolean;
|
|
9
|
+
interval: number;
|
|
10
|
+
requiredChatLines: number;
|
|
11
|
+
onlyWhenLive: boolean;
|
|
12
|
+
effects: EffectList;
|
|
13
|
+
sortTags: string[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type TimerIntervalTracker = {
|
|
17
|
+
timerId: string;
|
|
18
|
+
onlyWhenLive: boolean;
|
|
19
|
+
timer: Timer;
|
|
20
|
+
requiredChatLines: number;
|
|
21
|
+
waitingForChatLines: boolean;
|
|
22
|
+
chatLinesSinceLastRunCount: number;
|
|
23
|
+
intervalId: number | NodeJS.Timeout;
|
|
24
|
+
startedAt: DateTime;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ScheduledTask = {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
schedule: string;
|
|
32
|
+
inputType: string;
|
|
33
|
+
onlyWhenLive: boolean;
|
|
34
|
+
effects: EffectList;
|
|
35
|
+
sortTags: string[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FirebotChatMessage } from "./chat";
|
|
2
|
+
import type { CommandDefinition, SubCommand } from "./commands";
|
|
3
|
+
|
|
4
|
+
export type TriggerType =
|
|
5
|
+
| "command"
|
|
6
|
+
| "custom_script"
|
|
7
|
+
| "startup_script"
|
|
8
|
+
| "api"
|
|
9
|
+
| "event"
|
|
10
|
+
| "hotkey"
|
|
11
|
+
| "timer"
|
|
12
|
+
| "scheduled_task"
|
|
13
|
+
| "counter"
|
|
14
|
+
| "preset"
|
|
15
|
+
| "quick_action"
|
|
16
|
+
| "manual"
|
|
17
|
+
| "channel_reward"
|
|
18
|
+
| "power_up"
|
|
19
|
+
| "overlay_widget";
|
|
20
|
+
|
|
21
|
+
export type TriggerMeta = {
|
|
22
|
+
triggerId?: string;
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type Trigger = {
|
|
27
|
+
type: TriggerType;
|
|
28
|
+
metadata: {
|
|
29
|
+
username: string;
|
|
30
|
+
hotkey?: unknown;
|
|
31
|
+
command?: CommandDefinition;
|
|
32
|
+
userCommand?: {
|
|
33
|
+
trigger: string;
|
|
34
|
+
args: string[];
|
|
35
|
+
triggeredArg?: string;
|
|
36
|
+
triggeredSubcmd?: SubCommand;
|
|
37
|
+
subcommandId?: string;
|
|
38
|
+
};
|
|
39
|
+
chatMessage?: FirebotChatMessage;
|
|
40
|
+
event?: { id: string, name: string };
|
|
41
|
+
eventSource?: { id: string, name: string };
|
|
42
|
+
eventData?: {
|
|
43
|
+
chatMessage?: FirebotChatMessage;
|
|
44
|
+
[x: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
counter?: {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
previousValue: number;
|
|
50
|
+
value: number;
|
|
51
|
+
minimum?: number;
|
|
52
|
+
maximum?: number;
|
|
53
|
+
};
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
effectOutputs?: { [key: string]: unknown };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type TriggersObject = {
|
|
60
|
+
[T in TriggerType]?: T extends "event" ? string[] | boolean : boolean;
|
|
61
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type angular from "angular";
|
|
2
|
+
|
|
3
|
+
export type BindingsDefinition<Bindings> = {
|
|
4
|
+
[K in keyof Bindings]: {} extends Pick<Bindings, K>
|
|
5
|
+
? Bindings[K] extends string
|
|
6
|
+
? "@?" | "<?" | "=?" | `@?${string}` | `<?${string}` | `=?${string}`
|
|
7
|
+
: Bindings[K] extends boolean
|
|
8
|
+
? "<?" | "=?" | `<?${string}` | `=?${string}`
|
|
9
|
+
: Bindings[K] extends number
|
|
10
|
+
? "<?" | "=?" | `<?${string}` | `=?${string}`
|
|
11
|
+
: Bindings[K] extends (...args: any[]) => any
|
|
12
|
+
? "&?" | `&?${string}`
|
|
13
|
+
: "<?" | "=?" | `<?${string}` | `=?${string}`
|
|
14
|
+
: Bindings[K] extends string
|
|
15
|
+
? "@" | "<" | "=" | `@${string}` | `<${string}` | `=${string}`
|
|
16
|
+
: Bindings[K] extends boolean
|
|
17
|
+
? "<" | "=" | `<${string}` | `=${string}`
|
|
18
|
+
: Bindings[K] extends number
|
|
19
|
+
? "<" | "=" | `<${string}` | `=${string}`
|
|
20
|
+
: Bindings[K] extends (...args: any[]) => any
|
|
21
|
+
? "&" | `&${string}`
|
|
22
|
+
: "<" | "=" | `<${string}` | `=${string}`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type FirebotComponent<Bindings, ExtraControllerProps = {}> = angular.IComponentOptions & {
|
|
26
|
+
bindings: BindingsDefinition<Bindings>;
|
|
27
|
+
controller: (
|
|
28
|
+
this: angular.IController & Bindings & ExtraControllerProps & { [key: string]: unknown },
|
|
29
|
+
...args: unknown[]
|
|
30
|
+
) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type BackendCommunicator = {
|
|
2
|
+
on: (eventName: string, callback: (data: unknown) => void, async?: boolean) => string;
|
|
3
|
+
onAsync: (eventName: string, callback: (data: unknown) => Promise<unknown>) => string;
|
|
4
|
+
fireEventAsync: <T = unknown>(type: string, data?: unknown) => Promise<T>;
|
|
5
|
+
fireEventSync: <T = unknown>(type: string, data?: unknown) => T;
|
|
6
|
+
fireEvent: (type: string, data?: unknown) => void;
|
|
7
|
+
send: (type: string, data?: unknown) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EffectQueueConfig } from "../../types";
|
|
2
|
+
|
|
3
|
+
export type EffectQueuesService = {
|
|
4
|
+
effectQueues: EffectQueueConfig[];
|
|
5
|
+
getEffectQueues: () => EffectQueueConfig[];
|
|
6
|
+
getEffectQueue: (id: string) => EffectQueueConfig | undefined;
|
|
7
|
+
showAddEditEffectQueueModal: (queueId?: string) => Promise<string>;
|
|
8
|
+
showDeleteEffectQueueModal: (queueId: string) => Promise<boolean>;
|
|
9
|
+
queueModes: { value: string, label: string, description: string, iconClass: string }[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./angular";
|
|
2
|
+
export * from "./platform-service";
|
|
3
|
+
export * from "./backend-communicator";
|
|
4
|
+
export * from "./effect-helper-service";
|
|
5
|
+
export * from "./settings-service";
|
|
6
|
+
export * from "./modal-service";
|
|
7
|
+
export * from "./modal-factory";
|
|
8
|
+
export * from "./ng-toast";
|
|
9
|
+
export * from "./firebot-root-scope";
|
|
10
|
+
export * from "./object-copy-helper";
|
|
11
|
+
export * from "./preset-effect-lists-service";
|
|
12
|
+
export * from "./effect-queues-service";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { EffectInstance } from "../effects";
|
|
2
|
+
import type { TriggerType } from "../triggers";
|
|
3
|
+
|
|
4
|
+
export type ModalFactory = {
|
|
5
|
+
showEditEffectModal: (
|
|
6
|
+
effectInstance: EffectInstance,
|
|
7
|
+
effectIndex: number | null,
|
|
8
|
+
trigger: TriggerType,
|
|
9
|
+
closeCallback: (response: {
|
|
10
|
+
action: "add" | "update" | "delete";
|
|
11
|
+
effect: EffectInstance | null;
|
|
12
|
+
index: number;
|
|
13
|
+
}) => void,
|
|
14
|
+
triggerMeta: unknown,
|
|
15
|
+
isNewEffect: boolean
|
|
16
|
+
) => void;
|
|
17
|
+
openGetInputModal: <T extends string | number>(options: {
|
|
18
|
+
model: T;
|
|
19
|
+
inputType?: "text" | "number" | "password";
|
|
20
|
+
label: string;
|
|
21
|
+
inputPlaceholder?: string;
|
|
22
|
+
saveText?: string;
|
|
23
|
+
useTextArea?: boolean;
|
|
24
|
+
descriptionText?: string;
|
|
25
|
+
validationFn?: (input: T) => Promise<boolean>;
|
|
26
|
+
validationText?: string;
|
|
27
|
+
trigger?: TriggerType;
|
|
28
|
+
triggerMeta?: unknown;
|
|
29
|
+
}, callback: (result: T) => void, dismissCallback?: () => void) => void;
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type angular from "angular";
|
|
2
|
+
|
|
3
|
+
export type ModalService = {
|
|
4
|
+
showModal: (options: {
|
|
5
|
+
component?: string;
|
|
6
|
+
resolveObj?: { [key: string]: unknown };
|
|
7
|
+
dismissCallback?: () => void;
|
|
8
|
+
closeCallback?: (data: unknown) => void;
|
|
9
|
+
size?: "sm" | "md" | "mdlg" | "lg" | "xl";
|
|
10
|
+
keyboard?: boolean;
|
|
11
|
+
backdrop?: boolean | "static";
|
|
12
|
+
controllerFunc?: angular.Injectable<angular.IControllerConstructor>;
|
|
13
|
+
templateUrl?: string;
|
|
14
|
+
windowClass?: string;
|
|
15
|
+
breadcrumbName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
autoSlide?: boolean;
|
|
20
|
+
}) => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EffectInstance } from "../effects";
|
|
2
|
+
import type { TriggerType } from "../triggers";
|
|
3
|
+
|
|
4
|
+
export type ObjectCopyHelper = {
|
|
5
|
+
copyEffects: (effects: EffectInstance[]) => void;
|
|
6
|
+
getCopiedEffects: (trigger: TriggerType, triggerMeta: unknown) => Promise<EffectInstance[]>;
|
|
7
|
+
hasCopiedEffects: () => boolean;
|
|
8
|
+
cloneEffect: (effect: EffectInstance) => EffectInstance;
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PresetEffectList } from "../effects";
|
|
2
|
+
|
|
3
|
+
export type PresetEffectListsService = {
|
|
4
|
+
presetEffectLists: PresetEffectList[];
|
|
5
|
+
loadPresetEffectLists: () => void;
|
|
6
|
+
getPresetEffectLists: () => PresetEffectList[];
|
|
7
|
+
getPresetEffectList: (presetEffectListId: string) => PresetEffectList | undefined;
|
|
8
|
+
savePresetEffectList: (presetEffectList: PresetEffectList, isNew?: boolean) => PresetEffectList | null;
|
|
9
|
+
saveAllPresetEffectLists: (presetEffectLists: PresetEffectList[]) => void;
|
|
10
|
+
presetEffectListNameExists: (name: string) => boolean;
|
|
11
|
+
showRunPresetListModal: (id: string, isQuickAction?: boolean) => void;
|
|
12
|
+
manuallyTriggerPresetEffectList: (
|
|
13
|
+
presetEffectListId: string,
|
|
14
|
+
args?: Record<string, unknown>,
|
|
15
|
+
isQuickAction?: boolean
|
|
16
|
+
) => void;
|
|
17
|
+
duplicatePresetEffectList: (presetEffectListId: string) => void;
|
|
18
|
+
deletePresetEffectList: (presetEffectListId: string) => void;
|
|
19
|
+
showAddEditPresetEffectListModal: (presetEffectList?: Partial<PresetEffectList>) => Promise<PresetEffectList | null>;
|
|
20
|
+
};
|