Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Emit serialized design-time type metadata for decorators #2577

Closed
6 tasks done
rbuckton opened this issue Apr 1, 2015 · 0 comments · Fixed by #2589
Closed
6 tasks done

Emit serialized design-time type metadata for decorators #2577

rbuckton opened this issue Apr 1, 2015 · 0 comments · Fixed by #2589
Assignees
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@rbuckton
Copy link
Member

rbuckton commented Apr 1, 2015

Add support behind an experimental compiler option to emit design-type metadata for decorated declarations in source.

  • Add __metadata helper that depends on a polyfill for a proposed Reflect.metadata decorator.
  • Emit calls to __metadata for class and member (property and method) decorators
  • For a class declaration, emit the type metadata for constructor parameters of the constructor with a body.
  • For a method declaration, emit the type metadata for the member, its parameters, and its return type.
  • For an accessor or property declaration, emit the type metadata for the member.
  • Add compiler option to enable experimental metadata support.

A few notes on metadata:

  • Type metadata uses the metadata key "design:type".
  • Parameter type metadata uses the metadata key "design:paramtypes".
  • Return type metadata uses the metadata key "design:returntype".
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants