#Dynamic keys and types in an object
5 messages · Page 1 of 1 (latest)
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
I want $extensions to be of type "Extensions", and all the other keys to be of type Default
but it seems like I'm forced to do:
type Schemas = {
$default?: Default;
$extensions?: Extensions;
} & Record<string, Default | Extensions>
which is not correct because I know all the other keys can't be of type Extensions 😅
I would need something like Record<string except "$extensions", Default> :p