export interface MapObject {
(key: string): TaskDaylist
}
let myMap: MapObject = {};
But I encountered a type error
Type '{}' is not compatible with type '(s: string) => TaskDaylist'. Type '{}' does not match the signature '(s: string): TaskDaylist'.
I attempted to make it optional using ?
:
(key: string)?: TaskDaylist
Is there an alternative way to define the map and initialize it with an empty object?