fastify / fastify-websocket

basic websocket support for fastify
MIT License
394 stars 72 forks source link

fix(types): websocketPlugin is not an existing variable #269

Closed Yovach closed 11 months ago

Yovach commented 11 months ago

This PR fixes a mistake in types. The named exports websocketPlugin doesn't exist in the code and you can't use it

Until this PR is merged, you can do the following :

fastify-websocket.d.ts

import type websocketPlugin from "@fastify/websocket";

declare module "@fastify/websocket" {
  export const fastifyWebsocket: typeof websocketPlugin;
}

Checklist

Uzlopak commented 11 months ago

image

Shame!

thank you.

mcollina commented 11 months ago

Can you add a test using tsd to prevent this for regressing?

Yovach commented 11 months ago

Can you add a test using tsd to prevent this for regressing?

I added a test for named-import but tests seems broken in fastify@4.24.0

Uzlopak commented 11 months ago

Other typings fails are unrelated to this PR.