Skip to content

Commit e28d650

Browse files
committed
fix(types): use default import syntax for defaultFastifyWebsocket
1 parent 4140f4d commit e28d650

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

types/index.test-d.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox'
2-
import { Type } from 'typebox'
2+
import { Type } from '@sinclair/typebox'
33
import fastify, { FastifyBaseLogger, FastifyInstance, FastifyReply, FastifyRequest, FastifySchema, RawRequestDefaultExpression, RawServerDefault, RequestGenericInterface, RouteOptions } from 'fastify'
44
import { RouteGenericInterface } from 'fastify/types/route'
55
import type { IncomingMessage } from 'node:http'
66
import { expectType } from 'tsd'
77
import { Server } from 'ws'
8-
// eslint-disable-next-line import-x/no-named-default -- Test default export
9-
import fastifyWebsocket, { default as defaultFastifyWebsocket, fastifyWebsocket as namedFastifyWebsocket, WebSocket, WebsocketHandler } from '..'
8+
import defaultFastifyWebsocket, {
9+
fastifyWebsocket as namedFastifyWebsocket,
10+
WebSocket,
11+
WebsocketHandler
12+
} from '..'
1013

14+
const fastifyWebsocket = defaultFastifyWebsocket
1115
const app: FastifyInstance = fastify()
1216
app.register(fastifyWebsocket)
1317
app.register(fastifyWebsocket, {})
@@ -111,22 +115,18 @@ app.route<{ Params: { foo: string }, Body: { bar: string }, Querystring: { searc
111115
})
112116

113117
const schema = {
114-
params: Type.Object(
115-
{ foo: Type.String() },
116-
{ required: ['foo'] }
117-
),
118-
querystring: Type.Object(
119-
{ search: Type.String() },
120-
{ required: ['search'] }
121-
),
122-
body: Type.Object(
123-
{ bar: Type.String() },
124-
{ required: ['bar'] }
125-
),
126-
headers: Type.Object(
127-
{ auth: Type.String() },
128-
{ required: ['auth'] }
129-
)
118+
params: Type.Object({
119+
foo: Type.String()
120+
}),
121+
querystring: Type.Object({
122+
search: Type.String()
123+
}),
124+
body: Type.Object({
125+
bar: Type.String()
126+
}),
127+
headers: Type.Object({
128+
auth: Type.String()
129+
})
130130
}
131131

132132
const server = app.withTypeProvider<TypeBoxTypeProvider>()

0 commit comments

Comments
 (0)