Fix type lost caused by incorrect inheritance of ClassArray

This commit is contained in:
József Farkas
2016-04-23 23:45:05 +02:00
parent 5a123d55c2
commit b9b2fcbf84
14 changed files with 32 additions and 38 deletions

View File

@@ -1,6 +1,5 @@
import {ClassArray} from '../ClassArray';
import {UhkBuffer} from '../UhkBuffer';
import {Serializable} from '../Serializable';
import {DualRoleKeystrokeAction} from './DualRoleKeystrokeAction';
import {NoneAction} from './NoneAction';
import {KeystrokeAction} from './KeystrokeAction';
@@ -14,7 +13,7 @@ import {PlayMacroAction} from './PlayMacroAction';
export class KeyActions extends ClassArray<KeyAction> {
jsObjectToClass(jsObject: any): Serializable<KeyAction> {
jsObjectToClass(jsObject: any): KeyAction {
switch (jsObject.keyActionType) {
case keyActionType.NoneAction:
return new NoneAction().fromJsObject(jsObject);
@@ -39,7 +38,7 @@ export class KeyActions extends ClassArray<KeyAction> {
}
}
binaryToClass(buffer: UhkBuffer): Serializable<KeyAction> {
binaryToClass(buffer: UhkBuffer): KeyAction {
let keyActionFirstByte = buffer.readUInt8();
buffer.backtrack();