import { Component } from 'vue-property-decorator' ; import Node from '@/components/node/node' ; import Port from '@/components/port/port' ; import InputPort from '@/components/port/input-port' ; import { Package } from '@/data/package' ; @ Component export default class OutputPort extends Port { protected isMultiple = true ; protected isUpdated = false ; public getConnectedNodes ( ) { return this . edges . map ( edge => edge . target . node ) ; } public getConnectedPorts ( ) { return this . edges . map ( edge => edge . target ) ; } /** Updates the package of the port. This turns on isUpdated flag. */ public updatePackage ( pkg ) { this . package = pkg ; this . isUpdated = true ; } public isPackageUpdated ( ) { return this . isUpdated ; } public clearPackageUpdate ( ) { this . isUpdated = false ; } /** Consider output ports to trivially always have (at least empty) package. */ public hasPackage ( ) { return true ; } public getPackage ( ) { return this . package ; } abstract public clear ( ) { throw new Error ( 'using clear() of base class OutputPort' ) ; } }