How do you use TypeScript typings that are modules? -


i'm trying use typings load definition file bowser. i've got typings installed , run typings install dt~bowser -dg --save-dev install locally. works great. i'm @ loss how use it. in past, has "just worked" - meaning, if try , write references bowser in typescript, find definition file (downloaded typings definitelytyped) , recognize bowser global function. however, looks definition file has changed , it's "module":

declare module 'bowser' {    var def: bowsermodule.ibowser;    export = def; } 

how supposed use in typescript files? of course can this:

declare var bowser: bowsermodule.ibowser; 

but feels wrong/hacky. missing here-- what's changed in world of typings/definitelytyped?

the correct syntax be

import bowser = require('bowser')  

if typings configured, should work. else, check if typings/index.d.ts file referenced in build script, , if bowser referenced in there:

/// <reference path="globals/bowser/index.d.ts" /> 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -