Suggestion: Extension methods
Navigation Menu
{{ message }}
microsoft / TypeScript Public
- Notifications You must be signed in to change notification settings
- Fork 13.3k
Closed
Closed
Labels
Description
opened
on Jul 15, 2014Allow a declarative way of adding members to an existing type's prototype
Example:
class Shape { // ... } /* ...elsewhere...*/ extension class Shape { // Syntax?? getArea() { return /* ... */; } } var x = new Shape(); console.log(x.getArea()); // OK
Metadata
Metadata
Assignees
No one assigned
Labels
Type
No type
Projects
No projects
Milestone
No milestone
Relationships
None yet
Development
No branches or pull requests
Issue actions