is there a way how to convert Instance or Frame node to Component node with Figma API? Through UI it's very easy just right click on element and then Create Component like on screenshot below but I need to do it through Figma API.
I found "figma.createComponent()" but it's only for create new empty Component node.
Thanks!