How to get all styles of the selected text in the current editor

You probably have defined marks for those styles, since the default schema doesn’t implement many of them. Scanning through the selection with doc.nodesBetween and collecting all the marks on the nodes you get might be what you’re looking for, but your question is so vague that I don’t really know what you want to do.