Last active
May 28, 2024 01:48
-
-
Save d3vlopes/89fb31702e8be2bdcb77f8ccef75df14 to your computer and use it in GitHub Desktop.
Interface vs Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SectionModel { | |
id: string; | |
heading: string; | |
} | |
interface ImageModel { | |
src: string; | |
alt: string; | |
} | |
interface HighlightModel { | |
id: string; | |
image: ImageModel; | |
title: string; | |
description: string; | |
} | |
type SectionID = Pick<SectionModel, 'id'>; | |
interface HighlightsSection extends SectionID { | |
highlights: HighlightModel[]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment