How can I intercept the movement event of an UI element in the artboard?

Hello.

I am having a plugin idea but currently I can’t seem to explicitly find a topic in the documentation that explains how to put listeners on artboard elements, especially when most on the time, in code, we work with the selection item[s], which does not extend an addListener() method. I would really appreciate an explanation here.

Thank you!

XD does not support putting listeners on document contents. The event handling is limited to the contents of the plugin’s panel. Instead an update() callback is provided that fires whenever the user changes the selection or modifies any document content:
https://www.adobe.io/xd/uxp/develop/reference/ui/panels/update/