import { PolylineEdge as __PolylineEdge, PolylineEdgeModel as __PolylineEdgeModel } from '@logicflow/core';

class PolylineEdgeModel extends __PolylineEdgeModel {
  getEdgeAnimationStyle() {
    const style = super.getEdgeAnimationStyle();
    style.strokeDasharray = '5 5';
    style.strokeDashoffset = '100%';
    style.animationDuration = '10s';
    return style;
  }
  setProperties(properties: Record<string, any>) {
    super.setProperties(properties);
    if ('id' in properties) this.id = properties.id;
    if ('isAnimation' in properties) this.isAnimation = properties.isAnimation;
  }
}

export default {
  type: 'custom-polyline-edge',
  model: PolylineEdgeModel,
  view: __PolylineEdge,
};
