1.1.5 • Published 6 months ago

@types/rgrove__parse-xml v1.1.5

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

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

// Type definitions for @rgrove/parse-xml 1.1
// Project: https://github.com/rgrove/parse-xml
// Definitions by: Pete Johanson <https://github.com/petejohanson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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: Thu, 08 Jul 2021 22:42:05 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Pete Johanson.