Skip to content

@pumpkin-plugins/config API / fields / field

Function: field() ​

field<T>(spec): Field<T | undefined>

Defined in: tools/config/src/fields.ts:57

Builds a field from custom TOML-compatible values. Prefer bool, int and str. Defaults that contain objects must use plain tables, dense arrays and Date values so config results can copy them. Root undefined is reserved for the optional default; nested undefined, null, functions, symbols, symbol-keyed table entries, cycles and other JavaScript object types are rejected.

Type Parameters ​

T ​

T

Parameters ​

spec ​

default ​

T | undefined

description ​

string

example ​

T

expected ​

string

format ​

(value) => string

migrateFrom? ​

readonly string[]

parse ​

(raw) => Parsed<T>

type ​

FieldType

Returns ​

Field<T | undefined>

pumpkin-plugins documentation