Constructor
new ve.dm.MWParameterModel(template, [name], [value])
#
Represents a parameter that's part of a template invocation, centered around the parameter's
value. Holds a reference to the specification of the template and the parameter as it is
documented via TemplateData. Meant to be a sub-element of a {@see ve.dm
.MWTemplateModel}, which
is a sub-element of a {@see ve.dm
.MWTransclusionModel}.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
template |
ve.dm.MWTemplateModel | Reference back to the template that contains the parameter, as well as to the specification |
||
name |
string |
optional |
Can be missing or empty when meant to be used as a placeholder. Parameters
without a name won't be serialized to wikitext, {@see |
|
value |
string |
optional |
'' |
- Mixes in:
- Source:
Represents a parameter that's part of a template invocation, centered around the parameter's value.
Methods
getAutoValue() → {string}
#
getDefaultValue() → {string}
#
getExampleValue() → {string|null
}
#
null
}
#
getId() → {string}
#
Get unique parameter ID within the transclusion.
Returns:
Unique ID
- Type
- string
getName() → {string}
#
Returns:
Trimmed parameter name, or an empty string if no name was provided
- Type
- string
getOriginalName() → {string|undefined
}
#
undefined
}
#
Original parameter name. Will be used in {@see ve.dm
.MWTransclusionPartModel.serialize}.
Returns:
Untrimmed parameter name as provided on construction time
- Type
-
string
|
undefined
getTemplate() → {ve.dm.MWTemplateModel}
#
Get template of which this parameter is part.
Returns:
getType() → {string}
#
Returns:
Parameter type, e.g. "string"
- Type
- string
getValue() → {string}
#
Returns:
Parameter value, or automatic value if there is none stored. Otherwise an empty string.
- Type
- string
isDeprecated() → {boolean}
#
isDocumented() → {boolean}
#
isRequired() → {boolean}
#
isSuggested() → {boolean}
#
remove()
#
Remove parameter from template.
setValue(value)
#
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
Fires:
Events
change()
#
Emitted when the parameter's value changed.