The type of your settings is not Settings it's just generated from the actual values in there. That allows you to both Maintain all of your IntelliSense and you get errors if you accidentally spell something wrong or you try to access a property that doesn't exist. So quite honestly, I thought that like I would have thought that that that worked in TypeScript. Yeah, he value pairs. Okay. But there are use cases metadata JSON things like that where You don't necessarily have a type for it ahead of time. That's where satisfies is gonna come in handy.
In this Hasty Treat, Scott and Wes talk about Satisfies and as const.
Show Notes
export const currencies = { USD: 'US Dollars', CAD: 'Canadian Dollar', EUR: 'Euro', } as const; export type Currency = typeof currencies; export type CurrencyCode = keyof Currency;
Tweet us your tasty treats