I have to add export = Snap to make project accessible from projects which using webpack, mina object was not accessibly now, but in runtime it was still perfectly fine to have it in the code. Thus I extract mina package as separate global dependency. For code which use SnapSVG as global dependency this will work as earlier, but for those who want to use SnapSVG with WebPack it will reflect how mina available after importing SnapSVG
Prior to this change, the return type of Paper.group() was specified as "any" which was not very helpful. In my code I was declaring the variable i was storing the group in as "Element" which seemed to make sense at first, but then I later realized that operations like myGroup.line (to add a line in the group) were resulting in type errors. The "group" type has a line method but the "Element" type does not.
Looking in to the source code a bit more I found that groups are instantiated as Elements but then use the following code (in the Element construcor) to copy methods from the Paper prototype, which I believe makes the group type essentially equal to a "Paper":
```
if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
this[method] = Paper.prototype[method];
}
}
```
I'm not exactly familiar with this syntax though; it's not clear to me what ```Paper.prototype[has](method)``` exactly means or whether this means that a group object only inherits a subset of the methods from Paper, and therefore there should be some other type in the Type Definition file which corresponds to groups, masks, patterns and symbols.
Perhaps the Paper.mask and Paper.ptrn should be changed to return Paper as well? I'm not familiar with those so I didn't touch them in the type def file.