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

    Interface ParsedWikilink

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

    interface ParsedWikilink {
        children: Set<number>;
        endIndex: number;
        index: number;
        nestLevel: number;
        parent: null | number;
        rawTitle: string;
        skip: boolean;
        startIndex: number;
        text: string;
        title: Title;
        getDisplay(): string;
        hasDisplay(): boolean;
        setDisplay(display: null | string): this;
        setTitle(title: string | Title, verbose?: boolean): boolean;
        stringify(options?: ParsedWikilinkOutputConfig): string;
        toFileWikilink(
            title: string | Title,
            verbose?: boolean,
        ): null | ParsedFileWikilink;
        toString(): string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    children: Set<number>

    The indices of the child objects within the parseWikilinks result array.

    endIndex: number

    The ending index of this wikilink in the wikitext (exclusive).

    index: number

    The index of this object within the result array returned by parseWikilinks.

    nestLevel: number

    The nesting level of this wikilink. 0 if it is not nested within another wikilink.

    A value of 1 or greater indicates that the wikilink is either incorrectly embedded within another wikilink, or that it serves as part of the thumb text of a file wikilink.

    parent: null | number

    The index of the parent object within the parseWikilinks result array, or null if there is no parent.

    rawTitle: string

    The raw wikilink title, as directly parsed from the left part of a [[wikilink|...]] expression.

    skip: boolean

    Whether the wikilink appears inside an HTML tag specified in SkipTags.

    startIndex: number

    The starting index of this wikilink in the wikitext.

    text: string

    The original text of the wikilink parsed from the wikitext. The value of this property is static.

    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.