@types/xml2js

  • Version 0.4.14
  • Published
  • 7 kB
  • 1 dependency
  • MIT license

Install

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

Overview

TypeScript definitions for xml2js

Index

Variables

variable defaults

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

    Functions

    function parseString

    parseString: {
    (
    str: convertableToString,
    callback: (err: Error | null, 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?: (error: Error | null, result: any) => void
                  ) => void;

                    method parseStringPromise

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

                      method reset

                      reset: () => void;

                        class ValidationError

                        class ValidationError extends Error {}

                          constructor

                          constructor(message: string);

                            Interfaces

                            interface BuilderOptions

                            interface BuilderOptions {}

                              property allowSurrogateChars

                              allowSurrogateChars?: boolean | undefined;

                                property attrkey

                                attrkey?: string | undefined;

                                  property cdata

                                  cdata?: boolean | undefined;

                                    property charkey

                                    charkey?: string | undefined;

                                      property doctype

                                      doctype?: any;

                                        property headless

                                        headless?: boolean | undefined;

                                          property renderOpts

                                          renderOpts?: RenderOptions | undefined;

                                            property rootName

                                            rootName?: string | undefined;

                                              property xmldec

                                              xmldec?: XmlDeclarationAttributes | undefined;

                                                interface convertableToString

                                                interface convertableToString {}

                                                  method toString

                                                  toString: () => string;

                                                    interface ParserOptions

                                                    interface ParserOptions {}

                                                      property async

                                                      async?: boolean | undefined;

                                                        property attrkey

                                                        attrkey?: string | undefined;

                                                          property attrNameProcessors

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

                                                            property attrValueProcessors

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

                                                              property charkey

                                                              charkey?: string | undefined;

                                                                property charsAsChildren

                                                                charsAsChildren?: boolean | undefined;

                                                                  property childkey

                                                                  childkey?: string | undefined;

                                                                    property chunkSize

                                                                    chunkSize?: number | undefined;

                                                                      property emptyTag

                                                                      emptyTag?: (() => any) | string;

                                                                        property explicitArray

                                                                        explicitArray?: boolean | undefined;

                                                                          property explicitCharkey

                                                                          explicitCharkey?: boolean | undefined;

                                                                            property explicitChildren

                                                                            explicitChildren?: boolean | undefined;

                                                                              property explicitRoot

                                                                              explicitRoot?: boolean | undefined;

                                                                                property ignoreAttrs

                                                                                ignoreAttrs?: boolean | undefined;

                                                                                  property includeWhiteChars

                                                                                  includeWhiteChars?: boolean | undefined;

                                                                                    property mergeAttrs

                                                                                    mergeAttrs?: boolean | undefined;

                                                                                      property normalize

                                                                                      normalize?: boolean | undefined;

                                                                                        property normalizeTags

                                                                                        normalizeTags?: boolean | undefined;

                                                                                          property preserveChildrenOrder

                                                                                          preserveChildrenOrder?: boolean | undefined;

                                                                                            property strict

                                                                                            strict?: boolean | undefined;

                                                                                              property tagNameProcessors

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

                                                                                                property trim

                                                                                                trim?: boolean | undefined;

                                                                                                  property validator

                                                                                                  validator?: Function | undefined;

                                                                                                    property valueProcessors

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

                                                                                                      property xmlns

                                                                                                      xmlns?: boolean | undefined;

                                                                                                        interface RenderOptions

                                                                                                        interface RenderOptions {}

                                                                                                          property indent

                                                                                                          indent?: string | undefined;

                                                                                                            property newline

                                                                                                            newline?: string | undefined;

                                                                                                              property pretty

                                                                                                              pretty?: boolean | undefined;

                                                                                                                interface XmlDeclarationAttributes

                                                                                                                interface XmlDeclarationAttributes {}

                                                                                                                  property encoding

                                                                                                                  encoding?: string | undefined;

                                                                                                                    property standalone

                                                                                                                    standalone?: boolean | undefined;

                                                                                                                      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>