# @types/sockjs-client

> TypeScript definitions for sockjs-client

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

## Install

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

## 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.

Negative: abandoned.

## Facts

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

## Links

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

## Recent versions

- 1.5.4 (latest) — 2023-11-07
- 1.5.1 (ts3.7) — 2021-07-06
- 1.5.0 (ts3.4) — 2020-11-23
- 1.1.1 (ts2.1) — 2019-02-13
- 1.5.3 — 2023-10-18
- 1.5.2 — 2023-09-25
- 1.1.0 — 2017-12-14
- 1.0.32 — 2017-08-21
- 1.0.31 — 2017-07-25
- 1.0.30 — 2016-09-19
- 1.0.29 — 2016-08-25
- 1.0.28 — 2016-08-19
- 1.0.27 — 2016-08-02
- 1.0.26 — 2016-07-14
- 1.0.25-alpha — 2016-07-08
- … 8 more at https://npm.io/package/@types/sockjs-client/versions

## README

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

declare const SockJS: {
    new(url: string, _reserved?: any, options?: SockJS.Options): WebSocket;
    (url: string, _reserved?: any, options?: SockJS.Options): WebSocket;
    prototype: WebSocket;
    CONNECTING: SockJS.CONNECTING;
    OPEN: SockJS.OPEN;
    CLOSING: SockJS.CLOSING;
    CLOSED: SockJS.CLOSED;
};

declare namespace SockJS {
    type CONNECTING = 0;
    type OPEN = 1;
    type CLOSING = 2;
    type CLOSED = 3;

    type State = CONNECTING | OPEN | CLOSING | CLOSED;

    interface BaseEvent extends Event {
        type: string;
    }

    type OpenEvent = BaseEvent;

    interface CloseEvent extends BaseEvent {
        code: number;
        reason: string;
        wasClean: boolean;
    }

    interface MessageEvent extends BaseEvent {
        data: string;
    }

    type SessionGenerator = () => string;

    interface Options {
        server?: string | undefined;
        sessionId?: number | SessionGenerator | undefined;
        transports?: string | string[] | undefined;
        timeout?: number | undefined;
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Emil Ivanov](https://github.com/vladev), [Alexander Rusakov](https://github.com/arusakov), [BendingBender](https://github.com/BendingBender), [Soner Köksal](https://github.com/renjfk), and [Alexander Putilov](https://github.com/PutilovAI).

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