Currently, the project-wide esModuleInterop flag must be enabled in order to import the pubnub module using declarative syntax (import * as PubNub from 'pubnub'). Alternatively, dynamic import syntax may be used (import PubNub = require('pubnub')), but that carries its own list of disadvantages.
This is fixed by simply declaring a PubNub namespace alongside the exported class like so:
Currently, the project-wide
esModuleInterop
flag must be enabled in order to import thepubnub
module using declarative syntax (import * as PubNub from 'pubnub'
). Alternatively, dynamic import syntax may be used (import PubNub = require('pubnub')
), but that carries its own list of disadvantages.This is fixed by simply declaring a
PubNub
namespace alongside the exported class like so:This matches the DefinitelyTyped package: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pubnub/index.d.ts#L330