type
ConfigValueA materialized config value: a scalar, or a nested section object of further values.
@s2script/sdk/config
typed access to the plugin's materialized config.
import { ConfigValue } from "@s2script/sdk/config";Author-time types ship in the npm package; the engine injects the runtime at plugin load. Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
ConfigValueA materialized config value: a scalar, or a nested section object of further values.
ConfigThe whole materialized config: top-level keys to ConfigValues. Passed to ctx.config.onChange.
configTyped access to this plugin's materialized config values (declared under s2script.config in the manifest).
import { config } from "@s2script/sdk/config";
// plugins/antiflood/src/plugin.ts:31 — re-read on live-reload
const maxTokens = config.getInt("max_tokens");getString(key: string): string"" if the key is absent.getInt(key: string): number0 if the key is absent or non-numeric.getFloat(key: string): number0 if the key is absent or non-numeric.getBool(key: string): booleanfalse if the key is absent.readFile(name: string): string | nullwriteFile(name: string, content: string): void