# @types/sockjs

> TypeScript definitions for sockjs

Latest version **0.3.36** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/sockjs
pnpm add @types/sockjs
yarn add @types/sockjs
bun add @types/sockjs
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.36 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/sockjs
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sockjs
- npm.io page: https://npm.io/package/@types/sockjs

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.3.36 (latest) — 2023-11-07
- 0.3.33 (ts4.0) — 2021-07-06
- 0.3.32 (ts3.1) — 2020-05-15
- 0.3.31 (ts2.3) — 2017-06-23
- 0.3.35 — 2023-10-18
- 0.3.34 — 2023-09-25
- 0.3.30 — 2016-09-19
- 0.3.29 — 2016-08-25
- 0.3.28 — 2016-08-19
- 0.3.27 — 2016-08-02
- 0.3.26 — 2016-07-14
- 0.3.25-alpha — 2016-07-08
- 0.3.24-alpha — 2016-07-04
- 0.3.23-alpha — 2016-07-02
- 0.3.22-alpha — 2016-07-02
- … 5 more at https://npm.io/package/@types/sockjs/versions

## README

# Installation
> `npm install --save @types/sockjs`

# Summary
This package contains type definitions for sockjs (https://github.com/sockjs/sockjs-node).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sockjs.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sockjs/index.d.ts)
````ts
/// <reference types="node" />

import http = require("http");

export interface ServerOptions {
    sockjs_url?: string | undefined;
    prefix?: string | undefined;
    response_limit?: number | undefined;
    websocket?: boolean | undefined;
    jsessionid?: any;
    log?(severity: string, message: string): void;
    heartbeat_delay?: number | undefined;
    disconnect_delay?: number | undefined;
}

export function createServer(options?: ServerOptions): Server;

export interface Server extends NodeJS.EventEmitter {
    installHandlers(server: http.Server, options?: ServerOptions): any;

    on(event: "connection", listener: (conn: Connection) => any): this;
    on(event: string, listener: Function): this;
}

export interface Connection extends NodeJS.ReadWriteStream {
    remoteAddress: string;
    remotePort: number;
    address: {
        [key: string]: {
            address: string;
            port: number;
        };
    };
    headers: {
        [key: string]: string;
    };
    url: string;
    pathname: string;
    prefix: string;
    protocol: string;
    readyState: number;
    id: string;

    close(code?: string, reason?: string): boolean;
    destroy(): void;

    on(event: "data", listener: (message: string) => any): this;
    on(event: "close", listener: () => void): this;
    on(event: string, listener: Function): this;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing).

---
_Source: https://npm.io/package/@types/sockjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
