Suggestion: Extension methods · Issue #9 · microsoft/TypeScript (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Allow 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
Labels
Development
No branches or pull requests