import js variables with two types

2023-11-04 Thread geotre
`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

import js variables with two types

2023-11-04 Thread domogled
Hi, I'm creating a wrapper over a javascript (typescrti) library where a parameter can have two values. export type MapOptions = { ... style: StyleSpecification | string; ... Run Direct implementation in Nim returns an error