-
Notifications
You must be signed in to change notification settings - Fork 399
Closed
Labels
priority: mediumThis PR should be reviewed after all high priority PRs.This PR should be reviewed after all high priority PRs.status: in progressThis issue is being worked on.This issue is being worked on.type: choreThis PR contains changes that are not covered by other types (stylistic, dependency updates, etc).This PR contains changes that are not covered by other types (stylistic, dependency updates, etc).
Description
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:
declare class PubNub ...
declare namespace PubNub {}
export = PubNub;
This matches the DefinitelyTyped package: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pubnub/index.d.ts#L330
Metadata
Metadata
Assignees
Labels
priority: mediumThis PR should be reviewed after all high priority PRs.This PR should be reviewed after all high priority PRs.status: in progressThis issue is being worked on.This issue is being worked on.type: choreThis PR contains changes that are not covered by other types (stylistic, dependency updates, etc).This PR contains changes that are not covered by other types (stylistic, dependency updates, etc).