Skip to content

Design-type metadata for generic types #11860

Closed
@heruan

Description

@heruan

Design-type metadata such as design:type, design:paramtypes and design:returntype are great to build modern JavaScript frameworks. It would be very useful to also have a design:generics metadata to keep track of generic types, e.g.

class Foo {}
class Bar {}
class Baz {
    map: Map<Foo, Bar>;
}

would transpile to

// ... Foo and Bar functions
var Baz = (function () {
    function Baz() {
    }
    __decorate([
        __metadata('design:type', Map),
        __metadata('design:generics', [ Foo, Bar ]),
    ], Baz.prototype, "map", void 0);
    return Baz;
}());

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions