Check if the title can have an associated talk page.
Checks if this Title is equal to a given title.
This method is exclusive to mwbot-ts
.
The title to compare against.
Optional
evalFragment: booleanWhether to include the fragment in the comparison. (Default: false
)
true
if the titles are equal, false
otherwise, or null
if title
is invalid.
Check whether this title exists on the wiki.
This is an instance method that does the same as the static method TitleStatic.exists.
Boolean if the information is available, otherwise null
.
Get the extension of the page name (if any).
Name extension or null
if there is none.
Get the page name as if it is a file name, without extension or namespace prefix,
in the human-readable form with spaces instead of underscores. For example, the title
File:Example_image.svg
will be returned as Example image
.
Note that this method will work for non-file titles but probably give nonsensical results.
A title like User:Dr._J._Fail
will be returned as Dr. J
! Use getMainText instead.
Get the page name as if it is a file name, without extension or namespace prefix,
in the canonical form with underscores instead of spaces. For example, the title
File:Example_image.svg
will be returned as Example_image
.
Note that this method will work for non-file titles but probably give nonsensical results.
A title like User:Dr._J._Fail
will be returned as Dr._J
! Use getMain instead.
Get the fragment (if any), with all underscores replaced by spaces.
Note that this method (by design) does not include the hash character and the value is not URL-encoded.
Get the interwiki prefix.
Example: mw:
for mw:Main_page
.
If an interwiki is set, interwiki prefix plus :
, an empty string otherwise.
Use isExternal to check if an interwiki is set.
This method is exclusive to mwbot-ts
.
Interwiki prefix(es).
Get the main page name.
Example: Example_image.svg
for File:Example_image.svg
.
Get the main page name (with spaces instead of underscores).
Example: Example image.svg
for File:Example_image.svg
.
Get the namespace number.
Example: 6
for File:Example_image.svg
.
Get the namespace prefix (in the content language).
Example: File:
for File:Example_image.svg
.
In NS_MAIN
this is an empty string, otherwise namespace name plus :
.
Get the full page name.
Example: File:Example_image.svg
.
Most useful for API calls, anything that must identify the "title".
Optional
options: TitleOutputOptionsTitle output options.
This parameter is exclusive to mwbot-ts
.
Get the full page name, with all underscores replaced by spaces.
Example: File:Example image.svg
for File:Example_image.svg
.
Optional
options: TitleOutputOptionsTitle output options.
This parameter is exclusive to mwbot-ts
.
Get the page name relative to a namespace.
Example:
Foo:Bar
relative to the Foo namespace becomes Bar
.Bar
relative to any non-main namespace becomes :Bar
.Foo:Bar
relative to any namespace other than Foo stays Foo:Bar
.The namespace to be relative to.
The page name relative to a namespace.
NOTE: Interwiki prefixes (if any) are not included in the output.
Get the title for the subject page of a talk page.
The title for the subject page of a talk page, null
if not available.
NOTE: If this Title is interwiki, this method always returns null
because
interwiki titles are always treated as being in the default namespace. Without
this restriction, the method would simply return the current instance unchanged.
Get the title for the associated talk page.
The title for the associated talk page, null
if not available.
NOTE: If this Title is interwiki, this method always returns null
because
interwiki titles are always treated as being in the default namespace. Without
this restriction, the method would simply return the current instance unchanged.
Check if the input title text had a leading colon (e.g., :Category:CSD
).
This method is exclusive to mwbot-ts
.
Check whether this Title has an interwiki component.
Adapted from LinkTargetTrait::isExternal.
This method is exclusive to mwbot-ts
.
Determine whether the object refers to a page within this project (either this wiki or a wiki with a local interwiki). See https://www.mediawiki.org/wiki/Manual:Interwiki_table#iw_local for details.
This method is exclusive to mwbot-ts
.
true
if this is an in-project interwiki link or a wikilink, false
otherwise.
Check if the title is in a talk namespace.
Whether the title is in a talk namespace.
Determine whether the interwiki Title refers to a page within this project and is transcludable.
If isExternal is false
, this method always returns false
.
This method is exclusive to mwbot-ts
.
true
if this is transcludable.
Alias of getPrefixedDb.
This method does not accept output options, meaning the output will always include interwiki prefixes but will exclude the fragment and leading colon, if present. See TitleOutputOptions for details.
Alias of getPrefixedText.
This method does not accept output options, meaning the output will always include interwiki prefixes but will exclude the fragment and leading colon, if present. See TitleOutputOptions for details.
Check if this Title had a local interwiki prefix (e.g., en:Main_page
on enwiki).
Such a prefix is erased on instance initialization (i.e., getPrefixedDb outputs Main_page
).
This method is exclusive to mwbot-ts
.
The instance members of the
Title
class. For static members including the constructor (defined separately due to TypeScript limitations) and the differences in feature from the nativemediawiki.Title
, see TitleStatic.