iink-ts - v4.0.0
    Preparing search index...

    Class IIAbstractManagerAbstract

    Base abstract class for all Interactive Ink managers Provides common structure and utilities to reduce code duplication

    All managers in iink-ts should extend this class to ensure consistent:

    • Logger management
    • Canvas reference
    • Common getters (model, renderer, client, configuration)
    • Lifecycle hooks (onInit, onDestroy)
    export class IIMyManager extends IIAbstractManager {
    protected managerName = "IIMyManager"

    constructor(canvas: InteractiveInkCanvas) {
    super(canvas)
    // Custom initialization
    }

    protected onInit(): void {
    // Called after constructor
    this.logger.info("IIMyManager initialized")
    }

    myMethod() {
    // Use this.canvas, this.model, this.renderer, this.logger
    this.logger.info("Doing something")
    }

    protected onDestroy(): void {
    // Cleanup
    }
    }

    Hierarchy (View Summary)

    Index

    The Interactive Ink Canvas instance

    logger: Logger

    Logger instance for this manager Automatically uses LoggerCategory.MANAGER

    managerName: string

    Name of the manager for logging purposes Must be overridden in concrete classes

    "IITypesetManager", "IIMathManager"
    
    • get client(): WebSocketClient

      Get the client from the canvas Convenience getter to avoid accessing canvas.client everywhere

      Returns WebSocketClient

    • get model(): IIModel

      Get the model from the canvas Convenience getter to avoid accessing canvas.model everywhere

      Returns IIModel

    • get renderer(): SVGRenderer

      Get the renderer from the canvas Convenience getter to avoid accessing canvas.renderer everywhere

      Returns SVGRenderer

    • Destroy the manager and cleanup resources Calls the onDestroy hook if defined

      Returns void

    • Lifecycle hook called when the manager is being destroyed Override in subclasses to cleanup resources

      Returns void

      protected onDestroy(): void {
      this.logger.info(`${this.managerName} destroyed`)
      // Remove event listeners, clear intervals, etc.
      }
    • Lifecycle hook called after manager initialization Override in subclasses if needed

      This is called at the end of the constructor, allowing subclasses to perform initialization that requires access to this.managerName or other properties set in the subclass constructor.

      Returns void

      protected onInit(): void {
      this.logger.info(`${this.managerName} initialized`)
      // Setup event listeners, etc.
      }