Renames known keys and values. Maintains JSON structure.
let compressedStateJSON = compressStateJSON(/*editorState*/.toJSON())
let editorState = EditorState.fromJSON(/*config*/, uncompressStateJSON(compressedStateJSON))
let compressedSelectionJSON = compressSelectionJSON(/*selection*/.toJSON())
let selection = Selection.fromJSON(/*doc*/, uncompressSelectionJSON(compressedSelectionJSON))
let compressedStepsJSON = /*steps array*/.map(step => compressStepJSON(step.toJSON()))
let steps = compressedStepsJSON.map(json => Step.fromJSON(/*schema*/, uncompressStepJSON(json))
{"selection":{"head":0,"anchor":0}},"doc":{"type":"doc","content":[{"type":"heading","attrs":{"level":3},
{"s":{"h":0,"a":0}},"d":{"t":"d","c":[{"t":"h","a":{"l":3},
Merges all the steps that can be merged.
let steps = compressStepsLossy(/*steps array*/)
For compressing and uncompressing using custom keys maps.
let [ keysMapper, inverseKeysMapper ] = keysMappers(/*keysMap*/)
let compressedJSON = keysMapper(/*json*/)
let json = inverseKeysMapper(compressedJSON)