@crowbartools/firebot-types 5.67.0-alpha16 → 5.67.0-alpha17
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/events/filters/builtin/firebot/custom-variable-name.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/custom-widget-message-name.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/index.d.ts +1 -3
- package/backend/events/filters/builtin/firebot/metadata-key.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/metadata-value.d.ts +1 -1
- package/backend/events/filters/builtin/firebot/new-currency-amount.d.ts +1 -3
- package/backend/events/filters/builtin/firebot/new-view-time.d.ts +1 -3
- package/backend/events/filters/builtin/firebot/previous-currency-amount.d.ts +1 -3
- package/backend/events/filters/builtin/firebot/previous-view-time.d.ts +1 -3
- package/backend/events/filters/builtin/index.d.ts +1 -3
- package/backend/events/filters/builtin/third-party/donation-amount.d.ts +1 -3
- package/backend/events/filters/builtin/third-party/donation-from.d.ts +1 -1
- package/backend/events/filters/builtin/third-party/index.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/bits-badge-tier.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/chat-mode-duration.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/cheer-bits-amount.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/gift-count.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/gift-duration.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/index.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/lifetime-gift-count.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/message.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/raid-viewer-count.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/reward-name.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/stream-category.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/sub-months.d.ts +1 -3
- package/backend/events/filters/builtin/twitch/username.d.ts +1 -1
- package/backend/events/filters/builtin/twitch/watch-streak-count.d.ts +1 -3
- package/backend/events/filters/filter-factory.d.ts +9 -20
- package/backend/integrations/builtin/streamloots/filters/card-name.d.ts +1 -1
- package/backend/integrations/builtin/streamloots/filters/chest-quantity.d.ts +1 -3
- package/backend/scripts/executors/script-executor.interface.d.ts +2 -1
- package/backend/scripts/script-api/namespaces/event-filter-factory.d.ts +2 -0
- package/backend/scripts/script-api/namespaces/variable-factory.d.ts +2 -0
- package/backend/variables/variable-factory.d.ts +1 -2
- package/package.json +1 -1
- package/types/events.d.ts +4 -4
- package/types/plugins.d.ts +2 -1
- package/types/script-api.d.ts +17 -1
- package/types/variables.d.ts +10 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
valueType: "number";
|
|
3
|
-
}))[];
|
|
1
|
+
declare const _default: import("../../../../../types").EventFilter[];
|
|
4
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
valueType: "number";
|
|
3
|
-
}))[];
|
|
1
|
+
declare const _default: import("../../../../types").EventFilter[];
|
|
4
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
valueType: "number";
|
|
3
|
-
}))[];
|
|
1
|
+
declare const _default: import("../../../../../types").EventFilter[];
|
|
4
2
|
export default _default;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
valueType: "number";
|
|
3
|
-
}))[];
|
|
1
|
+
declare const _default: import("../../../../../types").EventFilter[];
|
|
4
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export default filter;
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import { Awaitable, EventFilter, FilterSettings, PresetValue } from "../../../types";
|
|
2
|
-
type
|
|
3
|
-
eventSourceId: string;
|
|
4
|
-
eventId: string;
|
|
5
|
-
eventMeta: Record<string, unknown>;
|
|
6
|
-
};
|
|
7
|
-
type FilterEvent = Omit<EventData, "eventMeta">;
|
|
8
|
-
type FilterConfig = {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
events: Array<FilterEvent>;
|
|
1
|
+
import { Awaitable, EventData, EventFilter, FilterSettings, PresetValue } from "../../../types";
|
|
2
|
+
export type FilterConfig = Pick<EventFilter, "id" | "name" | "description" | "events"> & {
|
|
13
3
|
eventMetaKey: string | ((eventData: EventData, filterSettings: FilterSettings) => string);
|
|
4
|
+
};
|
|
5
|
+
export type TextFilterConfig = FilterConfig & {
|
|
14
6
|
caseInsensitive?: boolean;
|
|
15
7
|
};
|
|
16
|
-
type PresetFilterConfig = FilterConfig & {
|
|
8
|
+
export type PresetFilterConfig = FilterConfig & {
|
|
17
9
|
presetValues: (...args: unknown[]) => Awaitable<PresetValue[]>;
|
|
18
10
|
valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
|
|
19
11
|
getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
|
|
20
12
|
allowIsNot?: boolean;
|
|
21
13
|
};
|
|
22
|
-
export declare function createTextFilter({ eventMetaKey, caseInsensitive, ...config }:
|
|
23
|
-
export declare function createNumberFilter({ eventMetaKey, ...config }:
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
export declare function createTextOrNumberFilter({ eventMetaKey, caseInsensitive, ...config }: Omit<FilterConfig, "presetValues" | "allowIsNot">): Omit<EventFilter, "presetValues">;
|
|
27
|
-
export declare function createPresetFilter({ eventMetaKey, presetValues, getSelectedValueDisplay, valueIsStillValid, allowIsNot, ...config }: Omit<PresetFilterConfig, "caseInsensitive">): EventFilter;
|
|
28
|
-
export {};
|
|
14
|
+
export declare function createTextFilter({ eventMetaKey, caseInsensitive, ...config }: TextFilterConfig): EventFilter;
|
|
15
|
+
export declare function createNumberFilter({ eventMetaKey, ...config }: FilterConfig): EventFilter;
|
|
16
|
+
export declare function createTextOrNumberFilter({ eventMetaKey, caseInsensitive, ...config }: TextFilterConfig): EventFilter;
|
|
17
|
+
export declare function createPresetFilter({ eventMetaKey, presetValues, getSelectedValueDisplay, valueIsStillValid, allowIsNot, ...config }: PresetFilterConfig): EventFilter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const filter:
|
|
1
|
+
declare const filter: import("../../../../../types").EventFilter;
|
|
2
2
|
export = filter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails } from "../../../types";
|
|
1
|
+
import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails, AdditionalVariableEvent } from "../../../types";
|
|
2
2
|
import type { ScriptApiContext } from "../script-api";
|
|
3
3
|
declare abstract class IBaseScriptExecutor {
|
|
4
4
|
abstract canHandle(script: ScriptBase | LegacyCustomScript): Awaitable<boolean>;
|
|
@@ -7,6 +7,7 @@ declare abstract class IBaseScriptExecutor {
|
|
|
7
7
|
export interface PluginRegistrations {
|
|
8
8
|
effectIds?: string[];
|
|
9
9
|
variableHandles?: string[];
|
|
10
|
+
additionalVariableEvents?: AdditionalVariableEvent[];
|
|
10
11
|
eventSourceIds?: string[];
|
|
11
12
|
filterIds?: string[];
|
|
12
13
|
systemCommandIds?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReplaceVariable } from "../../types/variables";
|
|
2
|
-
type VariableConfig = {
|
|
2
|
+
export type VariableConfig = {
|
|
3
3
|
handle: string;
|
|
4
4
|
description: string;
|
|
5
5
|
events: string[];
|
|
@@ -9,4 +9,3 @@ type VariableConfig = {
|
|
|
9
9
|
type: ReplaceVariable["definition"]["possibleDataOutput"][number] | ReplaceVariable["definition"]["possibleDataOutput"];
|
|
10
10
|
};
|
|
11
11
|
export declare function createEventDataVariable({ events, eventMetaKey, type, defaultValue, ...definition }: VariableConfig): ReplaceVariable;
|
|
12
|
-
export {};
|
package/package.json
CHANGED
package/types/events.d.ts
CHANGED
|
@@ -22,20 +22,20 @@ export type EventSource = {
|
|
|
22
22
|
events: EventDefinition[];
|
|
23
23
|
};
|
|
24
24
|
export type PresetValue = {
|
|
25
|
-
value:
|
|
25
|
+
value: unknown;
|
|
26
26
|
display: string;
|
|
27
27
|
};
|
|
28
28
|
export type FilterSettings = {
|
|
29
29
|
type: string;
|
|
30
30
|
comparisonType: ComparisonType;
|
|
31
|
-
value:
|
|
31
|
+
value: unknown;
|
|
32
32
|
};
|
|
33
33
|
export type EventSourceAndId = {
|
|
34
34
|
eventSourceId: string;
|
|
35
35
|
eventId: string;
|
|
36
36
|
};
|
|
37
37
|
export type EventData = EventSourceAndId & {
|
|
38
|
-
eventMeta: Record<string,
|
|
38
|
+
eventMeta: Record<string, unknown>;
|
|
39
39
|
};
|
|
40
40
|
export type EventFilter = {
|
|
41
41
|
id: string;
|
|
@@ -43,7 +43,7 @@ export type EventFilter = {
|
|
|
43
43
|
description: string;
|
|
44
44
|
events: EventSourceAndId[];
|
|
45
45
|
comparisonTypes: string[];
|
|
46
|
-
valueType: "text" | "preset";
|
|
46
|
+
valueType: "text" | "number" | "preset";
|
|
47
47
|
presetValues?(...args: unknown[]): Awaitable<PresetValue[]>;
|
|
48
48
|
valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
|
|
49
49
|
getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
|
package/types/plugins.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EffectInstance, EffectList, EffectType } from "./effects";
|
|
2
2
|
import type { Trigger } from "./triggers";
|
|
3
3
|
import type { Awaitable } from "./util-types";
|
|
4
|
-
import type { ReplaceVariable } from "./variables";
|
|
4
|
+
import type { PluginAdditonalVariableEvents, ReplaceVariable } from "./variables";
|
|
5
5
|
import type { EventFilter, EventSource } from "./events";
|
|
6
6
|
import type { SystemCommand } from "./commands";
|
|
7
7
|
import type { RestrictionType } from "./restrictions";
|
|
@@ -119,6 +119,7 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
|
|
|
119
119
|
effects?: DynamicArray<EffectType<any, any>>;
|
|
120
120
|
eventSources?: DynamicArray<EventSource>;
|
|
121
121
|
variables?: DynamicArray<ReplaceVariable>;
|
|
122
|
+
additionalVariableEvents?: DynamicArray<PluginAdditonalVariableEvents>;
|
|
122
123
|
integrations?: DynamicArray<Integration<any>>;
|
|
123
124
|
filters?: DynamicArray<EventFilter>;
|
|
124
125
|
restrictions?: DynamicArray<RestrictionType<any>>;
|
package/types/script-api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TriggeredEvent } from "./events";
|
|
1
|
+
import type { EventFilter, TriggeredEvent } from "./events";
|
|
2
2
|
import type { RunEffectsContext } from "./effects";
|
|
3
3
|
import type { TwitchApi } from "../backend/streaming-platforms/twitch/api";
|
|
4
4
|
import type { Notification } from "./notifications";
|
|
@@ -6,6 +6,9 @@ import type { FirebotAccount } from "./accounts";
|
|
|
6
6
|
import type { FirebotSettingsTypes } from "./settings";
|
|
7
7
|
import type { InstalledPlugin } from "./plugins";
|
|
8
8
|
import type { PluginWebhook } from "./webhooks";
|
|
9
|
+
import { ReplaceVariable } from "./variables";
|
|
10
|
+
import type { VariableConfig } from "../backend/variables/variable-factory";
|
|
11
|
+
import type { FilterConfig, PresetFilterConfig, TextFilterConfig } from "../backend/events/filters/filter-factory";
|
|
9
12
|
export type ScriptLogMethod = (message: string, ...meta: unknown[]) => void;
|
|
10
13
|
export interface ScriptLoggerApi {
|
|
11
14
|
debug: ScriptLogMethod;
|
|
@@ -148,6 +151,15 @@ export interface ScriptWebServerApi {
|
|
|
148
151
|
*/
|
|
149
152
|
sendWebSocketEvent(name: string, data?: unknown): any;
|
|
150
153
|
}
|
|
154
|
+
export interface ScriptVariableFactoryApi {
|
|
155
|
+
createEventDataVariable(config: VariableConfig): ReplaceVariable;
|
|
156
|
+
}
|
|
157
|
+
export interface ScriptEventFilterFactoryApi {
|
|
158
|
+
createTextFilter(config: TextFilterConfig): EventFilter;
|
|
159
|
+
createNumberFilter(config: FilterConfig): EventFilter;
|
|
160
|
+
createTextOrNumberFilter(config: TextFilterConfig): EventFilter;
|
|
161
|
+
createPresetFilter(config: PresetFilterConfig): EventFilter;
|
|
162
|
+
}
|
|
151
163
|
export interface FirebotScriptApi {
|
|
152
164
|
/** Running Firebot version, e.g. `"5.67.0"`. */
|
|
153
165
|
version: string;
|
|
@@ -177,4 +189,8 @@ export interface FirebotScriptApi {
|
|
|
177
189
|
plugins: ScriptPluginsApi;
|
|
178
190
|
/** Firebot internal web server functions. */
|
|
179
191
|
webServer: ScriptWebServerApi;
|
|
192
|
+
/** Factory for creating variables based on event data. */
|
|
193
|
+
variableFactory: ScriptVariableFactoryApi;
|
|
194
|
+
/** Factory for creating event filters. */
|
|
195
|
+
eventFilterFactory: ScriptEventFilterFactoryApi;
|
|
180
196
|
}
|
package/types/variables.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventSourceAndId } from "./events";
|
|
1
2
|
import type { Trigger, TriggersObject, TriggerType, TriggerMeta } from "./triggers";
|
|
2
3
|
import type { Awaitable } from "./util-types";
|
|
3
4
|
export { Trigger, TriggersObject, TriggerType, TriggerMeta };
|
|
@@ -43,3 +44,12 @@ export type RegisteredVariable = {
|
|
|
43
44
|
evaluator(trigger: Trigger, ...args: unknown[]): Awaitable<unknown>;
|
|
44
45
|
getSuggestions: (triggerType: TriggerType, triggerMeta?: TriggerMeta) => Awaitable<VariableUsage[]>;
|
|
45
46
|
};
|
|
47
|
+
export type AdditionalVariableEvent = {
|
|
48
|
+
handle: string;
|
|
49
|
+
eventSourceId: string;
|
|
50
|
+
eventId: string;
|
|
51
|
+
};
|
|
52
|
+
export type PluginAdditonalVariableEvents = {
|
|
53
|
+
handle: string;
|
|
54
|
+
events: Array<EventSourceAndId>;
|
|
55
|
+
};
|