Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/documentation/copy/en/handbook-v2/Everyday Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ Being concerned only with the structure and capabilities of types is why we call
Type aliases and interfaces are very similar, and in many cases you can choose between them freely.
Almost all features of an `interface` are available in `type`, the key distinction is that a type cannot be re-opened to add new properties vs an interface which is always extendable.

<div class='table-container'>
<table class='full-width-table'>
<tbody>
<tr>
Expand Down Expand Up @@ -452,6 +453,7 @@ type Window = {
</tr>
</tbody>
</table>
</div>

You'll learn more about these concepts in later chapters, so don't worry if you don't understand all of these right away.

Expand Down
2 changes: 2 additions & 0 deletions packages/documentation/copy/en/reference/Advanced Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ As we mentioned, type aliases can act sort of like interfaces; however, there ar

Almost all features of an `interface` are available in `type`, the key distinction is that a type cannot be re-opened to add new properties vs an interface which is always extendable.

<div class='table-container'>
<table class='full-width-table'>
<tbody>
<tr>
Expand Down Expand Up @@ -490,6 +491,7 @@ type Window = {
</tr>
</tbody>
</table>
</div>

Because an interface more closely maps how JavaScript objects work [by being open to extension](https://wikipedia.org/wiki/Open/closed_principle), we recommend using an interface over a type alias when possible.

Expand Down
4 changes: 4 additions & 0 deletions packages/typescriptlang-org/src/templates/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
max-width: 100%;
}

div.table-container {
overflow-x: auto;
}

table.full-width-table {
width: 100%;
display: table;
Expand Down