There is a library I use, 'react-bootstrap-switch', that needs to be imported the following way in TypeScript:
import * as Switch from 'react-bootstrap-switch';
render () {
return <Switch/>
}
It seems currently TypeScript doesnt allow creating a module definition for a library that exports like this.
If I do this:
declare module 'react-bootstrap-switch'
{
import React = require("react");
class Switch extends React.Component<{onColor?:string},{} >
{}
export = Switch;
}
It results in this error:
error TS2497: Module ''react-bootstrap-switch'' resolves to a non-module entity and cannot be imported using this construct.