Skip to content

fix(types): add typings for io.engine #4591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
EventNames,
} from "./typed-events";
import { patchAdapter, restoreAdapter, serveFile } from "./uws";
import type { BaseServer } from "engine.io/build/server";

const debug = debugModule("socket.io:server");

Expand Down Expand Up @@ -127,7 +128,7 @@ export class Server<
* const clientsCount = io.engine.clientsCount;
*
*/
public engine: any;
public engine: BaseServer;

/** @private */
readonly _parser: typeof parser;
Expand Down Expand Up @@ -582,10 +583,10 @@ export class Server<
/**
* Binds socket.io to an engine.io instance.
*
* @param {engine.Server} engine engine.io (or compatible) server
* @param engine engine.io (or compatible) server
* @return self
*/
public bind(engine): this {
public bind(engine: BaseServer): this {
this.engine = engine;
this.engine.on("connection", this.onconnection.bind(this));
return this;
Expand Down