API Reference

This document provides comprehensive API documentation for developers who want to extend or integrate with Stylish Action HUD.


Table of Contents

  1. Getting Started with the API
  2. System Adapter API
  3. Action Menu API
  4. Defaults Registry API
  5. Configuration API
  6. Hooks Reference
  7. Complete Examples

Getting Started with the API

Accessing the API

The Stylish Action HUD API is available in two ways:

// Method 1: Via module.api (Recommended)
const api = game.modules.get("stylish-action-hud").api;

// Method 2: Via Hook (for initialization timing)
Hooks.once("stylish-action-hud.apiReady", (api) => {
  // API is now ready to use
  console.log("Stylish Action HUD API Ready:", api);
});

API Ready Hook

Always wait for the API to be ready before registering adapters or extensions:

Hooks.once("stylish-action-hud.apiReady", (api) => {
  // Register your custom adapter
  api.registerSystemAdapter("my-system", MySystemAdapter);
});

Available API Methods