Forgot to rename KeyActionType to keyActionType which I done now.
This commit is contained in:
@@ -21,7 +21,7 @@ class DualRoleKeystrokeAction extends KeyAction {
|
||||
private longPressAction: LongPressAction;
|
||||
|
||||
_fromJsObject(jsObject: any): DualRoleKeystrokeAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.DualRoleKeystrokeAction, 'DualRoleKeystrokeAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.DualRoleKeystrokeAction, 'DualRoleKeystrokeAction');
|
||||
this.scancode = jsObject.scancode;
|
||||
this.longPressAction = LongPressAction[<string> jsObject.longPressAction];
|
||||
return this;
|
||||
@@ -36,7 +36,7 @@ class DualRoleKeystrokeAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.DualRoleKeystrokeAction,
|
||||
keyActionType: keyActionType.DualRoleKeystrokeAction,
|
||||
scancode: this.scancode,
|
||||
longPressAction: LongPressAction[this.longPressAction]
|
||||
};
|
||||
|
||||
@@ -2,23 +2,23 @@ class KeyActions extends ClassArray<KeyAction> {
|
||||
|
||||
jsObjectToClass(jsObject: any): Serializable<KeyAction> {
|
||||
switch (jsObject.keyActionType) {
|
||||
case KeyActionType.NoneAction:
|
||||
case keyActionType.NoneAction:
|
||||
return new NoneAction().fromJsObject(jsObject);
|
||||
case KeyActionType.KeystrokeAction:
|
||||
case keyActionType.KeystrokeAction:
|
||||
return new KeystrokeAction().fromJsObject(jsObject);
|
||||
case KeyActionType.KeystrokeModifiersAction:
|
||||
case keyActionType.KeystrokeModifiersAction:
|
||||
return new KeystrokeModifiersAction().fromJsObject(jsObject);
|
||||
case KeyActionType.KeystrokeWithModifiersAction:
|
||||
case keyActionType.KeystrokeWithModifiersAction:
|
||||
return new KeystrokeWithModifiersAction().fromJsObject(jsObject);
|
||||
case KeyActionType.DualRoleKeystrokeAction:
|
||||
case keyActionType.DualRoleKeystrokeAction:
|
||||
return new DualRoleKeystrokeAction().fromJsObject(jsObject);
|
||||
case KeyActionType.SwitchLayerAction:
|
||||
case keyActionType.SwitchLayerAction:
|
||||
return new SwitchLayerAction().fromJsObject(jsObject);
|
||||
case KeyActionType.SwitchKeymapAction:
|
||||
case keyActionType.SwitchKeymapAction:
|
||||
return new SwitchKeymapAction().fromJsObject(jsObject);
|
||||
case KeyActionType.MouseAction:
|
||||
case keyActionType.MouseAction:
|
||||
return new MouseAction().fromJsObject(jsObject);
|
||||
case KeyActionType.PlayMacroAction:
|
||||
case keyActionType.PlayMacroAction:
|
||||
return new PlayMacroAction().fromJsObject(jsObject);
|
||||
default:
|
||||
throw `Invalid KeyAction.keyActionType: "${jsObject.actionType}"`;
|
||||
|
||||
@@ -4,7 +4,7 @@ class KeystrokeAction extends KeyAction {
|
||||
scancode: number;
|
||||
|
||||
_fromJsObject(jsObject: any): KeystrokeAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.KeystrokeAction, 'KeystrokeAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.KeystrokeAction, 'KeystrokeAction');
|
||||
this.scancode = jsObject.scancode;
|
||||
return this;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class KeystrokeAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.KeystrokeAction,
|
||||
keyActionType: keyActionType.KeystrokeAction,
|
||||
scancode: this.scancode
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class KeystrokeModifiersAction extends KeyAction {
|
||||
|
||||
_fromJsObject(jsObject: any): KeystrokeModifiersAction {
|
||||
this.assertKeyActionType(
|
||||
jsObject, KeyActionType.KeystrokeModifiersAction, 'KeystrokeModifiersAction');
|
||||
jsObject, keyActionType.KeystrokeModifiersAction, 'KeystrokeModifiersAction');
|
||||
this.modifierMask = jsObject.modifierMask;
|
||||
return this;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ class KeystrokeModifiersAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.KeystrokeModifiersAction,
|
||||
keyActionType: keyActionType.KeystrokeModifiersAction,
|
||||
modifierMask: this.modifierMask
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class KeystrokeWithModifiersAction extends KeyAction {
|
||||
|
||||
_fromJsObject(jsObject: any): KeystrokeWithModifiersAction {
|
||||
this.assertKeyActionType(
|
||||
jsObject, KeyActionType.KeystrokeWithModifiersAction, 'KeystrokeWithModifiersAction');
|
||||
jsObject, keyActionType.KeystrokeWithModifiersAction, 'KeystrokeWithModifiersAction');
|
||||
this.scancode = jsObject.scancode;
|
||||
this.modifierMask = jsObject.modifierMask;
|
||||
return this;
|
||||
@@ -23,7 +23,7 @@ class KeystrokeWithModifiersAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.KeystrokeWithModifiersAction,
|
||||
keyActionType: keyActionType.KeystrokeWithModifiersAction,
|
||||
scancode: this.scancode,
|
||||
modifierMask: this.modifierMask
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ class MouseAction extends KeyAction {
|
||||
mouseAction: MouseActionParam;
|
||||
|
||||
_fromJsObject(jsObject: any): MouseAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.MouseAction, 'MouseAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.MouseAction, 'MouseAction');
|
||||
this.mouseAction = MouseActionParam[<string> jsObject.mouseAction];
|
||||
return this;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class MouseAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.MouseAction,
|
||||
keyActionType: keyActionType.MouseAction,
|
||||
mouseAction: MouseActionParam[this.mouseAction]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class PlayMacroAction extends KeyAction {
|
||||
macroId: number;
|
||||
|
||||
_fromJsObject(jsObject: any): PlayMacroAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.PlayMacroAction, 'PlayMacroAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.PlayMacroAction, 'PlayMacroAction');
|
||||
this.macroId = jsObject.macroId;
|
||||
return this;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class PlayMacroAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.PlayMacroAction,
|
||||
keyActionType: keyActionType.PlayMacroAction,
|
||||
macroId: this.macroId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class SwitchKeymapAction extends KeyAction {
|
||||
keymapId: number;
|
||||
|
||||
_fromJsObject(jsObject: any): SwitchKeymapAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.SwitchKeymapAction, 'SwitchKeymapAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.SwitchKeymapAction, 'SwitchKeymapAction');
|
||||
this.keymapId = jsObject.keymapId;
|
||||
return this;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class SwitchKeymapAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.SwitchKeymapAction,
|
||||
keyActionType: keyActionType.SwitchKeymapAction,
|
||||
keymapId: this.keymapId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class SwitchLayerAction extends KeyAction {
|
||||
}
|
||||
|
||||
_fromJsObject(jsObject: any): SwitchLayerAction {
|
||||
this.assertKeyActionType(jsObject, KeyActionType.SwitchLayerAction, 'SwitchLayerAction');
|
||||
this.assertKeyActionType(jsObject, keyActionType.SwitchLayerAction, 'SwitchLayerAction');
|
||||
this.layer = Layer[<string> jsObject.layer];
|
||||
this.isLayerToggleable = jsObject.toggle;
|
||||
return this;
|
||||
@@ -35,7 +35,7 @@ class SwitchLayerAction extends KeyAction {
|
||||
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: KeyActionType.SwitchLayerAction,
|
||||
keyActionType: keyActionType.SwitchLayerAction,
|
||||
layer: Layer[this.layer],
|
||||
toggle: this.isLayerToggleable
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user