Readonly
canonicalThe canonical parser function hook.
This property is automatically set and updated on a successful call of setHook.
The indices of the child objects within the parseTemplates result array.
The ending index of this double-braced markup in the wikitext (exclusive).
Readonly
hookThe parser function hook. This may be an alias of the canonical hook.
This property is read-only. To update it, use setHook.
The index of this object within the result array returned by parseTemplates.
The nesting level of this double-braced markup. 0
if not nested within another double-braced expression.
Parameters of the instance. These are not automatically trimmed of leading and trailing whitespace.
The index of the parent object within the parseTemplates result array,
or null
if there is no parent.
The raw parser function hook, as directly parsed from the wikitext.
Whether the double-braced markup appears inside an HTML tag specified in SkipTags.
The starting index of this double-braced markup in the wikitext.
The original text of the double-braced markup parsed from the wikitext. The value of this property is static.
Adds a parameter (to the end of the params array).
The new parameter.
Deletes a parameter.
The parameter index to delete.
Whether to shift the remaining parameters to the left after deletion. (Default: true
)
true
if the parameter was deleted, otherwise false
.
Gets a parameter at the given index.
The index of the parameter to retrieve.
The parameter value, or null
if no value is found at the specified index.
Checks if a parameter at the specified index exists, optionally matching its value.
The parameter index to match.
Optional
value: string | RegExpThe optional value matcher.
true
if a matching parameter exists; otherwise, false
.
Checks if a parameter exists based on a custom predicate function.
A function that tests each parameter.
true
if a matching parameter exists; otherwise, false
.
Sets a new function hook, overwriting the current one.
The new hook.
A boolean indicating whether the new hook was set.
Sets a parameter at the given index.
The new parameter.
The index of the parameter to update.
Options to set the new parameter.
Optional
ifexist?: booleanWhether to set the parameter only if a parameter is already set at the specified index.
Optional
overwrite?: booleanWhether to overwrite existing parameters. If false
, the new parameter is not registered
if there is an existing parameter at the specified index. (Default: true
)
A boolean indicating whether the new parameter has been set.
Stringifies the instance.
Optional
options: ParsedParserFunctionOutputConfigOptions to format the output.
The parser function as a string.
Converts the instance to a ParsedTemplate.
The conversion is based on the data used to initialize this instance, and any modifications made after initialization will be discarded. Therefore, this method should be called before making any changes to the instance properties.
The new template title to set.
Optional
verbose: booleanWhether to log errors (default: false
).
A new ParsedTemplate instance on success; otherwise, null
.
The instance members of the
ParsedParserFunction
class. For static members, see ParsedParserFunctionStatic (defined separately due to TypeScript limitations).