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

    Interface Wikilink

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

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

    Hierarchy (View Summary)

    Index

    Properties

    title: Title

    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.

      A 'File:...' title (without a leading colon) is not allowed as the title argument. For file titles, use toFileWikilink instead.

      Parameters

      • title: string | Title

        The new title to set.

      • Optionalverbose: boolean

        Whether to log errors. (Default: false)

      Returns boolean

      A boolean indicating whether the new title was set.

    • 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.