Files
react-diagrams/demos/demo3/DiamondPortModel.ts
2017-09-13 15:32:15 -03:00

23 lines
439 B
TypeScript

import * as SRD from "../../src/main";
import * as _ from "lodash";
export class DiamondPortModel extends SRD.PortModel {
position: string | "top" | "bottom" | "left" | "right";
constructor(pos: string = "top") {
super(pos);
this.position = pos;
}
serialize() {
return _.merge(super.serialize(), {
position: this.position
});
}
deSerialize(data: any) {
super.deSerialize(data);
this.position = data.position;
}
}