Skip to content

Instantly share code, notes, and snippets.

@ankitamasand
Created April 17, 2019 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitamasand/0579e6c612a4444b60baa2db171b5dba to your computer and use it in GitHub Desktop.
Save ankitamasand/0579e6c612a4444b60baa2db171b5dba to your computer and use it in GitHub Desktop.
interface TeslaModelSMap {
engineer: string,
model: TeslaModelS,
readonly rating: number
}
interface TeslaModelSReview {
[id: number]: TeslaModelSMap
}
const TeslaModelSReviewQueue: TeslaModelSReview = [
{
engineer: 'John',
model: modelByJohn1, // modelByJohn1 is of type `TeslaModelS`
rating: 2
},
{
engineer: 'Ray',
model: modelByRay1, // modelByRay1 is of type `TeslaModelS`
rating: 3
},
{
engineer: 'John',
model: modelByJohn2, // modelByJohn2 is of type `TeslaModelS`
rating: 4
},
// ... other 97 models
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment