Take screenshot from inside gnome extension

Can someone please provide a short example of javascript code on how to take a screenshot of the screen in the gnome extension, say in the enable function?

You can also indicate the topics that need to be learned in order to understand how to do it.