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

    Interface ParserFunctionStatic

    This interface defines the static members of the ParserFunction class. For instance members, see ParserFunction (defined separately due to TypeScript limitations).

    ParserFunction is a class that serves to parse {{#func:}} markups into an object structure, which is accessible via Mwbot.ParserFunction. Note that {{template}} markups are treated differently by the Template class.

    const func = new mwbot.ParserFunction('#if:', ['{{{1|}}}']);
    func.addParam('{{{1}}}');
    func.stringify(); // {{#if:{{{1|}}}|{{{1}}}}}
    interface ParserFunctionStatic {
        new ParserFunctionStatic(
            hook: string,
            params?: string[],
        ): ParserFunction;
        verify(hook: string): null | VerifiedFunctionHook;
    }

    Hierarchy

    • Omit<typeof ParamBase, "prototype">
      • ParserFunctionStatic
    Index

    Constructors

    Methods

    Constructors

    • Creates a new instance.

      Usage:

      const func = new mwbot.ParserFunction('#hook:');
      

      Parameters

      • hook: string

        The function hook. This must end with a colon character.

      • Optionalparams: string[]

        Parameters of the parser function.

      Returns ParserFunction

    Methods

    • Verifies the given string as a parser function hook.

      Usage:

      const verifiedHook = mwbot.ParserFunction.verify('#hook:');
      

      Parameters

      • hook: string

        A potential parser function hook as a string. This must end with a colon character.

      Returns null | VerifiedFunctionHook

      An object representing the canonical function hook and the matched function hook, or null.