TextSubstitute
Callable
Type parameters
- T
Parameters
textTag: string
Tag for the text to find
replacers: Record<string, T>
An object mapping replacement terms to values. Note that Node elements are cloned prior to the replacement
optionaloptions: { textCache: TextCache }
textCache: TextCache
A custom text cache from which to retrieve the text; defaults to TextScreenCache
Returns (string | T)[]
The text associated to the tag, split into a list according to the passed replacers. Missing tag texts will be interpreted as empty strings.
Finds the text value linked to the tag in the buffer, partition the text value into separate parts using the given replacer keys, and then substitute them with replacer values