bafolts / tplant

Typescript to plantuml
https://segmentationfaults.com/tplant/default.html
GNU General Public License v3.0
267 stars 34 forks source link

Support multi-inheritance of interfaces #65

Closed blurrcat closed 2 years ago

blurrcat commented 3 years ago

Typescript allows an interface to extend multiple other instances. Currently tplant doesn't support this case.

As an example, given:

interface Shape {
  color: string;
}

interface PenStroke {
  penWidth: number;
}

interface Square extends Shape, PenStroke {
  sideLength: number;
}

tplant currently generates the following which is incorrect:

@startuml
interface Shape {
    +color: string
}
interface PenStroke {
    +penWidth: number
}
interface Square extends Shape {  // should extend both Shape and PenStroke
    +sideLength: number
}
@enduml

This change produces correct PUML for such cases.

bafolts commented 2 years ago

@blurrcat been a while! I will update this to get it merged.

blurrcat commented 2 years ago

Just rebased - only conflict is the version number in package.json.