@pumpkin-plugins/upnpumpkin API / config/load / loadPluginConfig
Function: loadPluginConfig()
loadPluginConfig(
files,log,current?):object
Defined in: packages/upnpumpkin/src/config/load.ts:24
Loads the plugin's config, creating or upgrading the file as needed, and reports what happened. A file that is not valid TOML is never overwritten. Without current settings the defaults are used until it is fixed.
Parameters
files
DataFiles
log
Logger
current?
The settings in use. When given, a file that is not valid TOML throws instead, so the caller can keep these and say why.
bedrock
SectionValues<{ enabled: Field<boolean>; port: Field<number>; }> = ...
java
SectionValues<{ enabled: Field<boolean>; port: Field<number>; }> = ...
plugins
SectionValues<{ allow_requests: Field<boolean>; allowed: Field<string[]>; max_requests_per_plugin: Field<number>; }> = ...
router
SectionValues<{ lease_seconds: Field<number>; nat_pmp: Field<boolean>; nat_pmp_gateway: Field<string>; upnp: Field<boolean>; upnp_search: Field<string>; }> = ...
Returns
object
The settings to run with.
bedrock
bedrock:
SectionValues<{enabled:Field<boolean>;port:Field<number>; }>
java
java:
SectionValues<{enabled:Field<boolean>;port:Field<number>; }>
plugins
plugins:
SectionValues<{allow_requests:Field<boolean>;allowed:Field<string[]>;max_requests_per_plugin:Field<number>; }>
router
router:
SectionValues<{lease_seconds:Field<number>;nat_pmp:Field<boolean>;nat_pmp_gateway:Field<string>;upnp:Field<boolean>;upnp_search:Field<string>; }>
Throws
When current is given and the file is not valid TOML.