0.13.4 • Published 6 months ago

@types/xmpp__xml v0.13.4

Weekly downloads
107
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/xmpp__xml

Summary

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

Details

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

index.d.ts

// Type definitions for @xmpp/xml 0.13
// Project: https://github.com/xmppjs/xmpp.js/tree/main/packages/xml
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = xml;

import * as ltx from 'ltx';
import * as escape from 'ltx/lib/escape';
import LtxParser = require('ltx/lib/parsers/ltx');

declare function xml(...args: Parameters<typeof ltx.createElement>): ReturnType<typeof ltx.createElement>;

declare namespace xml {
    type Element = ltx.Element;
    type Node = ltx.Node;

    const Element: typeof ltx.Element;
    const createElement: typeof ltx.createElement;

    const escapeXML: typeof escape.escapeXML;
    const unescapeXML: typeof escape.unescapeXML;
    const escapeXMLText: typeof escape.escapeXMLText;
    const unescapeXMLText: typeof escape.unescapeXMLText;

    class Parser extends ltx.Parser {
        static readonly XMLError: typeof XMLError;
        readonly parser: LtxParser;
        root: Element | null;
        cursor: Element | null;

        onStartElement(name: string, attrs?: string | { [attrName: string]: any }): void;
        onEndElement(name: string): void;
        onText(str: string): void;
    }

    class XMLError extends Error {
        readonly name: 'XMLError';
    }
}

declare global {
    namespace JSX {
        interface IntrinsicElements {
            [elemName: string]: any;
        }

        type Element = xml.Element;
    }
}

Additional Details

  • Last updated: Tue, 30 Nov 2021 17:31:55 GMT
  • Dependencies: @types/ltx
  • Global values: none

Credits

These definitions were written by BendingBender.