mwbot-ts - v1.3.2
    Preparing search index...

    Interface RawWikilink

    The instance members of the RawWikilink class. For static members, see RawWikilinkStatic (defined separately due to TypeScript limitations).

    interface RawWikilink {
        title: string;
        getDisplay(): string;
        hasDisplay(): boolean;
        setDisplay(display: null | string): this;
        setTitle(title: string): this;
        stringify(options?: RawWikilinkOutputConfig): string;
        toFileWikilink(
            title: string | Title,
            verbose?: boolean,
        ): null | FileWikilink;
        toString(): string;
        toWikilink(title: string | Title, verbose?: boolean): null | Wikilink;
    }

    Hierarchy (View Summary)

    Index

    Properties

    title: string

    The title of the page that the wikilink links to.

    This property is read-only. To update it, use setTitle.

    Methods

    • Gets the display text of the wikilink. If no display text is set, the title text is returned.

      Note that interlanguage links (which appear in the sidebar) are not resolved in terms of how they are displayed there.

      Returns string

      The display text as a string.

    • Checks whether this wikilink has a display text (the part after |).

      Returns boolean

      A boolean indicating whether the wikilink has a display text.

    • Sets the display text of the wikilink.

      Parameters

      • display: null | string

        The display text. To unset it, pass an empty string or null.

      Returns this

      The current instance for chaining.

    • Sets a new title to the instance.

      If the new title is a valid MediaWiki title, use toWikilink or toFileWikilink instead.

      Parameters

      • title: string

        The new title. This must be a string.

      Returns this

      The current instance for chaining.

    • Creates a new FileWikilink instance, inheriting the current instance's properties.

      Parameters

      • title: string | Title

        The file title to set.

      • Optionalverbose: boolean

        Whether to log errors. (Default: false)

      Returns null | FileWikilink

      A new FileWikilink instance on success; otherwise, null.

    • Creates a new Wikilink instance, inheriting the current instance's properties.

      Parameters

      • title: string | Title

        The non-file title to set.

      • Optionalverbose: boolean

        Whether to log errors. (Default: false)

      Returns null | Wikilink

      A new Wikilink instance on success; otherwise, null.