forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheerio.d.ts
81 lines (56 loc) · 2.01 KB
/
cheerio.d.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Type definitions for Cheerio
// Project: https://github.com/MatthewMueller/cheerio
// Definitions by: Bret Little <https://github.com/blittle>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Cheerio {
addClass(classNames: string): Cheerio;
hasClass(className: string): boolean;
removeClass(className?: any): Cheerio;
attr(attributeName: string, value: any): Cheerio;
attr(attributeName: string): string;
removeAttr(attributeName: any): Cheerio;
find(selector: string): Cheerio;
parent(): Cheerio;
next(): Cheerio;
prev(): Cheerio;
siblings(): Cheerio;
children(selector?: any): Cheerio;
each(func: (index: any, elem: any) => Cheerio);
map(callback: (index: any, domElement: Element) =>any): Cheerio;
filter(selector: string): Cheerio;
filter(func: (index: any) =>any): Cheerio;
first(): Cheerio;
last(): Cheerio;
eq(index: number): Cheerio;
append(...content: any[]): Cheerio;
prepend(...content: any[]): Cheerio;
after(...content: any[]): Cheerio;
before(...content: any[]): Cheerio;
remove(selector: string): Cheerio;
replaceWith(content: string): Cheerio;
empty(): Cheerio;
html(htmlString: string): Cheerio;
html(): string;
text(textString: string): Cheerio;
text(): string;
toArray(): any[];
clone() : Cheerio;
root() : Cheerio;
dom(): any;
contains(container: Element, contained: Element): boolean;
isArray(obj: any): boolean;
inArray(value: any, array: any[], fromIndex?: number): number;
merge(first: any[], second: any[]): any[];
}
interface CheerioOptionsInterface {
ignoreWhitespace?: boolean;
xmlMode?: boolean;
lowerCaseTags?: boolean;
}
interface CheerioStatic {
(...selectors: any[]): Cheerio;
(): Cheerio;
}
declare module "cheerio" {
export function load (html : string, options?: CheerioOptionsInterface) : CheerioStatic;
}