UNPKG

xmppjs-chat-bot

Version:
42 lines (41 loc) 1.38 kB
/// <reference types="xmpp__xml" /> /// <reference types="xmpp__jid" /> import type { Element } from '@xmpp/xml'; import { JID } from '@xmpp/jid'; export type XMPPElementType = 'message' | 'iq' | 'presence'; declare abstract class Stanza { protected readonly xml: Element; abstract readonly stanzaType: XMPPElementType; readonly from: JID | null; readonly to: JID | null; readonly type: string | null; constructor(xml: Element); static parseIncoming(xml: Element): Stanza | null; toString(): string; dump(): any; } declare class MessageStanza extends Stanza { readonly stanzaType: XMPPElementType; isDelayed(): boolean; uniqueAndStableStanzaID(): string | null; occupantId(): string | null; body(): string | null; isMentionned(jids: JID[] | JID): boolean; } declare class IqStanza extends Stanza { readonly stanzaType: XMPPElementType; } declare class PresenceStanza extends Stanza { readonly stanzaType: XMPPElementType; private readonly _isMe; private readonly _Role; private readonly _Affiliation; private readonly _IsNickNameChange; private readonly _NewNickname; constructor(xml: Element); isMe(): boolean; role(): string | undefined; affiliation(): string | undefined; isNickNameChange(): string | false; } export { Stanza, MessageStanza, IqStanza, PresenceStanza };