@crowbartools/firebot-types 5.67.0-alpha17 → 5.67.0-alpha18
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 -674
- package/backend/scripts/executors/script-executor.interface.d.ts +3 -2
- package/package.json +1 -1
- package/types/effects.d.ts +10 -0
- package/types/plugins.d.ts +4 -3
- package/types/script-api.d.ts +0 -7
- package/types/variables.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails, AdditionalVariableEvent } from "../../../types";
|
|
1
|
+
import { InstalledPluginConfig, LegacyCustomScript, ScriptBase, ScriptContext, Awaitable, ScriptDetails, AdditionalVariableEvent, AdditionalEffectEvent } 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,7 +7,6 @@ declare abstract class IBaseScriptExecutor {
|
|
|
7
7
|
export interface PluginRegistrations {
|
|
8
8
|
effectIds?: string[];
|
|
9
9
|
variableHandles?: string[];
|
|
10
|
-
additionalVariableEvents?: AdditionalVariableEvent[];
|
|
11
10
|
eventSourceIds?: string[];
|
|
12
11
|
filterIds?: string[];
|
|
13
12
|
systemCommandIds?: string[];
|
|
@@ -18,6 +17,8 @@ export interface PluginRegistrations {
|
|
|
18
17
|
overlayWidgetIds?: string[];
|
|
19
18
|
httpRoutePrefix?: string;
|
|
20
19
|
websocketListenerName?: string;
|
|
20
|
+
additionalVariableEvents?: AdditionalVariableEvent[];
|
|
21
|
+
additionalEffectEvents?: AdditionalEffectEvent[];
|
|
21
22
|
}
|
|
22
23
|
export type PluginExecutionResult = {
|
|
23
24
|
success: true;
|
package/package.json
CHANGED
package/types/effects.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ng from "angular";
|
|
2
2
|
import type { TriggerType, TriggersObject, Trigger } from "./triggers";
|
|
3
3
|
import type { Awaitable } from "./util-types";
|
|
4
|
+
import { EventSourceAndId } from "./events";
|
|
4
5
|
type Func<T> = (...args: unknown[]) => T;
|
|
5
6
|
export interface EffectScope<EffectModel> extends ng.IScope {
|
|
6
7
|
effect: EffectModel;
|
|
@@ -187,4 +188,13 @@ export type QueueState = {
|
|
|
187
188
|
mode: QueueMode;
|
|
188
189
|
runEffectsImmediatelyWhenPaused?: boolean;
|
|
189
190
|
};
|
|
191
|
+
export type AdditionalEffectEvent = {
|
|
192
|
+
effectId: string;
|
|
193
|
+
eventSourceId: string;
|
|
194
|
+
eventId: string;
|
|
195
|
+
};
|
|
196
|
+
export type PluginAdditionalEffectEvents = {
|
|
197
|
+
effectId: string;
|
|
198
|
+
events: EventSourceAndId[];
|
|
199
|
+
};
|
|
190
200
|
export {};
|
package/types/plugins.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EffectInstance, EffectList, EffectType } from "./effects";
|
|
1
|
+
import type { EffectInstance, EffectList, EffectType, PluginAdditionalEffectEvents } from "./effects";
|
|
2
2
|
import type { Trigger } from "./triggers";
|
|
3
3
|
import type { Awaitable } from "./util-types";
|
|
4
|
-
import type {
|
|
4
|
+
import type { PluginAdditionalVariableEvents, 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,7 +119,6 @@ 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>;
|
|
123
122
|
integrations?: DynamicArray<Integration<any>>;
|
|
124
123
|
filters?: DynamicArray<EventFilter>;
|
|
125
124
|
restrictions?: DynamicArray<RestrictionType<any>>;
|
|
@@ -130,6 +129,8 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
|
|
|
130
129
|
httpRoutes?: DynamicObject<PluginHttpRouteDefinition>;
|
|
131
130
|
websocketListener?: DynamicObject<CustomWebSocketHandler>;
|
|
132
131
|
webhooks?: DynamicObject<PluginWebhooks>;
|
|
132
|
+
additionalEffectEvents?: DynamicArray<PluginAdditionalEffectEvents>;
|
|
133
|
+
additionalVariableEvents?: DynamicArray<PluginAdditionalVariableEvents>;
|
|
133
134
|
};
|
|
134
135
|
/** Called when the plugin is loaded */
|
|
135
136
|
onLoad?: (context: ScriptContext<Params>, isInstalling?: boolean) => NoResult;
|
package/types/script-api.d.ts
CHANGED
|
@@ -65,13 +65,6 @@ export interface ScriptEventsApi {
|
|
|
65
65
|
trigger(sourceId: string, eventId: string, meta?: Record<string, unknown>): Promise<void>;
|
|
66
66
|
}
|
|
67
67
|
export interface ScriptEffectsApi {
|
|
68
|
-
/**
|
|
69
|
-
* Register an existing effect to be available for an event.
|
|
70
|
-
* Useful for surfacing built-in effects on script provided events.
|
|
71
|
-
*/
|
|
72
|
-
addEventToEffect(effectId: string, eventSourceId: string, eventId: string): void;
|
|
73
|
-
/** Reverse of `addEventToEffect`. */
|
|
74
|
-
removeEventFromEffect(effectId: string, eventSourceId: string, eventId: string): void;
|
|
75
68
|
/**
|
|
76
69
|
* Run an effect list. Respects the list's run mode and effect queue, if any.
|
|
77
70
|
* Resolves once the effects have been run (queued lists resolve
|
package/types/variables.d.ts
CHANGED