In TypeScript code, you’ll often see Interfaces - constructs that look suspiciously like Types, but with some slightly different syntax and capabilities.
Why does TypeScript have both? When should you use one or the other?
We translate some of our code from previous lessons into Interfaces, inspect the VSCode hints and official documentation for clues, and look at examples from Vue 3, Vuetify, and VueStorefront Next.
By the end, you’ll have vastly expanded the amount of TypeScript code you can read.
Vuetify Example https://github.com/vuetifyjs/vuetify/blob/4c50717c6aeb4ad98d9f8e1d8d8276c8290cfd9b/packages/vuetify/src/components/VSparkline/VSparkline.ts#L20
VueStorefront Next Example https://github.com/DivanteLtd/next/blob/master/packages/commercetools/api-client/src/types/Api.ts
Vue 3 Example