'typescript type: define dictionary-like object type with a certain condition
How can we define the type that follows the rules below with typescript:
- has certain keys and values(say: key1 of
srtingtype and its value asDate) - may (or may not) have any kind of key-value pairs for the rest
image:
{
"key1": new Date(),
"otherKey": "any value",
...
}
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
