{"size": 1431, "ext": "js", "max_stars_repo_path": "flow-types/types/express-ws-routes_vx.x.x/flow_v0.25.x-/express-ws-routes.js", "max_stars_repo_name": "goodmind/FlowDefinitelyTyped", "max_stars_repo_stars_event_min_datetime": "2019-02-09T07:05:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-04T14:30:00.000Z", "max_issues_repo_path": "flow-types/types/express-ws-routes_vx.x.x/flow_v0.25.x-/express-ws-routes.js", "max_issues_repo_name": "goodmind/FlowDefinitelyTyped", "max_issues_repo_issues_event_min_datetime": "2021-05-08T04:00:43.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T04:00:43.000Z", "max_forks_repo_path": "flow-types/types/express-ws-routes_vx.x.x/flow_v0.25.x-/express-ws-routes.js", "max_forks_repo_name": "goodmind/FlowDefinitelyTyped", "max_forks_repo_forks_event_min_datetime": "2019-03-21T14:39:18.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-04T07:42:28.000Z"}
{"max_stars_count": 15, "max_issues_count": 1, "max_forks_count": 4, "avg_line_length": 26.5, "max_line_length": 88, "alphanum_fraction": 0.7274633124}
declare module "express-ws-routes" {
  import type {
    expressWsRoutes$Express as exExpress,
    Request,
    NextFunction
  } from "express";

  import typeof * as WebSocket from "ws";

  import type { expressWsRoutes$Server as httpServer } from "http";

  import type { expressWsRoutes$Router as coreRouter } from "express-serve-static-core";

  declare function expressWsRoutes(): expressWsRoutes$expressWsRoutes$Express;

  declare interface expressWsRoutes$ClientInfo {
    origin: string;
    secure: boolean;
    req: Request;
  }

  declare type expressWsRoutes$WebSocketHandler = (socket: WebSocket) => void;

  declare type expressWsRoutes$CbHandler = (
    connectHandler: expressWsRoutes$WebSocketHandler | boolean
  ) => void;

  declare type expressWsRoutes$WebSocketRouteHandler = (
    info: expressWsRoutes$ClientInfo,
    cb: expressWsRoutes$CbHandler,
    next: NextFunction
  ) => void;

  declare type expressWsRoutes$Server = {
    wsServer: WebSocket.expressWsRoutes$Server
  } & httpServer;

  declare type expressWsRoutes$Express = {
    websocket(
      route: string,
      handler: expressWsRoutes$WebSocketRouteHandler
    ): expressWsRoutes$Express
  } & exExpress;

  declare type expressWsRoutes$Router = {
    websocket(
      route: string,
      handler: expressWsRoutes$WebSocketRouteHandler
    ): expressWsRoutes$Router
  } & coreRouter;

  declare module.exports: typeof expressWsRoutes;
}
