@types/xmpp__events
TypeScript icon, indicating that this package has built-in type declarations

0.13.3 • Public • Published

Installation

npm install --save @types/xmpp__events

Summary

This package contains type definitions for @xmpp/events (https://github.com/xmppjs/xmpp.js/tree/main/packages/events).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xmpp__events.

index.d.ts

/// <reference types="node" />

import * as events from "events";

export const EventEmitter: typeof events.EventEmitter;
export type EventEmitter = events.EventEmitter;

export class TimeoutError extends Error {
    readonly name: "TimeoutError";
}

export function delay(ms: number): Promise<void> & { timeout: NodeJS.Timeout | number };
export function timeout<TPromise extends PromiseLike<unknown>>(
    promise: TPromise,
    ms: number,
): TPromise extends PromiseLike<infer TValue> ? Promise<TValue> : never;
export function promise(
    emitter: EventEmitter,
    event: string | symbol,
    rejectEvent?: string | symbol | null,
    timeout?: number | null,
): Promise<unknown>;

export class Deferred<TValue> {
    readonly promise: Promise<TValue>;
    resolve(value: TValue | PromiseLike<TValue>): void;
    reject(reason?: any): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/xmpp__events

Weekly Downloads

1,093

Version

0.13.3

License

MIT

Unpacked Size

4.38 kB

Total Files

5

Last publish

Collaborators

  • types