Fix module export

"declare var _" at the bottom conflicts with "declare module _" at the top and breaks typing support in certain IDEs.