how to migrate codemirror5 to codemirror6

there main methods for codemirror5 editor.getSelection(),editor.setCursor(line, ch),editor.redo() and editor.undo() to convert to codemirror6. how can i use codemirror6 do the thing the before methods do.

thank you for you replay