File tree Expand file tree Collapse file tree 5 files changed +50
-19
lines changed Expand file tree Collapse file tree 5 files changed +50
-19
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,3 @@ esm: false
2
2
ts: false
3
3
jsx: false
4
4
coverage: true
5
- flow: true
Original file line number Diff line number Diff line change 1
- import { FastifyPlugin } from 'fastify' ;
2
- import { ServerOptions } from 'socket.io' ;
1
+ import { FastifyPlugin } from 'fastify'
2
+ import { ServerOptions } from 'socket.io'
3
3
4
4
declare module 'fastify' {
5
5
export interface FastifyInstance {
6
- io : SocketIO . Server ;
6
+ io : SocketIO . Server
7
7
}
8
8
}
9
9
10
- declare const socketioServer : FastifyPlugin < ServerOptions > ;
11
- export default socketioServer ;
10
+ declare const socketioServer : FastifyPlugin < ServerOptions >
11
+ export default socketioServer
Original file line number Diff line number Diff line change 6
6
"types" : " index.d.ts" ,
7
7
"scripts" : {
8
8
"lint" : " standard && npm run lint:typescript" ,
9
- "lint:typescript" : " standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin test/types/*.ts " ,
9
+ "lint:typescript" : " ts-standard " ,
10
10
"test" : " npm run lint && npm run unit && npm run typescript" ,
11
11
"typescript" : " tsd" ,
12
12
"unit" : " tap --100 test/*.test.js"
29
29
"fastify" : " ^3.2.1" ,
30
30
"standard" : " ^14.3.4" ,
31
31
"tap" : " ^14.10.8" ,
32
+ "ts-standard" : " ^9.0.0" ,
32
33
"tsd" : " ^0.13.1" ,
33
34
"typescript" : " ^3.9.7"
34
35
},
41
42
},
42
43
"files" : [
43
44
" index.d.ts"
44
- ]
45
+ ],
46
+ "ts-standard" : {
47
+ "ignore" : [
48
+ " examples"
49
+ ]
50
+ }
45
51
}
Original file line number Diff line number Diff line change @@ -3,18 +3,24 @@ import socketioServer from '..'
3
3
import { expectType , expectAssignable } from 'tsd'
4
4
import { ServerOptions } from 'socket.io'
5
5
6
- const app = fastify ( )
6
+ try {
7
+ const app = fastify ( )
7
8
8
- app . register ( socketioServer )
9
+ await app . ready ( )
9
10
10
- app . io . emit ( 'test' )
11
+ await app . register ( socketioServer )
11
12
12
- expectType < SocketIO . Server > ( app . io )
13
+ app . io . emit ( 'test' )
13
14
14
- expectAssignable < ServerOptions > ( {
15
- path : '/test' ,
16
- serveClient : false ,
17
- pingInterval : 10000 ,
18
- pingTimeout : 5000 ,
19
- cookie : false
20
- } )
15
+ expectType < SocketIO . Server > ( app . io )
16
+
17
+ expectAssignable < ServerOptions > ( {
18
+ path : '/test' ,
19
+ serveClient : false ,
20
+ pingInterval : 10000 ,
21
+ pingTimeout : 5000 ,
22
+ cookie : false
23
+ } )
24
+ } catch ( err ) {
25
+ console . error ( err )
26
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "module" : " commonjs" ,
4
+ "esModuleInterop" : true ,
5
+ "allowSyntheticDefaultImports" : true ,
6
+ "target" : " es6" ,
7
+ "moduleResolution" : " node" ,
8
+ "sourceMap" : true ,
9
+ "outDir" : " dist" ,
10
+ "baseUrl" : " ." ,
11
+ "paths" : {
12
+ "*" : [
13
+ " node_modules/*"
14
+ ]
15
+ }
16
+ },
17
+ "include" : [
18
+ " **/*.ts"
19
+ ]
20
+ }
You can’t perform that action at this time.
0 commit comments