Depends on what you mean by "access". It's possible to mention them so that the generated CLJS code ends up using them.
how do i do the following in clojurescript:
import {
InitialStates,
SECPTransferOutput
} from "avalanche/dist/apis/avm"
i'm using shadow-cljs
the aforementioned folder exists in the node_modules folder
it is a js package
the following works:
(js/require "avalanche/dist/apis/avm")
but is it the idiomatic way of working with npm modules?@veix.q5 https://shadow-cljs.github.io/docs/UsersGuide.html#npm
what happens if i don't alias like following?
(require '["avalanche/dist/apis/avm" :as foo])
the following doesn't work for instance:
avalanche.dist.apis.avm/SECPTransferOutput
i assume i should always either refer or alias then?
because thats not the namespace that is generated for the string. not all strings can be translated to proper namespaces like that since the npm world does not follow the CLJ naming conventions
so yeah, you need the alias
i suspected so
thx