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

    Interface ParseTemplatesConfig

    Configuration options for Wikitext.parseTemplates.

    interface ParseTemplatesConfig {
        hierarchies?: Record<string, TemplateParameterHierarchies>;
        templatePredicate?: (template: DoubleBracedClasses) => boolean;
        titlePredicate?: (title: string | Title) => boolean;
    }
    Index

    Properties

    hierarchies?: Record<string, TemplateParameterHierarchies>

    Object mapping canonical template titles to arrays of TemplateParameterHierarchies.

    Example:

    const hierarchies = {
    // Overwrite `1=` with `user=` for ParsedTemplate instances of `Template:Foo_bar`
    'Template:Foo_bar': [['1', 'user']],
    // Overwrite `2=` with `type=` for RawTemplate instances of `{{{1}}}`
    '{{{1}}}': [['2', 'type']]
    };
    mwbot.Wikitext.parseTemplates({ hierarchies });
    templatePredicate?: (template: DoubleBracedClasses) => boolean

    A predicate function to filter parsed templates. Only templates that satisfy this function will be included in the results.

    Type declaration

    titlePredicate?: (title: string | Title) => boolean

    A predicate function to filter templates by title. Only templates whose titles satisfy this function will be included in the results.

    Type declaration

      • (title: string | Title): boolean
      • Parameters

        • title: string | Title

          A Title object for ParsedTemplate, or a string for RawTemplate and ParsedParserFunction.

        Returns boolean

        true if the template should be parsed, otherwise false.