Creating a Map of type damlTypes.Map<string, damlTypes.Party>

Hi everyone :slight_smile:

on my project i am trying to create a Map of the following type damlTypes.Map<string, damlTypes.Party> (imported from the @daml/types lib).

But it keeps throwing me an error pointing that the " Property ‘entriesArray’ is missing"

I am doing it this way:

const myMap: damlTypes.Map<string, damlTypes.Party> = new Map(),

any help would be appreciated on how to create MapImpl (MapImpl |) on the FE.

Thanks :slight_smile:

const myMap: damlTypes.Map<string, damlTypes.Party> = new Map(),

In this line of code, Map is a totally unrelated type to damlTypes.Map. That error takes the form of pointing out that your property sets don’t match up correctly, as damlTypes.Map is a purely structural type.

MapImpl is not exported. In the public exports of @daml/types you’ll find the emptyMap function; this is a good starting point.

1 Like

Thank Stephen, yes on the meanwhile i opened the daml/types lib and found that.

 const empty = damlTypes.emptyMap<string, damlTypes.Party>()

solved my problem and then added the needed info with the .set() method.

Thanks :slight_smile: