10
10
* ```
11
11
* Event subscriptions can be updated between write operations.
12
12
*
13
- * Note that minimizing the numnber of events will have a
14
- * slight performance improvement which becomes more noticable
13
+ * Note that minimizing the number of events will have a
14
+ * slight performance improvement which becomes more noticeable
15
15
* on very large documents.
16
16
*/
17
17
export declare enum SaxEventType {
18
18
Text = 1 ,
19
19
ProcessingInstruction = 2 ,
20
- SGMLDeclaration = 4 ,
20
+ Declaration = 4 ,
21
21
Doctype = 8 ,
22
22
Comment = 16 ,
23
23
OpenTagStart = 32 ,
@@ -29,7 +29,7 @@ export declare enum SaxEventType {
29
29
/**
30
30
* Represents the detail of a SAX event.
31
31
*/
32
- export type Detail = Position | Attribute | Text | Tag | ProcInst ;
32
+ export type Detail = Attribute | Text | Tag | ProcInst ;
33
33
/**
34
34
* Abstract class for decoding SAX event data.
35
35
*
@@ -67,7 +67,7 @@ export declare abstract class Reader<T = Detail> {
67
67
* **Note** This method has a very small performance
68
68
* cost and should be used judiciously on large documents.
69
69
*/
70
- abstract toBoxed ( ) : void ;
70
+ abstract toBoxed ( ) : this ;
71
71
/**
72
72
* Converts the reader data to a JSON object.
73
73
*
@@ -120,7 +120,7 @@ export declare class Attribute extends Reader<Text | AttributeType> {
120
120
/**
121
121
* @inheritdoc
122
122
*/
123
- toBoxed ( ) : void ;
123
+ toBoxed ( ) : this ;
124
124
/**
125
125
* @inheritDoc
126
126
*/
@@ -161,14 +161,14 @@ export declare class Attribute extends Reader<Text | AttributeType> {
161
161
* * `ptr` - The initial pointer position.
162
162
*/
163
163
export declare class ProcInst extends Reader < Position | Text > {
164
- static LENGTH : 80 ;
164
+ static LENGTH : 88 ;
165
165
target : Text ;
166
166
content : Text ;
167
167
constructor ( data : Uint8Array , memory : WebAssembly . Memory ) ;
168
168
/**
169
169
* @inheritdoc
170
170
*/
171
- toBoxed ( ) : void ;
171
+ toBoxed ( ) : this ;
172
172
/**
173
173
* Gets the start position of the processing instruction.
174
174
*
@@ -217,7 +217,7 @@ export declare class Text extends Reader<string | Position> {
217
217
/**
218
218
* @inheritdoc
219
219
*/
220
- toBoxed ( ) : void ;
220
+ toBoxed ( ) : this ;
221
221
/**
222
222
* Gets the value of the text node.
223
223
*
@@ -251,7 +251,7 @@ export declare class Tag extends Reader<Attribute[] | Text[] | Position | string
251
251
/**
252
252
* @inheritdoc
253
253
*/
254
- toBoxed ( ) : void ;
254
+ toBoxed ( ) : this ;
255
255
/**
256
256
* Gets the start position of the tag opening.
257
257
*
@@ -328,6 +328,8 @@ export declare class SAXParser {
328
328
events ?: number ;
329
329
wasmSaxParser ?: WasmSaxParser ;
330
330
eventHandler ?: ( type : SaxEventType , detail : Detail ) => void ;
331
+ private createDetailConstructor ;
332
+ private eventToDetailConstructor ;
331
333
private writeBuffer ?;
332
334
constructor ( events ?: number ) ;
333
335
/**
@@ -475,7 +477,7 @@ export declare class SAXParser {
475
477
* })();
476
478
* ```
477
479
*
478
- * @param saxWasm Uint8Array contaning the WASM or a promise that will resolve to it.
480
+ * @param saxWasm Uint8Array containing the WASM or a promise that will resolve to it.
479
481
*/
480
482
prepareWasm ( saxWasm : Response | Promise < Response > ) : Promise < boolean > ;
481
483
prepareWasm ( saxWasm : Uint8Array ) : Promise < boolean > ;
0 commit comments