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

1.1.5 • Public • Published

Installation

npm install --save @types/rgrove__parse-xml

Summary

This package contains type definitions for @rgrove/parse-xml (https://github.com/rgrove/parse-xml).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rgrove__parse-xml.

index.d.ts

declare function parseXml(name: string, options?: parseXml.ParseOptions): parseXml.Document;

declare namespace parseXml {
    interface NodeBase {
        parent?: NodeBase | undefined;
        type: string;
    }

    interface Document extends NodeBase {
        type: "document";
        children: NodeBase[];
    }

    interface CData extends NodeBase {
        type: "cdata";
        text: string;
    }

    interface Comment extends NodeBase {
        type: "comment";
        content: string;
    }

    interface Text extends NodeBase {
        type: "text";
        text: string;
    }

    interface Element extends NodeBase {
        type: "element";
        attributes: { [key: string]: string };
        children: NodeBase[];
        name: string;
        preserveWhitespace?: string | undefined;
    }

    type Node = CData | Comment | Element | Text;

    interface ParseOptions {
        ignoreUndefinedEntities?: boolean | undefined;
        preserveCdata?: boolean | undefined;
        preserveComments?: boolean | undefined;
        resolveUndefinedEntity?: ((ref: string) => string) | undefined;
    }
}

export = parseXml;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Pete Johanson.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/rgrove__parse-xml

Weekly Downloads

201

Version

1.1.5

License

MIT

Unpacked Size

4.91 kB

Total Files

5

Last publish

Collaborators

  • types