mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-15 01:00:40 +08:00
23 lines
439 B
TypeScript
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;
|
|
}
|
|
}
|