@types/xml2js

  • Version 0.4.8
  • Published
  • 7.01 kB
  • 1 dependency
  • MIT license

Install

npm i @types/xml2js
yarn add @types/xml2js
pnpm add @types/xml2js

Overview

TypeScript definitions for node-xml2js

Index

Variables

variable defaults

const defaults: { '0.1': Options; '0.2': OptionsV2 };

    Functions

    function parseString

    parseString: {
    (str: convertableToString, callback: (err: Error, result: any) => void): void;
    (
    str: convertableToString,
    options: ParserOptions,
    callback: (err: Error, result: any) => void
    ): void;
    };

      function parseStringPromise

      parseStringPromise: (
      str: convertableToString,
      options?: ParserOptions
      ) => Promise<any>;

        Classes

        class Builder

        class Builder {}

          constructor

          constructor(options?: BuilderOptions);

            method buildObject

            buildObject: (rootObj: any) => string;

              class Parser

              class Parser extends EventEmitter {}

                constructor

                constructor(options?: ParserOptions);

                  method parseString

                  parseString: (str: convertableToString, cb?: Function) => void;

                    method parseStringPromise

                    parseStringPromise: (str: convertableToString) => Promise<any>;

                      method reset

                      reset: () => void;

                        Interfaces

                        interface BuilderOptions

                        interface BuilderOptions {}

                          property allowSurrogateChars

                          allowSurrogateChars?: boolean;

                            property attrkey

                            attrkey?: string;

                              property cdata

                              cdata?: boolean;

                                property charkey

                                charkey?: string;

                                  property doctype

                                  doctype?: any;

                                    property headless

                                    headless?: boolean;

                                      property renderOpts

                                      renderOpts?: RenderOptions;

                                        property rootName

                                        rootName?: string;

                                          property xmldec

                                          xmldec?: XmlDeclarationAttributes;

                                            interface convertableToString

                                            interface convertableToString {}

                                              method toString

                                              toString: () => string;

                                                interface ParserOptions

                                                interface ParserOptions {}

                                                  property async

                                                  async?: boolean;

                                                    property attrkey

                                                    attrkey?: string;

                                                      property attrNameProcessors

                                                      attrNameProcessors?: Array<(name: string) => any>;

                                                        property attrValueProcessors

                                                        attrValueProcessors?: Array<(value: string, name: string) => any>;

                                                          property charkey

                                                          charkey?: string;

                                                            property charsAsChildren

                                                            charsAsChildren?: boolean;

                                                              property childkey

                                                              childkey?: string;

                                                                property chunkSize

                                                                chunkSize?: number;

                                                                  property emptyTag

                                                                  emptyTag?: any;

                                                                    property explicitArray

                                                                    explicitArray?: boolean;

                                                                      property explicitCharkey

                                                                      explicitCharkey?: boolean;

                                                                        property explicitChildren

                                                                        explicitChildren?: boolean;

                                                                          property explicitRoot

                                                                          explicitRoot?: boolean;

                                                                            property ignoreAttrs

                                                                            ignoreAttrs?: boolean;

                                                                              property includeWhiteChars

                                                                              includeWhiteChars?: boolean;

                                                                                property mergeAttrs

                                                                                mergeAttrs?: boolean;

                                                                                  property normalize

                                                                                  normalize?: boolean;

                                                                                    property normalizeTags

                                                                                    normalizeTags?: boolean;

                                                                                      property preserveChildrenOrder

                                                                                      preserveChildrenOrder?: boolean;

                                                                                        property strict

                                                                                        strict?: boolean;

                                                                                          property tagNameProcessors

                                                                                          tagNameProcessors?: Array<(name: string) => any>;

                                                                                            property trim

                                                                                            trim?: boolean;

                                                                                              property validator

                                                                                              validator?: Function;

                                                                                                property valueProcessors

                                                                                                valueProcessors?: Array<(value: string, name: string) => any>;

                                                                                                  property xmlns

                                                                                                  xmlns?: boolean;

                                                                                                    interface RenderOptions

                                                                                                    interface RenderOptions {}

                                                                                                      property indent

                                                                                                      indent?: string;

                                                                                                        property newline

                                                                                                        newline?: string;

                                                                                                          property pretty

                                                                                                          pretty?: boolean;

                                                                                                            interface XmlDeclarationAttributes

                                                                                                            interface XmlDeclarationAttributes {}

                                                                                                              property encoding

                                                                                                              encoding?: string;

                                                                                                                property standalone

                                                                                                                standalone?: boolean;

                                                                                                                  property version

                                                                                                                  version: string;

                                                                                                                    Type Aliases

                                                                                                                    type Options

                                                                                                                    type Options = Omit<ParserOptions, 'preserveChildrenOrder' | 'chunkSize'>;

                                                                                                                      type OptionsV2

                                                                                                                      type OptionsV2 = ParserOptions & BuilderOptions;

                                                                                                                        Namespaces

                                                                                                                        namespace processors

                                                                                                                        module 'lib/processors.d.ts' {}

                                                                                                                          function firstCharLowerCase

                                                                                                                          firstCharLowerCase: (name: string) => string;

                                                                                                                            function normalize

                                                                                                                            normalize: (name: string) => string;

                                                                                                                              function parseBooleans

                                                                                                                              parseBooleans: (name: string) => boolean;

                                                                                                                                function parseNumbers

                                                                                                                                parseNumbers: (name: string) => number;

                                                                                                                                  function stripPrefix

                                                                                                                                  stripPrefix: (name: string) => string;

                                                                                                                                    Package Files (2)

                                                                                                                                    Dependencies (1)

                                                                                                                                    Dev Dependencies (0)

                                                                                                                                    No dev dependencies.

                                                                                                                                    Peer Dependencies (0)

                                                                                                                                    No peer dependencies.

                                                                                                                                    Badge

                                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/xml2js.

                                                                                                                                    • Markdown
                                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/xml2js)
                                                                                                                                    • HTML
                                                                                                                                      <a href="https://www.jsdocs.io/package/@types/xml2js"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>