Skip to content

Feature suggestion: Optionally emit property names #33197

Closed
@htinc

Description

@htinc

Hello Team,

I've created a lot of generic solutions with TypeScript but always struggled with this one. Is there a way to get all properties defined in TypeScript, but at runtime. For Example

class Car { name: string; }

will compile to var Car = /** @class */ (function () { function Car() { } return Car; }());

Could there be a compiler option which would emit

var Car = /** @class */ (function () { function Car() { this.name = null; } return Car; }());

This would allow us to create better generic solutions with Typescript. I searched a lot and maybe used the wrong search terms, but I could not find a solution to this.

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