Skip to content

Commit

Permalink
docs: fix obsolete information
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Jan 29, 2020
1 parent e82c175 commit 2ee0b65
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/saxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,39 +205,38 @@ const EVENT_NAME_TO_HANDLER_NAME: Record<EventName, string> = {
};

/**
* Event handler for text data. The default implementation is a no-op.
* Event handler for text data.
*
* @param text The text data encountered by the parser.
*
*/
export type TextHandler = (text: string) => void;

/**
* Event handler for processing instructions. The default implementation is a
* no-op.
* Event handler for processing instructions.
*
* @param data The target and body of the processing instruction.
*/
export type PIHandler = (data: { target: string; body: string }) => void;


/**
* Event handler for doctype. The default implementation is a no-op.
* Event handler for doctype.
*
* @param doctype The doctype contents.
*/
export type DoctypeHandler = (doctype: string) => void;

/**
* Event handler for comments. The default implementation is a no-op.
* Event handler for comments.
*
* @param comment The comment contents.
*/
export type CommentHandler = (comment: string) => void;

/**
* Event handler for the start of an open tag. This is called as soon as we
* have a tag name. The default implementation is a no-op.
* have a tag name.
*
* @param tag The tag.
*/
Expand All @@ -256,45 +255,42 @@ export type AttributeHandler<O> =

/**
* Event handler for an open tag. This is called when the open tag is
* complete. (We've encountered the ">" that ends the open tag.) The default
* implementation is a no-op.
* complete. (We've encountered the ">" that ends the open tag.)
*
* @param tag The tag.
*/
export type OpenTagHandler<O> = (tag: TagForOptions<O>) => void;

/**
* Event handler for a close tag. Note that for self-closing tags, this is
* called right after ``onopentag``. The default implementation is a no-op.
* called right after ``opentag``.
*
* @param tag The tag.
*/
export type CloseTagHandler<O> = (tag: TagForOptions<O>) => void;

/**
* Event handler for a CDATA section. This is called when ending the
* CDATA section. The default implementation is a no-op.
* CDATA section.
*
* @param cdata The contents of the CDATA section.
*/
export type CDataHandler = (cdata: string) => void;

/**
* Event handler for the stream end. This is called when the stream has been
* closed with ``close`` or by passing ``null`` to ``write``. The default
* implementation is a no-op.
* closed with ``close`` or by passing ``null`` to ``write``.
*/
export type EndHandler = () => void;

/**
* Event handler indicating parser readiness . This is called when the parser
* is ready to parse a new document. The default implementation is a no-op.
* is ready to parse a new document.
*/
export type ReadyHandler = () => void;

/**
* Event handler indicating an error. The default implementation throws the
* error. Override with a no-op handler if you don't want this.
* Event handler indicating an error.
*
* @param err The error that occurred.
*/
Expand Down

0 comments on commit 2ee0b65

Please sign in to comment.