Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

how can I extend an exsting type? #879

Closed
lucamorelli opened this issue Oct 12, 2014 · 1 comment
Closed

how can I extend an exsting type? #879

lucamorelli opened this issue Oct 12, 2014 · 1 comment
Labels
Duplicate An existing issue was already created Question An issue which isn't directly actionable in code

Comments

@lucamorelli
Copy link

I just opened this question in stackoverflow:
http://stackoverflow.com/questions/26327520/how-can-i-extend-an-existing-class-in-typescript/26329137#26329137

The point is that the code I'm adding to the project inject a few methods in the Pushpin class.
Is possible to do this in typescript? If not is planned?

thanks,
Luca

@danquirk
Copy link
Member

Classes in TypeScript are not open ended (see #819 for this suggestion). You can do the usual inheritance techniques but you cannot jam new type information into an existing class. Interfaces and modules are open ended and additional declarations with the same name will merge together.

@danquirk danquirk added Question An issue which isn't directly actionable in code Duplicate An existing issue was already created labels Oct 13, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants