# @types/stompjs

> TypeScript definitions for stompjs

Latest version **2.3.10** (published 2025-11-14) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.3.10 |
| Published | 2025-11-14 |
| First published | 2016-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 2.3.10 (latest) — 2025-11-14
- 2.3.9 (ts4.5) — 2023-11-21
- 2.3.5 (ts3.6) — 2021-07-02
- 2.3.4 (ts2.0) — 2018-08-29
- 2.3.8 — 2023-11-07
- 2.3.7 — 2023-10-18
- 2.3.6 — 2023-09-25
- 2.3.3 — 2018-05-09
- 2.3.2 — 2018-02-10
- 2.3.1 — 2018-02-10
- 2.3.0 — 2016-11-14

## README

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

export const VERSIONS: {
    V1_0: string;
    V1_1: string;
    V1_2: string;
    supportedVersions: () => string[];
};

export class Client {
    connected: boolean;
    counter: number;
    heartbeat: {
        incoming: number;
        outgoing: number;
    };
    maxWebSocketFrameSize: number;
    subscriptions: {};
    ws: WebSocket;

    debug(...args: string[]): any;

    connect(
        headers: { login: string; passcode: string; host?: string | undefined },
        connectCallback: (frame?: Frame) => any,
        errorCallback?: (error: Frame | string) => any,
    ): any;
    connect(headers: {}, connectCallback: (frame?: Frame) => any, errorCallback?: (error: Frame | string) => any): any;
    connect(
        login: string,
        passcode: string,
        connectCallback: (frame?: Frame) => any,
        errorCallback?: (error: Frame | string) => any,
        host?: string,
    ): any;
    disconnect(disconnectCallback: () => any, headers?: {}): any;

    send(destination: string, headers?: {}, body?: string): any;
    subscribe(destination: string, callback?: (message: Message) => any, headers?: {}): Subscription;
    unsubscribe(id: string): void;

    begin(transaction: string): any;
    commit(transaction: string): any;
    abort(transaction: string): any;

    ack(messageID: string, subscription: string, headers?: {}): any;
    nack(messageID: string, subscription: string, headers?: {}): any;
}

export interface Subscription {
    id: string;
    unsubscribe(): void;
}

export interface Message extends Frame {
    ack(headers?: {}): any;
    nack(headers?: {}): any;
}

export class Frame {
    command: string;
    headers: {};
    body: string;
    constructor(command: string, headers?: {}, body?: string);

    toString(): string;
    static sizeOfUTF8(s: string): number;
    static unmarshall(datas: any): any;
    static marshall(command: string, headers?: {}, body?: string): any;
}

export function client(url: string, protocols?: string | string[]): Client;
export function over(ws: WebSocket): Client;
export function overTCP(host: string, port: number): Client;
export function overWS(url: string): Client;
export function setInterval(interval: number, f: (...args: any[]) => void): NodeJS.Timeout;
export function clearInterval(id: NodeJS.Timeout): void;

````

### Additional Details
 * Last updated: Fri, 14 Nov 2025 18:02:08 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Jimi Charalampidis](https://github.com/jimic), and [Stefan Erichsen](https://github.com/Dr4k4n).

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