namespace LinkedListTriangleAsLinkedListShape { class Shape { } declare const TriangleType ; class Triangle extends Shape { [ TriangleType ] : void ; } class LinkedList < T > { value : T ; next : LinkedList < T > | undefined = undefined ; constructor ( value ) { this . value = value ; } append ( value ) { this . next = new LinkedList ( value ) ; return this . next ; } } declare function makeTriangles ( ) ; declare function draw ( shapes ) ; draw ( makeTriangles ( ) ) ; }