pusher / push-notifications-web

Beams Browser notifications
MIT License
39 stars 20 forks source link

Type errors when initializing (Typescript) #67

Closed ColeTownsend closed 4 years ago

ColeTownsend commented 4 years ago

Hey team!

I know you added TS typings to this library which is helpful. When following the set up guide I'm getting the following error:

Property 'Client' does not exist on type 'typeof import("@pusher/push-notifications-web")'

My code

import * as PusherPushNotifications from "@pusher/push-notifications-web";

const beamsClient: PusherPushNotifications.PushNotificationsInstance = new PusherPushNotifications.Client(
  {
    instanceId: "f5841e55-2273-4489-8cd0-71f799dc7854",
  },
);
henrycheung19 commented 4 years ago

I also come across exactly the same situation.

would there be npm i @types/pusher__push-notifications-web ?

jonathanlloyd commented 4 years ago

Hi! Thanks for the report :slightly_smiling_face: I've shipped a fix in 1.0.3 which should solve this issue

ColeTownsend commented 4 years ago

Thanks @jonathanlloyd!