@crowbartools/firebot-types 5.67.0-alpha1.1 → 5.67.0-alpha1.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowbartools/firebot-types",
3
- "version": "5.67.0-alpha1.1",
3
+ "version": "5.67.0-alpha1.3",
4
4
  "description": "Type definitions and script API for Firebot custom scripts and plugins.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -384,7 +384,7 @@ type FirebotParamCategory<ParamConfig extends Record<string, unknown>> = {
384
384
  settings: ParametersConfig<ParamConfig>;
385
385
  };
386
386
 
387
- export type FirebotParams = Record<string, Record<string, unknown>>;
387
+ export type FirebotParams = Record<string, unknown>;
388
388
 
389
389
  export type FirebotParameterCategories<Config extends FirebotParams> = {
390
390
  [Category in keyof Config]: FirebotParamCategory<Config[Category]>;
@@ -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: Record<string, unknown>;
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, isUninstalling?: boolean) => NoResult;
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, isInstalling?: boolean) => NoResult;
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, isUninstalling?: boolean) => NoResult;
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">;