@crowbartools/firebot-types 5.67.0-alpha1.1 → 5.67.0-alpha1.2
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/package.json +1 -1
- package/types/plugins.d.ts +7 -7
package/package.json
CHANGED
package/types/plugins.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export type InstalledPluginConfig<Params extends GenericParameters = GenericPara
|
|
|
21
21
|
parameters: Params;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type ScriptContext = {
|
|
24
|
+
export type ScriptContext<Params extends FirebotParams = FirebotParams> = {
|
|
25
25
|
trigger?: Trigger;
|
|
26
|
-
parameters:
|
|
26
|
+
parameters: Params;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
type DynamicArray<T> = Array<T | ((context: ScriptContext) => Awaitable<T>)>;
|
|
@@ -80,12 +80,12 @@ export interface ScriptBase<Params extends FirebotParams = FirebotParams> {
|
|
|
80
80
|
|
|
81
81
|
// if uninstalled is true, the script is being removed by the user, thus the script should remove related data files/assets
|
|
82
82
|
// otherwise the script should assume firebot is closing or the script is being reloaded
|
|
83
|
-
onUnload?: (context: ScriptContext
|
|
83
|
+
onUnload?: (context: ScriptContext<Params>, isUninstalling?: boolean) => NoResult;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// Supplants the "Run Script" effect script functionality
|
|
87
87
|
export interface EffectScript<Params extends FirebotParams = FirebotParams> extends ScriptBase<Params> {
|
|
88
|
-
run: (context: ScriptContext) => Awaitable<void | EffectScriptResult>;
|
|
88
|
+
run: (context: ScriptContext<Params>) => Awaitable<void | EffectScriptResult>;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// Supplants the "Start up" script functionality
|
|
@@ -111,13 +111,13 @@ export interface Plugin<Params extends FirebotParams = FirebotParams> extends Sc
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
// Called when the script is loaded
|
|
114
|
-
onLoad?: (context: ScriptContext
|
|
114
|
+
onLoad?: (context: ScriptContext<Params>, isInstalling?: boolean) => NoResult;
|
|
115
115
|
|
|
116
116
|
// Called when firebot is closing or plugin is disabled / removed
|
|
117
|
-
onUnload?: (context: ScriptContext
|
|
117
|
+
onUnload?: (context: ScriptContext<Params>, isUninstalling?: boolean) => NoResult;
|
|
118
118
|
|
|
119
119
|
// called when the user updates plugin-specific parameters
|
|
120
|
-
onParameterUpdate?: (context: ScriptContext) => NoResult;
|
|
120
|
+
onParameterUpdate?: (context: ScriptContext<Params>) => NoResult;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
export type ScriptDetails = Pick<ScriptBase, "manifest" | "parametersSchema">;
|