From 1544aaf36448f57597ebde1b224364f6e6ec9a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Thu, 7 Apr 2016 02:58:53 +0200 Subject: [PATCH] Update README.md --- config-serializer/README.md | 48 ++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/config-serializer/README.md b/config-serializer/README.md index a458a6cb..924f62ff 100644 --- a/config-serializer/README.md +++ b/config-serializer/README.md @@ -24,4 +24,50 @@ Each configuration item belongs to a specific type. The following types are avai **Array type** is a special compound type which is composed of a sequence of items of a specific type. Array items must descend from the [ClassArray](ClassArray.ts) class. -# Dumping configuration transformations +## Dumping serialization + +The serialization of configuration items is a complicated business, and many things can go wrong. That's the exact reason why serialization can be dumped to ease debugging. All you have to do is to set `Serializable.enableDump` to `true`, and you'll see something like the following upon serialization actions: + +``` +KeyActions.fromJsObject: [{"keyActionType":"none"},{"keyActionType":"keystroke","scancode":110},{"keyActionType":"keystrokeModifiers","modifierMask":33},{"keyActionType":"keystrokeWithM... + NoneAction.fromJsObject: {"keyActionType":"none"} => + KeystrokeAction.fromJsObject: {"keyActionType":"keystroke","scancode":110} => + KeystrokeModifiersAction.fromJsObject: {"keyActionType":"keystrokeModifiers","modifierMask":33} => + KeystrokeWithModifiersAction.fromJsObject: {"keyActionType":"keystrokeWithModifiers","scancode":120,"modifierMask":16} => + SwitchLayerAction.fromJsObject: {"keyActionType":"switchLayer","layer":"fn","toggle":false} => + DualRoleKeystrokeAction.fromJsObject: {"keyActionType":"dualRoleKeystroke","scancode":111,"longPressAction":"mod"} => + MouseAction.fromJsObject: {"keyActionType":"mouse","mouseAction":"scrollDown"} => + PlayMacroAction.fromJsObject: {"keyActionType":"playMacro","macroId":0} => + SwitchKeymapAction.fromJsObject: {"keyActionType":"switchKeymap","keymapId":1} => +KeyActions.toBinary: => ['u8(9)] + NoneAction.toBinary: => ['u8(0)] + KeystrokeAction.toBinary: => ['u8(1), u8(110)] + KeystrokeModifiersAction.toBinary: => ['u8(2), u8(33)] + KeystrokeWithModifiersAction.toBinary: => ['u8(3), u8(120), u8(16)] + SwitchLayerAction.toBinary: => ['u8(5), u8(1)] + DualRoleKeystrokeAction.toBinary: => ['u8(4), u8(111), u8(8)] + MouseAction.toBinary: => ['u8(7), u8(8)] + PlayMacroAction.toBinary: => ['u8(8), u8(0)] + SwitchKeymapAction.toBinary: => ['u8(6), u8(1)] +KeyActions.fromBinary: [u8(9)] + NoneAction.fromBinary: [u8(0)] => + KeystrokeAction.fromBinary: [u8(1), u8(110)] => + KeystrokeModifiersAction.fromBinary: [u8(2), u8(33)] => + KeystrokeWithModifiersAction.fromBinary: [u8(3), u8(120), u8(16)] => + SwitchLayerAction.fromBinary: [u8(5), u8(1)] => + DualRoleKeystrokeAction.fromBinary: [u8(4), u8(111), u8(8)] => + MouseAction.fromBinary: [u8(7), u8(8)] => + PlayMacroAction.fromBinary: [u8(8), u8(0)] => + SwitchKeymapAction.fromBinary: [u8(6), u8(1)] => +KeyActions.toJsObject: + NoneAction.toJsObject: => {"keyActionType":"none"} + KeystrokeAction.toJsObject: => {"keyActionType":"keystroke","scancode":110} + KeystrokeModifiersAction.toJsObject: => {"keyActionType":"keystrokeModifiers","modifierMask":33} + KeystrokeWithModifiersAction.toJsObject: => {"keyActionType":"keystrokeWithModifiers","scancode":120,"modifierMask":16} + SwitchLayerAction.toJsObject: => {"keyActionType":"switchLayer","layer":"fn","toggle":false} + DualRoleKeystrokeAction.toJsObject: => {"keyActionType":"dualRoleKeystroke","scancode":111,"longPressAction":"mod"} + MouseAction.toJsObject: => {"keyActionType":"mouse","mouseAction":"scrollDown"} + PlayMacroAction.toJsObject: => {"keyActionType":"playMacro","macroId":0} + SwitchKeymapAction.toJsObject: => {"keyActionType":"switchKeymap","keymapId":1} +``` +