Change viewport programmatically

Is there a way I can change the viewport (pan and zoom) to a specific layer programmatically with a UXP plugin?

There is an answer in this topic

http://forums.creativeclouddeveloper.com/t/is-posible-to-set-a-zoom-event/5268/1

Thanks @shuji, is there any documentation on how to do setPanZoom? I can’t get the x and y value to work as it should be. I assume those are in pixel?

This isn’t written on document anywhere. Batch play could access native application’s function which API cannot access, but you need to inspect by yourself.
In terms of x and y values, apparently they are connect to zoom value and image’s resolution , and I suppose something they follow values based on pixel.
But I don’t know how it works exactly, even any specification.