lib-iitc-manager
    Preparing search index...

    Class Manager

    This class contains methods for managing IITC and plugins.

    Hierarchy

    • Worker
      • Manager
    Index

    Constructors

    • Creates an instance of Manager class with the specified parameters

      Parameters

      • config: ManagerConfig

        Environment parameters for an instance of Manager class.

      Returns Manager

    Methods

    • Allows adding third-party UserScript plugins to IITC. Returns the dictionary of installed or updated plugins.

      Parameters

      Returns Promise<PluginDict>

    • Runs periodic checks and installs updates for IITC, internal and external plugins.

      Parameters

      • Optionalforce: boolean

        Forced to run the update right now.

      Returns Promise<void>

    • Returns an object of all enabled plugins, including IITC core, with plugin UID as the key.

      Returns Promise<PluginDict>

    • Returns IITC core script.

      Parameters

      • Optionalstorage: StorageData

        Storage object with keys channel_iitc_core and channel_iitc_core_user.

      • Optionalchannel: string

        Current channel.

      Returns Promise<Plugin | null>

    • Returns information about requested plugin by UID.

      Parameters

      • uid: string

        Plugin UID.

      Returns Promise<Plugin | null>

    • Invokes the injection of IITC core script and plugins to the page. IITC core is injected first to ensure it initializes before any plugins. This is crucial because the initialization of IITC takes some time, and during this time, plugins can be added to window.bootPlugins without being started immediately. Injecting IITC first also prevents plugins from throwing errors when attempting to access IITC, leaflet, or other dependencies during their initialization.

      Returns Promise<void>

    • Controls the plugin. Allows you to enable, disable and remove the plugin.

      Parameters

      • uid: string

        Unique identifier of the plugin.

      • action: "on" | "off" | "delete"

        Type of action with the plugin.

      Returns Promise<void>

    • Running the IITC and plugins manager. Migrates data storage as needed, then loads or updates UserScripts from the repositories.

      Returns Promise<void>

    • Asynchronously sets backup data based on the specified parameters.

      This function takes the provided parameters and backup data object and sets the data accordingly. The input parameters are processed using the 'paramsProcessing' function from the 'backup' module. Depending on the parameters, the function imports IITC settings, plugin data, and external plugins into the 'this' object using appropriate functions from the 'backup' module.

      Parameters

      • params: Partial<BackupParams>

        The parameters for setting the backup data.

      • backup_data: BackupData

        The backup data object containing the data to be set.

      Returns Promise<void>

    • Changes the update channel and calls for an update.

      Parameters

      • channel: Channel

        Update channel for IITC and plugins.

      Returns Promise<void>

    • Changes the URL of the repository with IITC and plugins for the custom channel.

      Parameters

      • url: string

        URL of the repository.

      Returns Promise<void>

    • Changes the update check interval. If the interval for the current channel changes, a forced update check is started to apply the new interval.

      Parameters

      • interval: number

        Update check interval in seconds.

      • Optionalchannel: string

        Update channel for IITC and plugins.

      Returns Promise<void>