Js api. copyAs menu option equivalent

Is there an equivalent for the copyAs functionality in the editor?

I can’t see anything like that in the docs.

I am guessing it would be something like

selection.copyAs(“png”)