@crowbartools/firebot-types 5.67.0-alpha2 → 5.67.0-alpha4
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/README.md +23 -13
- package/package.json +2 -2
- package/types/events.d.ts +2 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Type definitions and the script API contract for [Firebot](https://firebot.app) custom scripts and plugins.
|
|
4
4
|
|
|
5
|
-
This package is **type-only**. At runtime the `@crowbartools/firebot-types` module is provided by the Firebot host application via a `require()` interceptor
|
|
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
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -10,32 +10,42 @@ This package is **type-only**. At runtime the `@crowbartools/firebot-types` modu
|
|
|
10
10
|
npm i -D @crowbartools/firebot-types
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
A `@types/node` peer dependency is required
|
|
13
|
+
A `@types/node` peer dependency is required.
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
17
|
The default export is the runtime API object provided by Firebot. Named types are re-exported from the package root and can be imported alongside the default in a single statement.
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
-
import firebot, { Plugin
|
|
20
|
+
import firebot, { Plugin } from "@crowbartools/firebot-types";
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
type Params = {
|
|
23
|
+
message: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const plugin: Plugin<Params> = {
|
|
27
|
+
manifest: {
|
|
23
28
|
name: "My Plugin",
|
|
24
29
|
version: "1.0.0",
|
|
25
30
|
author: "you",
|
|
26
31
|
description: "Example",
|
|
27
32
|
type: "plugin"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
},
|
|
34
|
+
parametersSchema: [
|
|
35
|
+
{
|
|
36
|
+
name: "message",
|
|
37
|
+
type: "string",
|
|
38
|
+
default: "Hello World!",
|
|
39
|
+
title: "Hello!",
|
|
40
|
+
description: "Message",
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
onLoad: (context) => {
|
|
44
|
+
firebot.logger.info(`${context.parameters.message} (${firebot.version})`);
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Deep imports for less common types are also supported:
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
import type { EffectHelperService } from "@crowbartools/firebot-types/types/ui/effect-helper-service";
|
|
48
|
+
export default plugin;
|
|
39
49
|
```
|
|
40
50
|
|
|
41
51
|
CommonJS style works too (requires `esModuleInterop` in your tsconfig):
|
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 script API for Firebot custom scripts
|
|
3
|
+
"version": "5.67.0-alpha4",
|
|
4
|
+
"description": "Type definitions and script API for Firebot plugins and custom scripts.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"exports": {
|