siddharthvp/mwn

Template only exported as type

Closed this issue · 1 comments

Hi, in certain scenarios I'd like to create an instance of Template directly. One such scenario are tests for wiki-specific functionality that relies on Template. As it is part of the documentation I expected this to work, however it currently is only exported as type so I've to rely on a workaround that requires me to setup a proper bot instance.

const wt = new bot.Wikitext("{{template}}");
wt.parseTemplates({});
const template = wt.templates[0];

Fixed in 870ddd1.