Which event is fired when setToolMode is called

PDF.js Express Version
7.3.3

Detailed description of issue
I am using WebViewer in Vue, when setToolMode is set to Pan/Select via default UI, I want to be notified.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Pankaj,

You can use the event: toolModeUpdated

Or alternatively on every click of the iframeWindow you check to see if the tool name has changed. Here is a snippet of how to do that:

let currentTool = '';
 const compareTools = () => {
        if (currentTool !== instance.getToolMode().name) {
          currentTool = instance.getToolMode().name
         // do something on change
        }
      };
instance.iframeWindow.addEventListener('click', compareTools);

Cheers,
Dustin