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