geelen / Snap.svg-cjs

41 stars 16 forks source link

Use mina? #7

Open jakow opened 7 years ago

jakow commented 7 years ago

Hello,

I am using Snap.svg-cjs and I am trying to import mina: import Snap, { mina } from 'snapsvg-cjs';. However, mina is not defined in this case. However, if I then use mina defined on window: import Snap from 'snapsvg-cjs'; const mina = window.mina;, then I am able to use it. Is this a problem with the package?

Cheers, Jakub

bartboy011 commented 7 years ago

Looking at the dist/snap.svg-cjs.js file, it looks like mina is never exported but only set to window. I think your current usage is the intended usage.

AliObaji commented 7 years ago

Hello, when I use import {mina} it is undefined. But when i try to use window.mina... it says property 'mina' does not exists on type window ..So how do I use it ? Thank you

germansokolov13 commented 6 years ago

property 'mina' does not exists on type window is just a hint from Typescipt. You can write (window as any).mina or window['mina']. But this is just entirely incorrect. Mina ought to be exported.