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