@crowbartools/firebot-types 5.67.0-alpha19 → 5.67.0-alpha20
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/README.md +1 -1
- package/backend/bonjour-manager.d.ts +11 -0
- package/backend/common/settings-manager.d.ts +7 -2
- package/backend/control-deck/control-deck-manager.d.ts +13 -0
- package/backend/effects/builtin/set-active-control-deck.d.ts +6 -0
- package/backend/effects/builtin/set-default-control-deck.d.ts +5 -0
- package/backend/plugin-log-names.d.ts +3 -0
- package/backend/plugins/executors/legacy-effect-script-executor.d.ts +15 -0
- package/backend/plugins/executors/legacy-startup-script-executor.d.ts +15 -0
- package/backend/plugins/executors/plugin-executor.d.ts +18 -0
- package/backend/{scripts/executors/script-executor.interface.d.ts → plugins/executors/plugin-executor.interface.d.ts} +9 -12
- package/backend/{scripts/script-api → plugins/plugin-api}/context.d.ts +12 -17
- package/backend/plugins/plugin-api/index.d.ts +8 -0
- package/backend/plugins/plugin-api/internal/define-namespace.d.ts +3 -0
- package/backend/{scripts/script-api → plugins/plugin-api}/internal/dispose-bag.d.ts +1 -1
- package/backend/{scripts/script-api → plugins/plugin-api}/internal/name-normalizer.d.ts +1 -1
- package/backend/plugins/plugin-api/internal/plugin-data-dir.d.ts +1 -0
- package/backend/plugins/plugin-api/namespaces/effects.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/event-filter-factory.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/events.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/frontend-communicator.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/http-server.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/logger.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/notifications.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/parameters.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/plugins.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/settings.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/storage.d.ts +6 -0
- package/backend/plugins/plugin-api/namespaces/twitch.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/variable-factory.d.ts +2 -0
- package/backend/plugins/plugin-api/namespaces/webhooks.d.ts +2 -0
- package/backend/{scripts/script-manager.d.ts → plugins/plugin-manager.d.ts} +26 -29
- package/backend/variables/builtin/metadata/control-deck-input.d.ts +3 -0
- package/index.d.ts +2 -2
- package/package.json +2 -2
- package/server/http-server-manager.d.ts +1 -0
- package/server/websocket-client.d.ts +1 -1
- package/server/websocket-server-manager.d.ts +1 -0
- package/types/control-deck.d.ts +146 -0
- package/types/index.d.ts +1 -0
- package/types/notifications.d.ts +2 -2
- package/types/{script-api.d.ts → plugin-api.d.ts} +48 -48
- package/types/plugins.d.ts +15 -25
- package/types/settings.d.ts +4 -0
- package/types/triggers.d.ts +1 -1
- package/types/ui/object-copy-helper.d.ts +1 -0
- package/backend/script-log-names.d.ts +0 -3
- package/backend/scripts/executors/effect-script-executor.d.ts +0 -22
- package/backend/scripts/executors/legacy-effect-script-executor.d.ts +0 -12
- package/backend/scripts/executors/legacy-startup-script-executor.d.ts +0 -15
- package/backend/scripts/executors/plugin-executor.d.ts +0 -18
- package/backend/scripts/script-api/index.d.ts +0 -8
- package/backend/scripts/script-api/internal/define-namespace.d.ts +0 -3
- package/backend/scripts/script-api/internal/script-data-dir.d.ts +0 -1
- package/backend/scripts/script-api/namespaces/effects.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/event-filter-factory.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/events.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/frontend-communicator.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/http-server.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/logger.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/notifications.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/parameters.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/plugins.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/settings.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/storage.d.ts +0 -6
- package/backend/scripts/script-api/namespaces/twitch.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/variable-factory.d.ts +0 -2
- package/backend/scripts/script-api/namespaces/webhooks.d.ts +0 -2
- /package/backend/{scripts → plugins}/plugin-config-manager.d.ts +0 -0
- /package/backend/{scripts → plugins}/plugin-manifest-utils.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @crowbartools/firebot-types
|
|
2
2
|
|
|
3
|
-
Type definitions and the
|
|
3
|
+
Type definitions and the plugin API contract for [Firebot](https://firebot.app) plugins.
|
|
4
4
|
|
|
5
5
|
This package is **type-only**. At runtime the `@crowbartools/firebot-types` module is provided by the Firebot host application via a `require()` interceptor (installing this package in a standalone Node project and importing it will throw).
|
|
6
6
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
2
|
import type { FirebotAutoUpdateLevel, FirebotSettingsTypes } from "../../types";
|
|
3
|
-
|
|
3
|
+
type Events = {
|
|
4
|
+
[settingName in keyof FirebotSettingsTypes as `settings:setting-updated:${settingName}`]: (data: FirebotSettingsTypes[settingName]) => void;
|
|
5
|
+
} & {
|
|
6
|
+
[settingName in keyof FirebotSettingsTypes as `settings:setting-deleted:${settingName}`]: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare class SettingsManager extends TypedEmitter<Events> {
|
|
4
9
|
private logger;
|
|
5
10
|
settingsCache: Partial<Record<keyof FirebotSettingsTypes, unknown>>;
|
|
6
11
|
constructor();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ControlDeck, ControlDeckControl } from "../../types";
|
|
2
|
+
import JsonDbManager from "../database/json-db-manager";
|
|
3
|
+
declare class ControlDeckManager extends JsonDbManager<ControlDeck> {
|
|
4
|
+
constructor();
|
|
5
|
+
saveDeck(deck: ControlDeck, notify?: boolean): ControlDeck;
|
|
6
|
+
deleteDeck(deckId: string): void;
|
|
7
|
+
getControl(deckId: string, controlId: string): ControlDeckControl | null;
|
|
8
|
+
triggerControl(deckId: string, controlId: string, inputValues?: Record<string, string | number | boolean>): boolean;
|
|
9
|
+
private broadcastToControlDecks;
|
|
10
|
+
triggerUiRefresh(): void;
|
|
11
|
+
}
|
|
12
|
+
declare const controlDeckManager: ControlDeckManager;
|
|
13
|
+
export { controlDeckManager as ControlDeckManager };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PluginBase, LegacyCustomScript, PluginContext, PluginDetails } from "../../../types";
|
|
2
|
+
import type { EffectScriptExecutionResult } from "./plugin-executor.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Executor for legacy effect scripts (run function with no manifest or startupOnly !== true)
|
|
5
|
+
*/
|
|
6
|
+
export declare class LegacyEffectScriptExecutor {
|
|
7
|
+
canHandle(script: PluginBase | LegacyCustomScript): Promise<boolean>;
|
|
8
|
+
getScriptDetails(script: PluginBase | LegacyCustomScript): Promise<PluginDetails | null>;
|
|
9
|
+
executeScript(script: PluginBase | LegacyCustomScript, context: PluginContext): Promise<EffectScriptExecutionResult>;
|
|
10
|
+
private isLegacy;
|
|
11
|
+
/**
|
|
12
|
+
* Runs effects returned by a custom script and returns flow-control flags.
|
|
13
|
+
*/
|
|
14
|
+
private runEffectsResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PluginBase, LegacyCustomScript, InstalledPluginConfig, PluginDetails } from "../../../types";
|
|
2
|
+
import { IPluginExecutor, PluginExecutionResult } from "./plugin-executor.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Executor for legacy startup scripts (scripts that export a getScriptManifest function that returns an object with startupOnly: true)
|
|
5
|
+
*/
|
|
6
|
+
export declare class LegacyStartUpScript extends IPluginExecutor {
|
|
7
|
+
constructor();
|
|
8
|
+
canHandle(script: PluginBase | LegacyCustomScript): Promise<boolean>;
|
|
9
|
+
executePlugin(script: PluginBase | LegacyCustomScript, config: InstalledPluginConfig): Promise<PluginExecutionResult>;
|
|
10
|
+
unloadPlugin(script: PluginBase | LegacyCustomScript, config: InstalledPluginConfig): Promise<void>;
|
|
11
|
+
updateParameters(script: PluginBase | LegacyCustomScript, config: InstalledPluginConfig): Promise<void>;
|
|
12
|
+
getPluginDetails(script: PluginBase | LegacyCustomScript): Promise<PluginDetails>;
|
|
13
|
+
private buildParameters;
|
|
14
|
+
private isLegacyScript;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PluginBase, LegacyCustomScript, Plugin, InstalledPluginConfig, PluginDetails } from "../../../types";
|
|
2
|
+
import { IPluginExecutor, PluginRegistrations, PluginExecutionResult } from "./plugin-executor.interface";
|
|
3
|
+
import { PluginApiContext } from "../plugin-api";
|
|
4
|
+
/**
|
|
5
|
+
* Executor for new-spec Plugins (manifest.type === "plugin")
|
|
6
|
+
*/
|
|
7
|
+
export declare class PluginExecutor extends IPluginExecutor {
|
|
8
|
+
constructor();
|
|
9
|
+
canHandle(plugin: PluginBase | LegacyCustomScript): plugin is Plugin<import("../../../types").FirebotParams>;
|
|
10
|
+
getPluginDetails(plugin: PluginBase | LegacyCustomScript): PluginDetails | null;
|
|
11
|
+
executePlugin(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig, isInstalling?: boolean, ctx?: PluginApiContext): Promise<PluginExecutionResult>;
|
|
12
|
+
unloadPlugin(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig, registrations?: PluginRegistrations, isUninstalling?: boolean): Promise<void>;
|
|
13
|
+
updateParameters(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig): Promise<void>;
|
|
14
|
+
private registerAll;
|
|
15
|
+
private runUnregistrations;
|
|
16
|
+
private buildParameters;
|
|
17
|
+
private isPlugin;
|
|
18
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InstalledPluginConfig, LegacyCustomScript,
|
|
2
|
-
import type {
|
|
3
|
-
declare abstract class
|
|
4
|
-
abstract canHandle(
|
|
5
|
-
abstract
|
|
1
|
+
import { InstalledPluginConfig, LegacyCustomScript, PluginBase, Awaitable, PluginDetails, AdditionalVariableEvent, AdditionalEffectEvent } from "../../../types";
|
|
2
|
+
import type { PluginApiContext } from "../plugin-api";
|
|
3
|
+
declare abstract class IBasePluginExecutor {
|
|
4
|
+
abstract canHandle(plugin: PluginBase | LegacyCustomScript): Awaitable<boolean>;
|
|
5
|
+
abstract getPluginDetails(plugin: PluginBase | LegacyCustomScript): Awaitable<PluginDetails | null>;
|
|
6
6
|
}
|
|
7
7
|
export interface PluginRegistrations {
|
|
8
8
|
effectIds?: string[];
|
|
@@ -27,10 +27,10 @@ export type PluginExecutionResult = {
|
|
|
27
27
|
success: false;
|
|
28
28
|
error: string;
|
|
29
29
|
};
|
|
30
|
-
export declare abstract class IPluginExecutor extends
|
|
31
|
-
abstract executePlugin(
|
|
32
|
-
abstract unloadPlugin(
|
|
33
|
-
updateParameters?(
|
|
30
|
+
export declare abstract class IPluginExecutor extends IBasePluginExecutor {
|
|
31
|
+
abstract executePlugin(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig, isInstalling?: boolean, ctx?: PluginApiContext): Awaitable<PluginExecutionResult>;
|
|
32
|
+
abstract unloadPlugin(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig, registrations?: PluginRegistrations, isUninstalling?: boolean): Awaitable<void>;
|
|
33
|
+
updateParameters?(plugin: PluginBase | LegacyCustomScript, config: InstalledPluginConfig): Awaitable<void>;
|
|
34
34
|
}
|
|
35
35
|
export type EffectScriptExecutionResult = {
|
|
36
36
|
success: true;
|
|
@@ -42,7 +42,4 @@ export type EffectScriptExecutionResult = {
|
|
|
42
42
|
success: false;
|
|
43
43
|
error: string;
|
|
44
44
|
};
|
|
45
|
-
export declare abstract class IEffectScriptExecutor extends IBaseScriptExecutor {
|
|
46
|
-
abstract executeScript(script: ScriptBase | LegacyCustomScript, context: ScriptContext): Awaitable<EffectScriptExecutionResult>;
|
|
47
|
-
}
|
|
48
45
|
export {};
|
|
@@ -3,47 +3,42 @@ import { DisposeBag, DisposeFn } from "./internal/dispose-bag";
|
|
|
3
3
|
import { normalizeName } from "./internal/name-normalizer";
|
|
4
4
|
declare const logger: import("winston").Logger;
|
|
5
5
|
/**
|
|
6
|
-
* The per-
|
|
6
|
+
* The per-plugin context handed to every namespace factory.
|
|
7
7
|
*
|
|
8
|
-
* `manifest` is populated after the
|
|
8
|
+
* `manifest` is populated after the plugin is first loaded. Shim methods should read `ctx.manifest`
|
|
9
9
|
* lazily (inside method bodies) instead of at factory time.
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface PluginApiContext {
|
|
12
12
|
/** If a plugin, the installed config id. */
|
|
13
13
|
readonly pluginId?: string;
|
|
14
14
|
/**
|
|
15
|
-
* Normalized, filesystem-safe scope id for this plugin
|
|
15
|
+
* Normalized, filesystem-safe scope id for this plugin.
|
|
16
16
|
*/
|
|
17
17
|
readonly scriptId: string;
|
|
18
|
-
/** The on-disk filename of the
|
|
18
|
+
/** The on-disk filename of the plugin. */
|
|
19
19
|
readonly fileName: string;
|
|
20
20
|
/** Manifest, once known. Undefined during very-early loading. */
|
|
21
21
|
readonly manifest: Manifest | undefined;
|
|
22
22
|
/** Human-friendly display name. Manifest name when available, else fileName. */
|
|
23
23
|
readonly displayName: string;
|
|
24
|
-
/** Absolute path to this
|
|
24
|
+
/** Absolute path to this plugin's data directory. */
|
|
25
25
|
readonly scriptDataDir: string;
|
|
26
|
-
/** Winston child logger pre-tagged with `{
|
|
26
|
+
/** Winston child logger pre-tagged with `{ plugin: pluginId }`. */
|
|
27
27
|
readonly logger: typeof logger;
|
|
28
|
-
/** True when
|
|
28
|
+
/** True when plugin is being inspected (e.g. during early detail / manifest retrieval). */
|
|
29
29
|
readonly isInspecting: boolean;
|
|
30
30
|
/** Register a teardown callback fired when the plugin is unloaded. */
|
|
31
31
|
onDispose(fn: DisposeFn): void;
|
|
32
32
|
}
|
|
33
|
-
export interface
|
|
34
|
-
readonly context:
|
|
33
|
+
export interface PluginApiContextHandle {
|
|
34
|
+
readonly context: PluginApiContext;
|
|
35
35
|
readonly disposeBag: DisposeBag;
|
|
36
36
|
}
|
|
37
|
-
export type
|
|
37
|
+
export type PluginApiContextSource = {
|
|
38
38
|
kind: "plugin";
|
|
39
39
|
config: InstalledPluginConfig;
|
|
40
40
|
manifest: Manifest;
|
|
41
41
|
isInspecting: boolean;
|
|
42
|
-
} | {
|
|
43
|
-
kind: "effect-script";
|
|
44
|
-
fileName: string;
|
|
45
|
-
manifest: Manifest;
|
|
46
|
-
isInspecting: boolean;
|
|
47
42
|
};
|
|
48
|
-
export declare function
|
|
43
|
+
export declare function createPluginApiContext(source: PluginApiContextSource): PluginApiContextHandle;
|
|
49
44
|
export { normalizeName };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FirebotPluginApi } from "../../../types/plugin-api";
|
|
2
|
+
import type { PluginApiContext } from "./context";
|
|
3
|
+
/**
|
|
4
|
+
* Composition root for the Firebot Plugin API
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildPluginApi(ctx: PluginApiContext): FirebotPluginApi;
|
|
7
|
+
export type { PluginApiContext, PluginApiContextSource } from "./context";
|
|
8
|
+
export { createPluginApiContext } from "./context";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type DisposeFn = () => void | Promise<void>;
|
|
2
2
|
/**
|
|
3
|
-
* Collects teardown callbacks registered by
|
|
3
|
+
* Collects teardown callbacks registered by plugin-api namespaces during plugin
|
|
4
4
|
* startup, and drains them (in reverse order / LIFO) when the plugin is unloaded.
|
|
5
5
|
*/
|
|
6
6
|
export declare class DisposeBag {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolvePluginDataDir(pluginId: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PluginStorageApi } from "../../../../types/plugin-api";
|
|
2
|
+
/**
|
|
3
|
+
* Simple per-plugin storage. Lets a plugin easily save/load JSON values or
|
|
4
|
+
* arbitrary files inside its own data directory.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createStorageApi: import("../internal/define-namespace").PluginApiNamespaceFactory<PluginStorageApi>;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { InstalledPlugin, InstalledPluginConfig,
|
|
2
|
-
import { EffectScriptExecutionResult } from "./executors/
|
|
3
|
-
type
|
|
1
|
+
import type { InstalledPlugin, InstalledPluginConfig, PluginDetails, PluginType, Trigger } from "../../types";
|
|
2
|
+
import { EffectScriptExecutionResult } from "./executors/plugin-executor.interface";
|
|
3
|
+
type GetPluginDetailsResult = {
|
|
4
4
|
success: true;
|
|
5
5
|
fileName: string;
|
|
6
|
-
|
|
7
|
-
details:
|
|
6
|
+
pluginType: "plugin" | "script";
|
|
7
|
+
details: PluginDetails;
|
|
8
8
|
} | {
|
|
9
9
|
success: false;
|
|
10
10
|
error: string;
|
|
11
11
|
};
|
|
12
|
-
declare class
|
|
12
|
+
declare class PluginManager {
|
|
13
13
|
private startingPlugins;
|
|
14
14
|
private activePlugins;
|
|
15
15
|
private pendingApiInstances;
|
|
16
|
-
private effectScriptApiInstances;
|
|
17
16
|
private requireInterceptorInstalled;
|
|
18
17
|
private pluginExecutors;
|
|
19
|
-
private
|
|
18
|
+
private legacyEffectScriptExecutor;
|
|
20
19
|
constructor();
|
|
21
20
|
startPlugin(pluginConfig: InstalledPluginConfig, installing?: boolean): Promise<void>;
|
|
22
21
|
private doStartPlugin;
|
|
23
22
|
startPlugins(): Promise<void>;
|
|
24
23
|
stopPlugin(pluginId: string, uninstalling?: boolean): Promise<void>;
|
|
25
24
|
/**
|
|
26
|
-
* Convenience helper for hot-reloading. Finds an active plugin by its
|
|
25
|
+
* Convenience helper for hot-reloading. Finds an active plugin by its plugin file
|
|
27
26
|
* name and restarts it (stop then start). Does nothing if no active plugin matches.
|
|
28
27
|
*/
|
|
29
28
|
restartPluginByFileName(fileName: string): Promise<void>;
|
|
@@ -35,23 +34,23 @@ declare class ScriptManager {
|
|
|
35
34
|
reloadPluginConfig(pluginConfig: InstalledPluginConfig, isNewInstall?: boolean): Promise<void>;
|
|
36
35
|
setPluginEnabled(pluginId: string, enabled: boolean): Promise<void>;
|
|
37
36
|
getInstalledPlugins(): Promise<InstalledPlugin[]>;
|
|
38
|
-
private
|
|
37
|
+
private doGetPluginDetailsByFileName;
|
|
39
38
|
/**
|
|
40
|
-
* Loads a
|
|
39
|
+
* Loads a plugin file (without persisting a config) and returns its details for
|
|
41
40
|
* the install / edit UI.
|
|
42
41
|
*/
|
|
43
|
-
|
|
42
|
+
getPluginDetailsByFileName(fileName: string, expectedPluginType?: PluginType): Promise<GetPluginDetailsResult>;
|
|
44
43
|
/**
|
|
45
44
|
* Validates a file at any path on disk and copies it into the scripts folder.
|
|
46
45
|
* Does NOT persist an InstalledPluginConfig — caller does that on save.
|
|
47
46
|
*/
|
|
48
|
-
|
|
47
|
+
installPluginFromPath(sourcePath: string, overwrite?: boolean): Promise<GetPluginDetailsResult | {
|
|
49
48
|
success: false;
|
|
50
49
|
error: string;
|
|
51
50
|
conflict?: boolean;
|
|
52
51
|
}>;
|
|
53
52
|
/**
|
|
54
|
-
* Delete a copied
|
|
53
|
+
* Delete a copied plugin file that the user cancelled installing, but only
|
|
55
54
|
* when no config currently references it.
|
|
56
55
|
*/
|
|
57
56
|
cancelInstall(fileName: string): Promise<void>;
|
|
@@ -60,17 +59,17 @@ declare class ScriptManager {
|
|
|
60
59
|
* plugin.
|
|
61
60
|
*/
|
|
62
61
|
onPluginConfigDeleted(pluginConfig: InstalledPluginConfig): Promise<void>;
|
|
63
|
-
|
|
62
|
+
deletePluginFileIfUnreferenced(fileName: string): Promise<void>;
|
|
64
63
|
/**
|
|
65
64
|
* Remove an installed plugin. Stops the plugin and deletes its config, and
|
|
66
|
-
* optionally deletes the underlying
|
|
65
|
+
* optionally deletes the underlying plugin file from the scripts folder.
|
|
67
66
|
*/
|
|
68
|
-
deletePlugin(pluginId: string,
|
|
67
|
+
deletePlugin(pluginId: string, deletePluginFile?: boolean): Promise<boolean>;
|
|
69
68
|
/**
|
|
70
|
-
* Replace the underlying
|
|
69
|
+
* Replace the underlying plugin file for an existing plugin config with a new file
|
|
71
70
|
* chosen on disk.
|
|
72
71
|
*/
|
|
73
|
-
updatePluginFromPath(pluginId: string, sourcePath: string, overwrite?: boolean): Promise<
|
|
72
|
+
updatePluginFromPath(pluginId: string, sourcePath: string, overwrite?: boolean): Promise<GetPluginDetailsResult | {
|
|
74
73
|
success: false;
|
|
75
74
|
error: string;
|
|
76
75
|
conflict?: boolean;
|
|
@@ -79,23 +78,21 @@ declare class ScriptManager {
|
|
|
79
78
|
scriptName: string;
|
|
80
79
|
parameters?: Record<string, unknown>;
|
|
81
80
|
}, trigger?: Trigger): Promise<EffectScriptExecutionResult | undefined>;
|
|
82
|
-
private
|
|
83
|
-
private getScriptFilePath;
|
|
81
|
+
private getPluginFilePath;
|
|
84
82
|
private getActivePluginByFileName;
|
|
85
83
|
private findPluginExecutor;
|
|
86
84
|
private installRequireInterceptor;
|
|
87
85
|
private createApiInstance;
|
|
88
|
-
private
|
|
86
|
+
private loadPlugin;
|
|
89
87
|
/**
|
|
90
|
-
* Hack to load a
|
|
88
|
+
* Hack to load a plugin without registering it in `require.cache`.
|
|
91
89
|
*
|
|
92
90
|
* Used for read-only inspection (manifest / parameter schema lookup) so that
|
|
93
|
-
* loading a fresh copy of a
|
|
91
|
+
* loading a fresh copy of a plugin does not evict or replace the cached module
|
|
94
92
|
* of a currently-running plugin is holding a reference to.
|
|
95
93
|
*/
|
|
96
|
-
private
|
|
97
|
-
private
|
|
94
|
+
private loadPluginIsolated;
|
|
95
|
+
private isValidPlugin;
|
|
98
96
|
}
|
|
99
|
-
declare const
|
|
100
|
-
export
|
|
101
|
-
export { ScriptManager };
|
|
97
|
+
declare const pluginManager: PluginManager;
|
|
98
|
+
export { pluginManager as PluginManager };
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Auto-generated by grunt build-types. Do not edit by hand.
|
|
2
|
-
import {
|
|
2
|
+
import { FirebotPluginApi } from "./types/plugin-api";
|
|
3
3
|
|
|
4
4
|
export * from "./types";
|
|
5
5
|
|
|
6
|
-
declare const firebot:
|
|
6
|
+
declare const firebot: FirebotPluginApi;
|
|
7
7
|
export default firebot;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowbartools/firebot-types",
|
|
3
|
-
"version": "5.67.0-
|
|
4
|
-
"description": "Type definitions and
|
|
3
|
+
"version": "5.67.0-alpha20",
|
|
4
|
+
"description": "Type definitions and plugin API for Firebot plugins.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -42,6 +42,7 @@ declare class HttpServerManager extends EventEmitter {
|
|
|
42
42
|
* @param overlayInstance the instance to refresh, leave undefined to refresh default
|
|
43
43
|
*/
|
|
44
44
|
refreshOverlayInstance(overlayInstance?: string): void;
|
|
45
|
+
sendToControlDecks(eventName: string, data?: unknown): void;
|
|
45
46
|
triggerCustomWebSocketEvent(eventType: string, payload: object): void;
|
|
46
47
|
createServerInstance(): Express;
|
|
47
48
|
startHttpServer(name: string, port: number, instance: Express): http.Server;
|
|
@@ -11,6 +11,7 @@ declare class WebSocketServerManager extends EventEmitter {
|
|
|
11
11
|
sendToOverlay(eventName: string, meta?: Record<string, unknown>, overlayInstance?: string): void;
|
|
12
12
|
sendWidgetEventToOverlay(event: WidgetOverlayEvent): void;
|
|
13
13
|
refreshAllOverlays(): void;
|
|
14
|
+
sendToControlDecks(eventName: string, data?: unknown): void;
|
|
14
15
|
triggerEvent(eventType: string, payload: unknown): void;
|
|
15
16
|
reportClientsToFrontend(isDefaultServerStarted: boolean): void;
|
|
16
17
|
getNumberOfOverlayClients(): number;
|