@@ -7,11 +7,7 @@ import accepts = require("accepts");
77import { pipeline } from "stream" ;
88import path = require( "path" ) ;
99import { 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" ;
1511import { Client } from "./client" ;
1612import { EventEmitter } from "events" ;
1713import { ExtendedError , Namespace , ServerReservedEventsMap } from "./namespace" ;
@@ -228,7 +224,7 @@ export class Server<
228224 * const clientsCount = io.engine.clientsCount;
229225 *
230226 */
231- public engine : BaseServer ;
227+ public engine : Engine ;
232228 /**
233229 * The underlying Node.js HTTP server.
234230 *
@@ -712,7 +708,9 @@ export class Server<
712708 * @param engine engine.io (or compatible) server
713709 * @return self
714710 */
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
716714 this . engine = engine ;
717715 this . engine . on ( "connection" , this . onconnection . bind ( this ) ) ;
718716 return this ;
0 commit comments