-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
38 lines (36 loc) · 1.01 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Types for `jsr:@dbushell/xml-streamify`.
*
* @module
*/
/** Options for `parse` async generator function */
export interface ParseOptions {
/** Abort signal for fetch and parser */
signal?: AbortSignal;
/** Suppress fetch and parse errors (default: true) */
silent?: boolean;
/** Do not yield empty text nodes (default: true) */
ignoreWhitespace?: boolean;
/** Do not yield comment nodes (default: true) */
ignoreComments?: boolean;
/** Do not yield declaration nodes (default: true) */
ignoreDeclaration?: boolean;
/** Do not yield doctype nodes (default: true) */
ignoreDoctype?: boolean;
/** Addition fetch options */
fetchOptions?: RequestInit;
}
/** Node type that is yielded by the parse generator function */
export enum NodeType {
CDATA = 'cdata',
COMMENT = 'comment',
DECLARATION = 'declaration',
DOCTYPE = 'doctype',
ELEMENT = 'element',
TEXT = 'text'
}
/** Current state of the internal stream transformer */
export enum StateType {
SEARCH = 'search',
SKIP = 'skip'
}