@crowbartools/firebot-types
v5.67.0-alpha30
Published
Type definitions and plugin API for Firebot plugins.
Readme
@crowbartools/firebot-types
Type definitions and the plugin API contract for Firebot plugins.
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).
Install
npm i -D @crowbartools/firebot-typesThe following peer dependencies are required:
@types/express@types/node
Usage
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.
import firebot, { Plugin } from "@crowbartools/firebot-types";
type Params = {
message: string;
}
const plugin: Plugin<Params> = {
manifest: {
name: "My Plugin",
version: "1.0.0",
author: "you",
description: "Example",
type: "plugin"
},
parametersSchema: [
{
name: "message",
type: "string",
default: "Hello World!",
title: "Hello!",
description: "Message",
}
],
onLoad: (context) => {
firebot.logger.info(`${context.parameters.message} (${firebot.version})`);
}
}
export default plugin;CommonJS style works too (requires esModuleInterop in your tsconfig):
const firebot = require("@crowbartools/firebot-types").default;
firebot.logger.info(firebot.version);The version of this package tracks the Firebot version that produced it.
