UNPKG

657 BTypeScriptView Raw
1import { Fetch } from './types';
2type DOMParserConstructor = typeof DOMParser;
3export interface IParserOptions {
4 /**
5 * WHATWG-compatible `fetch` function.
6 */
7 fetch?: Fetch;
8 /**
9 * XML/HTML parser from string into DOM Document.
10 */
11 DOMParser?: DOMParserConstructor;
12}
13export declare class Parser {
14 private readonly fetch;
15 private readonly DOMParser;
16 constructor({ fetch, DOMParser }?: IParserOptions);
17 parse(resource: string): Promise<Document>;
18 parseFromString(xml: string): Document;
19 private checkDocument;
20 load(url: string): Promise<Document>;
21}
22export {};
23//# sourceMappingURL=Parser.d.ts.map
\No newline at end of file