Closed sebastianst closed 3 years ago
I had been trying to tell typedjson to parse a certain thing as a map.
I tried
import {MapShape} from 'typedjson/lib/types/type-descriptor'
...
@jsonMapMember(String, Boolean, {shape: MapShape.OBJECT})
I got the error message Cannot access ambient const enums when 'isolatedModules' is enabled.ts(2748)
. Its in a Vue3 + Vite + TS project.
I did this hack which works but feels crazy and will break when internal implementation of MapShape changes:
import type {MapShape} from 'typedjson/lib/types/type-descriptor'
...
@jsonMapMember(String, Boolean, {shape: 1 as MapShape})
Could you help with correct way to set shape?
The enum
MapShape
is currently not exported inindex.ts
, so it cannot be used when settingMapOptions
forMap
fields.