Hi,
I'm creating a wrapper over a javascript (typescrti) library where a parameter can have two values.
export type MapOptions = {
...
    
    
    style: StyleSpecification | string;
...
Direct implementation in Nim returns an error.
MapOptions* {.importjs.} = ref object of JsRoot
      container*: cstring
      center*: LngLat
      zoom*: int
      style*: StyleSpecification | string
map.nim(38, 7) Error: invalid type: 'StyleSpecification or string' in this context: 'MapOptions' for let stack trace: (most recent call last)
What am I doing wrong?
thanks
Živoslav
import std/jsffi
type
  StyleSpecification = ref object of JsRoot
  LngLat = ref object of JsRoot
  
  MapOptions*[T: StyleSpecification | cstring] {.importjs.} = ref object of JsRoot
    container*: cstring
    center*: LngLat
    zoom*: int
    style*: T
let opts = MapOptions[string](
  container: "foo",
  center: LngLat(),
  zoom: 1,
  style: "bar"
)