# @types/strophejs-plugin-roster

> TypeScript definitions for strophejs-plugin-roster

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

## Install

```sh
npm install @types/strophejs-plugin-roster
pnpm add @types/strophejs-plugin-roster
yarn add @types/strophejs-plugin-roster
bun add @types/strophejs-plugin-roster
```

## 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.1.5 |
| Published | 2023-11-07 |
| First published | 2019-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 1.1.5 (latest) — 2023-11-07
- 1.1.2 (ts3.9) — 2022-05-02
- 1.1.1 (ts3.2) — 2019-11-26
- 1.1.0 (ts2.1) — 2019-03-30
- 1.1.4 — 2023-10-18
- 1.1.3 — 2023-09-25

## README

# Installation
> `npm install --save @types/strophejs-plugin-roster`

# Summary
This package contains type definitions for strophejs-plugin-roster (https://github.com/strophe/strophejs-plugin-roster#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/strophejs-plugin-roster.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/strophejs-plugin-roster/index.d.ts)
````ts
import { Strophe } from "strophe.js";

export {};

export type IqCallback = (stanza: Element) => any;
export type IqID = string;
export type RosterSubscriptionState = "none" | "to" | "from" | "both" | "remove";
export type PresenceSubscriptionType = "subscribe" | "unsubscribe" | "subscribed" | "unsubscribed";

export interface RosterResource {
    priority: string;
    show: string;
    status: string;
}

export interface RosterItem {
    name: string;
    jid: string;
    subscription: RosterSubscriptionState;
    ask: string;
    groups: string[];
    resources: { [resourceId: string]: RosterResource };
}

export type RosterUpdateCallback = (items: RosterItem[], item: RosterItem, previousItem: RosterItem) => any;
export type PresenceRequestCallback = (from: string) => any;

interface StropheRosterPlugin {
    supportVersioning(): boolean;

    get(userCallback: IqCallback, ver?: string, items?: string[]): IqID;

    registerCallback(callback: RosterUpdateCallback): void;

    registerRequestCallback(callback: PresenceRequestCallback): void;

    findItem(jid: string): RosterItem | false;

    removeItem(jid: string): boolean;

    subscribe(jid: string, message?: string, nick?: string): void;

    unsubscribe(jid: string, message?: string): void;

    authorize(jid: string, message?: string): void;

    unauthorize(jid: string, message?: string): void;

    add(jid: string, name: string, groups: string[], call_back?: IqCallback): IqID;

    update(jid: string, name?: string, groups?: string[], call_back?: IqCallback): IqID;

    remove(jid: string, call_back?: IqCallback): void;
}

/*~ Here, declare the same module as the one you imported above */
declare module "strophe.js" {
    namespace Strophe {
        interface Connection {
            roster: StropheRosterPlugin;
        }
    }
}

declare global {
    namespace Strophe {
        interface Connection {
            roster: StropheRosterPlugin;
        }
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/strophe.js](https://npmjs.com/package/@types/strophe.js)

# Credits
These definitions were written by [LeartS](https://github.com/LeartS).

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