Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

update interface vs type aliases docs, to include features supported … #1057

Merged
merged 2 commits into from
Jul 10, 2019

Conversation

cryptoB0T
Copy link
Contributor

…since ts 2.7

Fixes #
The docs should indicate that type aliases can be extended, as this is supported since 2.7.

@orta
Copy link
Contributor

orta commented Jul 8, 2019

I tried looking through the release notes but I couldn't find anything about this feature, do you mean something like this?

type MyType = {
  a: boolean
}

type MyExtendedType = MyType & { b: string }

declare const extended: MyExtendedType

extended.a
extended.b
@cryptoB0T
Copy link
Contributor Author

yes, this is correct. the docs appear to indicate that type aliases cannot be extended. it doesn't appear in the release notes but the TS compiler seems to support this functionality. is there something I'm missing?

@orta
Copy link
Contributor

orta commented Jul 8, 2019

Yeah, I also was a little stumped - but that's fine, I've tried to update the PR to include that info with an example to make it more concrete 👍

@orta
Copy link
Contributor

orta commented Jul 10, 2019

Thanks!

@orta orta merged commit a65bf73 into microsoft:master Jul 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants