Type of the optional second parameter of the constructor of TypedSettingProps, to customise pack / unpack / initiate behaviour of the wrapper for individual SettingsType properties. Expects an object, with matching keys of the SettingsType. Under a matching key, 'packer' and 'unpackInitiator' can be provided as functions. For example:
{
stringConfusingVal: {
packer: v => v,
unpackInitiator: v => v
}
}
A packer function receives a value of the type of the matching SettingsType property and returns a string. An unpackInitiator receives a string or undefined and returns a value of the type of the matching SettingsType property. If an unpackInitiator is provided, but no setting is under the matching key, the unpackInitiator will be called with 'undefined', acting as an initiator to return a default value for the key.
A marker, to be used with TypedSettingProps.update()
The default unpacker/initiator of the wrapper. First attempt to JSON.parse(setting), if fails, just return setting as string.
setting string
Return JSON.stringify(value) if value is not string, otherwise just return value. Can be used as packer if desired.
Generated using TypeDoc
utility type, remove 'undefined' from T