wowkit API
    Preparing search index...

    Class Addon

    The addon: its services are made by hand, in order, and handed to register; start then connects them to the game's events and runs their lifecycle hooks.

    const addon = new Addon(addonName);
    const settings = addon.register(new SettingsService(...));
    addon.start();
    

    Lifecycle, in order: onAddonLoaded at ADDON_LOADED of this addon (the saved data is there); at the first PLAYER_LOGIN or PLAYER_ENTERING_WORLD onFirstLogin once and then the regular work (@Interval) starts; onLogin at PLAYER_LOGIN only; onReady after PLAYER_LOGIN and after every PLAYER_ENTERING_WORLD; onLogout at PLAYER_LOGOUT, when the regular work stops. Hooks run in the order the services were registered, so a service is registered after the services it needs.

    Index
    events: EventBus = ...

    The addon's own events; services that emit or listen are given this one.

    • Takes a service into the addon, and gives it back.

      Type Parameters

      • T extends object

      Parameters

      • service: T

      Returns T