1
1
import * as cs from "code-server"
2
2
import * as fspath from "path"
3
3
4
+ type FixMeLater = any
5
+
4
6
export const plugin : cs . Plugin = {
5
7
displayName : "Test Plugin" ,
6
8
routerPath : "/test-plugin" ,
7
9
homepageURL : "https://example.com" ,
8
10
description : "Plugin used in code-server tests." ,
9
11
10
- init ( config ) {
12
+ init ( config : FixMeLater ) {
11
13
config . logger . debug ( "test-plugin loaded!" )
12
14
} ,
13
15
14
16
router ( ) {
15
17
const r = cs . express . Router ( )
16
- r . get ( "/test-app" , ( _ , res ) => {
18
+ r . get ( "/test-app" , ( _ : FixMeLater , res : FixMeLater ) => {
17
19
res . sendFile ( fspath . resolve ( __dirname , "../public/index.html" ) )
18
20
} )
19
- r . get ( "/goland/icon.svg" , ( _ , res ) => {
21
+ r . get ( "/goland/icon.svg" , ( _ : FixMeLater , res : FixMeLater ) => {
20
22
res . sendFile ( fspath . resolve ( __dirname , "../public/icon.svg" ) )
21
23
} )
22
24
r . get ( "/error" , ( ) => {
@@ -27,8 +29,8 @@ export const plugin: cs.Plugin = {
27
29
28
30
wsRouter ( ) {
29
31
const wr = cs . WsRouter ( )
30
- wr . ws ( "/test-app" , ( req ) => {
31
- cs . wss . handleUpgrade ( req , req . ws , req . head , ( ws ) => {
32
+ wr . ws ( "/test-app" , ( req : FixMeLater ) => {
33
+ cs . wss . handleUpgrade ( req , req . ws , req . head , ( ws : FixMeLater ) => {
32
34
req . ws . resume ( )
33
35
ws . send ( "hello" )
34
36
} )
0 commit comments