@types/express-ws
TypeScript definitions for express-ws
Last updated 2 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/express-ws 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/express-ws

Summary

This package contains type definitions for express-ws (https://github.com/HenningM/express-ws).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-ws.

index.d.ts

import express = require("express");
import * as core from "express-serve-static-core";
import * as http from "http";
import * as https from "https";
import ws = require("ws");

declare module "express" {
    function Router(options?: RouterOptions): expressWs.Router;
}

declare function expressWs(
    app: express.Application,
    server?: http.Server | https.Server,
    options?: expressWs.Options,
): expressWs.Instance;
declare namespace expressWs {
    type Application = express.Application & WithWebsocketMethod;
    type Router = express.Router & WithWebsocketMethod;

    interface Options {
        leaveRouterUntouched?: boolean | undefined;
        wsOptions?: ws.ServerOptions | undefined;
    }

    interface RouterLike {
        get: express.IRouterMatcher<this>;
        [key: string]: any;
        [key: number]: any;
    }

    interface Instance {
        app: Application;
        applyTo(target: RouterLike): void;
        getWss(): ws.Server;
    }

    type WebsocketRequestHandler = (ws: ws.WebSocket, req: express.Request, next: express.NextFunction) => void;
    type WebsocketMethod<T> = (route: core.PathParams, ...middlewares: WebsocketRequestHandler[]) => T;

    interface WithWebsocketMethod {
        ws: WebsocketMethod<this>;
    }
}

export = expressWs;

Additional Details

Credits

These definitions were written by AJ Livingston.

Current Tags

  • 3.0.6                                ...           latest (6 months ago)
  • 3.0.0                                ...           ts2.3 (8 years ago)
  • 3.0.0                                ...           ts2.4 (8 years ago)
  • 3.0.0                                ...           ts2.5 (8 years ago)
  • 3.0.0                                ...           ts2.6 (8 years ago)
  • 3.0.0                                ...           ts2.7 (8 years ago)
  • 3.0.0                                ...           ts2.8 (8 years ago)
  • 3.0.0                                ...           ts2.9 (8 years ago)
  • 3.0.0                                ...           ts3.0 (8 years ago)
  • 3.0.0                                ...           ts3.1 (8 years ago)
  • 3.0.0                                ...           ts3.2 (8 years ago)
  • 3.0.0                                ...           ts3.3 (8 years ago)
  • 3.0.0                                ...           ts3.4 (8 years ago)
  • 3.0.0                                ...           ts3.5 (8 years ago)
  • 3.0.1                                ...           ts3.6 (5 years ago)
  • 3.0.1                                ...           ts3.7 (5 years ago)
  • 3.0.1                                ...           ts3.8 (5 years ago)
  • 3.0.1                                ...           ts3.9 (5 years ago)
  • 3.0.1                                ...           ts4.0 (5 years ago)
  • 3.0.1                                ...           ts4.1 (5 years ago)
  • 3.0.1                                ...           ts4.2 (5 years ago)
  • 3.0.1                                ...           ts4.3 (5 years ago)
  • 3.0.1                                ...           ts4.4 (5 years ago)
  • 3.0.4                                ...           ts4.5 (2 years ago)
  • 3.0.4                                ...           ts4.6 (2 years ago)
  • 3.0.4                                ...           ts4.7 (2 years ago)
  • 3.0.5                                ...           ts4.8 (2 years ago)
  • 3.0.5                                ...           ts4.9 (2 years ago)
  • 3.0.5                                ...           ts5.0 (2 years ago)
  • 3.0.5                                ...           ts5.1 (2 years ago)
  • 3.0.6                                ...           ts5.2 (6 months ago)
  • 3.0.6                                ...           ts5.3 (6 months ago)
  • 3.0.6                                ...           ts5.4 (6 months ago)
  • 3.0.6                                ...           ts5.5 (6 months ago)
  • 3.0.6                                ...           ts5.6 (6 months ago)
  • 3.0.6                                ...           ts5.7 (6 months ago)
  • 3.0.6                                ...           ts5.8 (6 months ago)
  • 3.0.6                                ...           ts5.9 (6 months ago)
  • 3.0.6                                ...           ts6.0 (6 months ago)

7 Versions

  • 3.0.6                                ...           6 months ago
  • 3.0.5                                ...           2 years ago
  • 3.0.4                                ...           2 years ago
  • 3.0.3                                ...           2 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |