@types/sax

  • Version 1.2.7
  • Published
  • 6.97 kB
  • 1 dependency
  • MIT license

Install

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

Overview

TypeScript definitions for sax

Index

Variables

variable EVENTS

const EVENTS: string[];

    Functions

    function createStream

    createStream: (strict?: boolean, opt?: SAXOptions) => SAXStream;

      function parser

      parser: (strict?: boolean, opt?: SAXOptions) => SAXParser;

        Classes

        class SAXParser

        class SAXParser {}

          constructor

          constructor(strict?: boolean, opt?: SAXOptions);

            property closed

            closed: boolean;

              property column

              column: number;

                property ENTITIES

                ENTITIES: { [key: string]: string };

                  property error

                  error: Error;

                    property line

                    line: number;

                      property opt

                      opt: SAXOptions;

                        property position

                        position: number;

                          property startTagPosition

                          startTagPosition: number;

                            property strict

                            strict: boolean;

                              property tag

                              tag: Tag;

                                method close

                                close: () => SAXParser;

                                  method end

                                  end: () => void;

                                    method flush

                                    flush: () => void;

                                      method onattribute

                                      onattribute: (attr: { name: string; value: string }) => void;

                                        method oncdata

                                        oncdata: (cdata: string) => void;

                                          method onclosecdata

                                          onclosecdata: () => void;

                                            method onclosenamespace

                                            onclosenamespace: (ns: { prefix: string; uri: string }) => void;

                                              method onclosetag

                                              onclosetag: (tagName: string) => void;

                                                method oncomment

                                                oncomment: (comment: string) => void;

                                                  method ondoctype

                                                  ondoctype: (doctype: string) => void;

                                                    method onend

                                                    onend: () => void;

                                                      method onerror

                                                      onerror: (e: Error) => void;

                                                        method onopencdata

                                                        onopencdata: () => void;

                                                          method onopennamespace

                                                          onopennamespace: (ns: { prefix: string; uri: string }) => void;

                                                            method onopentag

                                                            onopentag: (tag: Tag | QualifiedTag) => void;

                                                              method onopentagstart

                                                              onopentagstart: (tag: Tag | QualifiedTag) => void;

                                                                method onprocessinginstruction

                                                                onprocessinginstruction: (node: { name: string; body: string }) => void;

                                                                  method onready

                                                                  onready: () => void;

                                                                    method onscript

                                                                    onscript: (script: string) => void;

                                                                      method onsgmldeclaration

                                                                      onsgmldeclaration: (sgmlDecl: string) => void;

                                                                        method ontext

                                                                        ontext: (t: string) => void;

                                                                          method resume

                                                                          resume: () => SAXParser;

                                                                            method write

                                                                            write: (s: string) => SAXParser;

                                                                              class SAXStream

                                                                              class SAXStream extends stream.Duplex {}

                                                                                constructor

                                                                                constructor(strict?: boolean, opt?: SAXOptions);

                                                                                  method on

                                                                                  on: {
                                                                                  (event: 'text', listener: (this: this, text: string) => void): this;
                                                                                  (event: 'doctype', listener: (this: this, doctype: string) => void): this;
                                                                                  (
                                                                                  event: 'processinginstruction',
                                                                                  listener: (this: this, node: { name: string; body: string }) => void
                                                                                  ): this;
                                                                                  (
                                                                                  event: 'sgmldeclaration',
                                                                                  listener: (this: this, sgmlDecl: string) => void
                                                                                  ): this;
                                                                                  (
                                                                                  event: 'opentag' | 'opentagstart',
                                                                                  listener: (this: this, tag: Tag | QualifiedTag) => void
                                                                                  ): this;
                                                                                  (event: 'closetag', listener: (this: this, tagName: string) => void): this;
                                                                                  (
                                                                                  event: 'attribute',
                                                                                  listener: (this: this, attr: { name: string; value: string }) => void
                                                                                  ): this;
                                                                                  (event: 'comment', listener: (this: this, comment: string) => void): this;
                                                                                  (
                                                                                  event:
                                                                                  | 'opencdata'
                                                                                  | 'closecdata'
                                                                                  | 'end'
                                                                                  | 'ready'
                                                                                  | 'close'
                                                                                  | 'readable'
                                                                                  | 'drain'
                                                                                  | 'finish',
                                                                                  listener: (this: this) => void
                                                                                  ): this;
                                                                                  (event: 'cdata', listener: (this: this, cdata: string) => void): this;
                                                                                  (
                                                                                  event: 'opennamespace' | 'closenamespace',
                                                                                  listener: (this: this, ns: { prefix: string; uri: string }) => void
                                                                                  ): this;
                                                                                  (event: 'script', listener: (this: this, script: string) => void): this;
                                                                                  (event: 'data', listener: (this: this, chunk: any) => void): this;
                                                                                  (event: 'error', listener: (this: this, err: Error) => void): this;
                                                                                  (
                                                                                  event: 'pipe' | 'unpipe',
                                                                                  listener: (this: this, src: stream.Readable) => void
                                                                                  ): this;
                                                                                  (
                                                                                  event: string | symbol,
                                                                                  listener: (this: this, ...args: any[]) => void
                                                                                  ): this;
                                                                                  };

                                                                                    Interfaces

                                                                                    interface BaseTag

                                                                                    interface BaseTag {}

                                                                                      property isSelfClosing

                                                                                      isSelfClosing: boolean;

                                                                                        property name

                                                                                        name: string;

                                                                                          interface QualifiedAttribute

                                                                                          interface QualifiedAttribute extends QualifiedName {}

                                                                                            property value

                                                                                            value: string;

                                                                                              interface QualifiedName

                                                                                              interface QualifiedName {}

                                                                                                property local

                                                                                                local: string;

                                                                                                  property name

                                                                                                  name: string;

                                                                                                    property prefix

                                                                                                    prefix: string;

                                                                                                      property uri

                                                                                                      uri: string;

                                                                                                        interface QualifiedTag

                                                                                                        interface QualifiedTag extends QualifiedName, BaseTag {}

                                                                                                          property attributes

                                                                                                          attributes: { [key: string]: QualifiedAttribute };

                                                                                                            property ns

                                                                                                            ns: { [key: string]: string };

                                                                                                              interface SAXOptions

                                                                                                              interface SAXOptions {}

                                                                                                                property lowercase

                                                                                                                lowercase?: boolean | undefined;

                                                                                                                  property normalize

                                                                                                                  normalize?: boolean | undefined;

                                                                                                                    property noscript

                                                                                                                    noscript?: boolean | undefined;

                                                                                                                      property position

                                                                                                                      position?: boolean | undefined;

                                                                                                                        property trim

                                                                                                                        trim?: boolean | undefined;

                                                                                                                          property xmlns

                                                                                                                          xmlns?: boolean | undefined;

                                                                                                                            interface Tag

                                                                                                                            interface Tag extends BaseTag {}

                                                                                                                              property attributes

                                                                                                                              attributes: { [key: string]: string };

                                                                                                                                Package Files (1)

                                                                                                                                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/sax.

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