11import * as cs from "code-server"
22import * as fspath from "path"
33
4+ type FixMeLater = any
5+
46export const plugin : cs . Plugin = {
57 displayName : "Test Plugin" ,
68 routerPath : "/test-plugin" ,
79 homepageURL : "https://example.com" ,
810 description : "Plugin used in code-server tests." ,
911
10- init ( config ) {
12+ init ( config : FixMeLater ) {
1113 config . logger . debug ( "test-plugin loaded!" )
1214 } ,
1315
1416 router ( ) {
1517 const r = cs . express . Router ( )
16- r . get ( "/test-app" , ( _ , res ) => {
18+ r . get ( "/test-app" , ( _ : FixMeLater , res : FixMeLater ) => {
1719 res . sendFile ( fspath . resolve ( __dirname , "../public/index.html" ) )
1820 } )
19- r . get ( "/goland/icon.svg" , ( _ , res ) => {
21+ r . get ( "/goland/icon.svg" , ( _ : FixMeLater , res : FixMeLater ) => {
2022 res . sendFile ( fspath . resolve ( __dirname , "../public/icon.svg" ) )
2123 } )
2224 r . get ( "/error" , ( ) => {
@@ -27,8 +29,8 @@ export const plugin: cs.Plugin = {
2729
2830 wsRouter ( ) {
2931 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 ) => {
3234 req . ws . resume ( )
3335 ws . send ( "hello" )
3436 } )
0 commit comments