diff --git a/types/sax/index.d.ts b/types/sax/index.d.ts index 1e0c53c381..08d4d81d1b 100644 --- a/types/sax/index.d.ts +++ b/types/sax/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Vincent Siao (Asana, Inc.) // Evert Pot // Daniel Cassidy +// Fabian van der Veen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -63,7 +64,7 @@ export class SAXParser { closed: boolean; strict: boolean; opt: SAXOptions; - tag: string; + tag: Tag; ENTITIES: {[key: string]: string}; // Events diff --git a/types/sax/sax-tests.ts b/types/sax/sax-tests.ts index 27ed1a6506..11ffaeafae 100644 --- a/types/sax/sax-tests.ts +++ b/types/sax/sax-tests.ts @@ -140,7 +140,9 @@ import fs = require("fs"); const attrValue: string = tag.attributes["name"]; }; - parser.onattribute = (attr: { name: string; value: string; }) => {}; + parser.onattribute = (attr: { name: string; value: string; }) => { + const tag: sax.Tag = parser.tag; + }; parser.onend = () => {};