Files
factorio-clusterio/plugins/statistics_exporter/info.ts
T
Hornwitser e74065a493 Remove config groups
Refactor away the config group concept and simplyfy the way config
fields are defined.  Fields are defined directly as properties of the
static field fieldDefinitions on the class itself with a separate
interface to declare the types of fields.

This makes it possible to easily make accessing the config fields type
checked in a way that lets plugins extend the interfaces with their own
config options by adding additional fields to the interface via
declation merging.
2024-01-09 02:19:07 +01:00

26 lines
736 B
TypeScript

import * as lib from "@clusterio/lib";
declare module "@clusterio/lib" {
export interface InstanceConfigFields {
"statistics_exporter.command_timeout": number;
}
}
export default {
name: "statistics_exporter",
title: "Statistics Exporter",
description:
"Provides in-game item/fluid production, builds, kills, and pollution "+
"statistics to the cluster's Prometheus endpoint.",
instanceEntrypoint: "dist/plugin/instance",
instanceConfigFields: {
"statistics_exporter.command_timeout": {
title: "Command Timeout",
description:
"Timeout in seconds of the metrics command before returning results from the previous invocation.",
type: "number",
initialValue: 1,
},
},
} satisfies lib.PluginDeclaration;