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

    Class IIGestureManager

    Orchestrator for gesture recognition and handling using Strategy Pattern

    Hierarchy (View Summary)

    Index

    The Interactive Ink Canvas instance

    insertAction: InsertAction = InsertAction.LineBreak
    logger: Logger

    Logger instance for this manager Automatically uses LoggerCategory.MANAGER

    managerName: string = "IIGestureManager"

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

    "IITypesetManager", "IIMathManager"
    
    strikeThroughAction: StrikeThroughAction = StrikeThroughAction.Draw
    surroundAction: SurroundAction = SurroundAction.Select
    underlineAction: UnderlineAction = UnderlineAction.Draw
    • 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

    • Apply a detected gesture using the appropriate handler.

      Parameters

      • gesture: TGesture

        The detected gesture with metadata; the triggering stroke is looked up from the model via gesture.gestureStrokeId (works whether the gesture was detected client-side/contextless or arrived asynchronously from the server).

      Returns Promise<void>

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

      Returns void

    • Detect gesture type from a stroke using contextless recognition

      Parameters

      • gestureStroke: TStroke

        The stroke to analyze

      Returns Promise<TGesture | undefined>

      The detected gesture or undefined

    • 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.
      }