Skip to content

Commit 995b5d2

Browse files
committed
updated unit tests
1 parent dc793c6 commit 995b5d2

18 files changed

+165
-165
lines changed

lib/cjs/saxWasm.d.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
* ```
1111
* Event subscriptions can be updated between write operations.
1212
*
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
1515
* on very large documents.
1616
*/
1717
export declare enum SaxEventType {
1818
Text = 1,
1919
ProcessingInstruction = 2,
20-
SGMLDeclaration = 4,
20+
Declaration = 4,
2121
Doctype = 8,
2222
Comment = 16,
2323
OpenTagStart = 32,
@@ -29,7 +29,7 @@ export declare enum SaxEventType {
2929
/**
3030
* Represents the detail of a SAX event.
3131
*/
32-
export type Detail = Position | Attribute | Text | Tag | ProcInst;
32+
export type Detail = Attribute | Text | Tag | ProcInst;
3333
/**
3434
* Abstract class for decoding SAX event data.
3535
*
@@ -67,7 +67,7 @@ export declare abstract class Reader<T = Detail> {
6767
* **Note** This method has a very small performance
6868
* cost and should be used judiciously on large documents.
6969
*/
70-
abstract toBoxed(): void;
70+
abstract toBoxed(): this;
7171
/**
7272
* Converts the reader data to a JSON object.
7373
*
@@ -120,7 +120,7 @@ export declare class Attribute extends Reader<Text | AttributeType> {
120120
/**
121121
* @inheritdoc
122122
*/
123-
toBoxed(): void;
123+
toBoxed(): this;
124124
/**
125125
* @inheritDoc
126126
*/
@@ -161,14 +161,14 @@ export declare class Attribute extends Reader<Text | AttributeType> {
161161
* * `ptr` - The initial pointer position.
162162
*/
163163
export declare class ProcInst extends Reader<Position | Text> {
164-
static LENGTH: 80;
164+
static LENGTH: 88;
165165
target: Text;
166166
content: Text;
167167
constructor(data: Uint8Array, memory: WebAssembly.Memory);
168168
/**
169169
* @inheritdoc
170170
*/
171-
toBoxed(): void;
171+
toBoxed(): this;
172172
/**
173173
* Gets the start position of the processing instruction.
174174
*
@@ -217,7 +217,7 @@ export declare class Text extends Reader<string | Position> {
217217
/**
218218
* @inheritdoc
219219
*/
220-
toBoxed(): void;
220+
toBoxed(): this;
221221
/**
222222
* Gets the value of the text node.
223223
*
@@ -251,7 +251,7 @@ export declare class Tag extends Reader<Attribute[] | Text[] | Position | string
251251
/**
252252
* @inheritdoc
253253
*/
254-
toBoxed(): void;
254+
toBoxed(): this;
255255
/**
256256
* Gets the start position of the tag opening.
257257
*
@@ -328,6 +328,8 @@ export declare class SAXParser {
328328
events?: number;
329329
wasmSaxParser?: WasmSaxParser;
330330
eventHandler?: (type: SaxEventType, detail: Detail) => void;
331+
private createDetailConstructor;
332+
private eventToDetailConstructor;
331333
private writeBuffer?;
332334
constructor(events?: number);
333335
/**
@@ -475,7 +477,7 @@ export declare class SAXParser {
475477
* })();
476478
* ```
477479
*
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.
479481
*/
480482
prepareWasm(saxWasm: Response | Promise<Response>): Promise<boolean>;
481483
prepareWasm(saxWasm: Uint8Array): Promise<boolean>;

lib/cjs/saxWasm.js

+34-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)