@ahqstore/plugin-api - v0.0.12
    Preparing search index...

    Class Plugin

    This is the global instance of an AHQStore Plugin

    import { Plugin } from "@ahqstore/plugin-api"

    (async() => {
    const api = new Plugin(
    {
    capabilities: []
    }
    );

    // Must call after creation
    // AHQ Store has a timeout after which
    // it'll otherwise terminate your plugin
    await api.initialize();
    })()
    Index

    Constructors

    Methods

    • Gets the capabilities that your worker plugin is registered with

      This requires you to get the plugin initialized

      Returns Set<Capability>

      A list of capabilities

    • Gets the api version that AHQ Store Supports

      This requires you to get the plugin initialized

      Returns number

      API Version as number

    • Gets the state under the stateId specified

      Parameters

      • stateId: string

        ID (file of the state)

      Returns Promise<string>

      The string data of the state

    • Gets the target api that the plugin is intended to work with.

      Returns number

      API Version as number

    • Gets the AHQ Store Theme Data

      The returned data does not automatically update with theme changes

      Returns Promise<ThemeData>

      The theme data ThemeData

    • Initializes the AHQ Store Plugin

      If you don't call it, the plugin manager will kill your process

      Returns Promise<void>

      If it failed to initialize

    • Injects the provided css into the client gui application

      This modifies the already injected css to the new css data

      Please note the above

      Parameters

      • css: string

        The css string to inject

      Returns Promise<void>

    • Requests the user to restart

      This does not guarantee restart

      Parameters

      • desc: string = "A restart is required to apply custom theme data. Are you ready?"

        Explain why you would like to restart (optional, a template is already provided)

      Returns Promise<void>

    • Sets the state under the stateId specified

      Parameters

      • stateId: string

        ID (file of the state)

      • stateData: string

        Data of the state to update it with

      Returns Promise<string>

      The string data of the state

    • Experimental

      Add your own custom handler to the OnMessage

      Parameters

      Returns void

      This is unsafe and hence marked deprecated This is unsafe and hence marked so

    • Returns the single instance of the Plugin. If the instance does not exist, it returns nothing.

      Returns Plugin | undefined

      The single Plugin instance.