1+ // @ts -ignore: this is a virtual module which we mock in the test so it doesn't exist when tsc runs
12import * as cs from "code-server"
23import * as fspath from "path"
34
5+ type FixMeLater = any
6+
47export const plugin : cs . Plugin = {
58 displayName : "Test Plugin" ,
69 routerPath : "/test-plugin" ,
710 homepageURL : "https://example.com" ,
811 description : "Plugin used in code-server tests." ,
912
10- init ( config ) {
13+ init ( config : FixMeLater ) {
1114 config . logger . debug ( "test-plugin loaded!" )
1215 } ,
1316
1417 router ( ) {
1518 const r = cs . express . Router ( )
16- r . get ( "/test-app" , ( _ , res ) => {
19+ r . get ( "/test-app" , ( _ : FixMeLater , res : FixMeLater ) => {
1720 res . sendFile ( fspath . resolve ( __dirname , "../public/index.html" ) )
1821 } )
19- r . get ( "/goland/icon.svg" , ( _ , res ) => {
22+ r . get ( "/goland/icon.svg" , ( _ : FixMeLater , res : FixMeLater ) => {
2023 res . sendFile ( fspath . resolve ( __dirname , "../public/icon.svg" ) )
2124 } )
2225 r . get ( "/error" , ( ) => {
@@ -27,8 +30,8 @@ export const plugin: cs.Plugin = {
2730
2831 wsRouter ( ) {
2932 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 ) => {
3235 req . ws . resume ( )
3336 ws . send ( "hello" )
3437 } )
0 commit comments