1 | import type { InternalOptions } from './options.js';
|
2 | import type { AnyNode, Document, ParentNode } from 'domhandler';
|
3 | import type { BasicAcceptedElems } from './types.js';
|
4 | import * as Attributes from './api/attributes.js';
|
5 | import * as Traversing from './api/traversing.js';
|
6 | import * as Manipulation from './api/manipulation.js';
|
7 | import * as Css from './api/css.js';
|
8 | import * as Forms from './api/forms.js';
|
9 | import * as Extract from './api/extract.js';
|
10 | type MethodsType = typeof Attributes & typeof Traversing & typeof Manipulation & typeof Css & typeof Forms & typeof Extract;
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare abstract class Cheerio<T> implements ArrayLike<T> {
|
31 | length: number;
|
32 | [index: number]: T;
|
33 | options: InternalOptions;
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | _root: Cheerio<Document> | null;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | constructor(elements: ArrayLike<T> | undefined, root: Cheerio<Document> | null, options: InternalOptions);
|
51 | prevObject: Cheerio<any> | undefined;
|
52 | /**
|
53 | * Make a cheerio object.
|
54 | *
|
55 | * @private
|
56 | * @param dom - The contents of the new object.
|
57 | * @param context - The context of the new object.
|
58 | * @returns The new cheerio object.
|
59 | */
|
60 | abstract _make<T>(dom: ArrayLike<T> | T | string, context?: BasicAcceptedElems<AnyNode>): Cheerio<T>;
|
61 | /**
|
62 | * Parses some content.
|
63 | *
|
64 | * @private
|
65 | * @param content - Content to parse.
|
66 | * @param options - Options for parsing.
|
67 | * @param isDocument - Allows parser to be switched to fragment mode.
|
68 | * @returns A document containing the `content`.
|
69 | */
|
70 | abstract _parse(content: string | Document | AnyNode | AnyNode[] | Buffer, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document;
|
71 | /**
|
72 | * Render an element or a set of elements.
|
73 | *
|
74 | * @private
|
75 | * @param dom - DOM to render.
|
76 | * @returns The rendered DOM.
|
77 | */
|
78 | abstract _render(dom: AnyNode | ArrayLike<AnyNode>): string;
|
79 | }
|
80 | export interface Cheerio<T> extends MethodsType, Iterable<T> {
|
81 | cheerio: '[cheerio object]';
|
82 | splice: typeof Array.prototype.splice;
|
83 | }
|
84 | export {};
|
85 |
|
\ | No newline at end of file |