Skip to content

Commit 6cc651c

Browse files
authored
Re-export WebSocket (#295)
Signed-off-by: Matteo Collina <[email protected]>
1 parent 2dcea44 commit 6cc651c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

types/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ declare namespace fastifyWebsocket {
9898
Logger extends FastifyBaseLogger = FastifyBaseLogger
9999
> extends fastify.RouteOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger>, WebsocketRouteOptions<RawServer, RawRequest, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger> { }
100100

101+
export type WebSocket = WebSocket.WebSocket;
102+
101103
export const fastifyWebsocket: FastifyWebsocket
102104
export { fastifyWebsocket as default }
103105
}

types/index.test-d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import fastifyWebsocket, { WebsocketHandler, fastifyWebsocket as namedFastifyWebsocket, default as defaultFastifyWebsocket } from '..';
1+
import fastifyWebsocket, { WebsocketHandler, fastifyWebsocket as namedFastifyWebsocket, default as defaultFastifyWebsocket, WebSocket } from '..';
22
import type { IncomingMessage } from "http";
33
import fastify, { RouteOptions, FastifyRequest, FastifyInstance, FastifyReply, RequestGenericInterface, FastifyBaseLogger, RawServerDefault, FastifySchema, RawRequestDefaultExpression } from 'fastify';
44
import { expectType } from 'tsd';
5-
import { Server, WebSocket } from 'ws';
5+
import { Server } from 'ws';
66
import { RouteGenericInterface } from 'fastify/types/route';
77
import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox';
88
import { Type } from '@sinclair/typebox'

0 commit comments

Comments
 (0)