Skip to content

Instantly share code, notes, and snippets.

@d3vlopes
Last active May 28, 2024 01:48
Show Gist options
  • Save d3vlopes/89fb31702e8be2bdcb77f8ccef75df14 to your computer and use it in GitHub Desktop.
Save d3vlopes/89fb31702e8be2bdcb77f8ccef75df14 to your computer and use it in GitHub Desktop.
Interface vs Type
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