Create a map/dictionary type with typed keys and values.
Records are encoded as key-value pairs. Keys must be string or int types. At runtime, records are represented as JavaScript Map objects.
Map
The key type (StringType or IntType)
The value type
The type of keys in the map
The type of values in the map
const PlayerStats = ObjectType("PlayerStats", { // Map from player name to score scoresByName: RecordType(StringType(), IntType()), // Map from player ID to position positionsById: RecordType(IntType(), ReferenceType(Position)),}); Copy
const PlayerStats = ObjectType("PlayerStats", { // Map from player name to score scoresByName: RecordType(StringType(), IntType()), // Map from player ID to position positionsById: RecordType(IntType(), ReferenceType(Position)),});
Create a map/dictionary type with typed keys and values.
Records are encoded as key-value pairs. Keys must be string or int types. At runtime, records are represented as JavaScript
Mapobjects.