@@ -7,11 +7,7 @@ import accepts = require("accepts");
7
7
import { pipeline } from "stream" ;
8
8
import path = require( "path" ) ;
9
9
import { attach , Server as Engine , uServer } from "engine.io" ;
10
- import type {
11
- ServerOptions as EngineOptions ,
12
- AttachOptions ,
13
- BaseServer ,
14
- } from "engine.io" ;
10
+ import type { ServerOptions as EngineOptions , AttachOptions } from "engine.io" ;
15
11
import { Client } from "./client" ;
16
12
import { EventEmitter } from "events" ;
17
13
import { ExtendedError , Namespace , ServerReservedEventsMap } from "./namespace" ;
@@ -228,7 +224,7 @@ export class Server<
228
224
* const clientsCount = io.engine.clientsCount;
229
225
*
230
226
*/
231
- public engine : BaseServer ;
227
+ public engine : Engine ;
232
228
/**
233
229
* The underlying Node.js HTTP server.
234
230
*
@@ -712,7 +708,9 @@ export class Server<
712
708
* @param engine engine.io (or compatible) server
713
709
* @return self
714
710
*/
715
- public bind ( engine : BaseServer ) : this {
711
+ public bind ( engine : any ) : this {
712
+ // TODO apply strict types to the engine: "connection" event, `close()` and a method to serve static content
713
+ // this would allow to provide any custom engine, like one based on Deno or Bun built-in HTTP server
716
714
this . engine = engine ;
717
715
this . engine . on ( "connection" , this . onconnection . bind ( this ) ) ;
718
716
return this ;
0 commit comments