'typescript type: define dictionary-like object type with a certain condition

How can we define the type that follows the rules below with typescript:

  1. has certain keys and values(say: key1 of srting type and its value as Date)
  2. 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