Object to Y.Map

I have a complex object in my application as store for managing all the state of the page. I want use yjs to make the page change sync for different user.
Firstly, it seems I have to covert the object to y.Map, is there any tool function like ymap.fromJSON()? Or should I make a recursion to convert it. Or event I should not do it in this way?
Sorry for this stupid question, I am new to CRDT.