This is likely too close to Generics support, but we could use some way to type the values of AAs without being concerned for its keys.
Typescript does it with mapped types:
type OnlyBoolsAndHorses = {
[key: string]: boolean | Horse;
};
const conforms: OnlyBoolsAndHorses = {
del: true,
rodney: false,
};
Originally, given that our AAs support nothing other than strings, I was going to suggest adding some sort of Map<T> syntax. However, I started thinking about how we could use string-based enums for keys as well. So I'm wondering how we could make it neater. Perhaps the same syntax as Typescript could work?
This is likely too close to Generics support, but we could use some way to type the values of AAs without being concerned for its keys.
Typescript does it with mapped types:
Originally, given that our AAs support nothing other than strings, I was going to suggest adding some sort of
Map<T>syntax. However, I started thinking about how we could use string-based enums for keys as well. So I'm wondering how we could make it neater. Perhaps the same syntax as Typescript could work?