123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- import type { Node, Element } from 'domhandler';
- import type { Cheerio } from '../cheerio';
- export declare function attr<T extends Node>(this: Cheerio<T>, name: string): string | undefined;
- export declare function attr<T extends Node>(this: Cheerio<T>): Record<string, string>;
- export declare function attr<T extends Node>(this: Cheerio<T>, name: string, value?: string | null | ((this: Element, i: number, attrib: string) => string | null)): Cheerio<T>;
- export declare function attr<T extends Node>(this: Cheerio<T>, values: Record<string, string | null>): Cheerio<T>;
- interface StyleProp {
- length: number;
- [key: string]: string | number;
- [index: number]: string;
- }
- export declare function prop<T extends Node>(this: Cheerio<T>, name: 'tagName' | 'nodeName'): T extends Element ? string : undefined;
- export declare function prop<T extends Node>(this: Cheerio<T>, name: 'innerHTML' | 'outerHTML'): string | null;
- export declare function prop<T extends Node>(this: Cheerio<T>, name: 'style'): StyleProp;
- export declare function prop<T extends Node, K extends keyof Element>(this: Cheerio<T>, name: K): Element[K];
- export declare function prop<T extends Node, K extends keyof Element>(this: Cheerio<T>, name: K, value: Element[K] | ((this: Element, i: number, prop: K) => Element[keyof Element])): Cheerio<T>;
- export declare function prop<T extends Node>(this: Cheerio<T>, name: Record<string, string | Element[keyof Element] | boolean>): Cheerio<T>;
- export declare function prop<T extends Node>(this: Cheerio<T>, name: string, value: string | boolean | null | ((this: Element, i: number, prop: string) => string | boolean)): Cheerio<T>;
- export declare function prop<T extends Node>(this: Cheerio<T>, name: string): string;
- export declare function data<T extends Node>(this: Cheerio<T>, name: string): unknown | undefined;
- export declare function data<T extends Node>(this: Cheerio<T>): Record<string, unknown>;
- export declare function data<T extends Node>(this: Cheerio<T>, name: string, value: unknown): Cheerio<T>;
- export declare function data<T extends Node>(this: Cheerio<T>, values: Record<string, unknown>): Cheerio<T>;
- export declare function val<T extends Node>(this: Cheerio<T>): string | undefined | string[];
- export declare function val<T extends Node>(this: Cheerio<T>, value: string | string[]): Cheerio<T>;
- export declare function removeAttr<T extends Node>(this: Cheerio<T>, name: string): Cheerio<T>;
- export declare function hasClass<T extends Node>(this: Cheerio<T>, className: string): boolean;
- export declare function addClass<T extends Node, R extends ArrayLike<T>>(this: R, value?: string | ((this: Element, i: number, className: string) => string | undefined)): R;
- export declare function removeClass<T extends Node, R extends ArrayLike<T>>(this: R, name?: string | ((this: Element, i: number, className: string) => string | undefined)): R;
- export declare function toggleClass<T extends Node, R extends ArrayLike<T>>(this: R, value?: string | ((this: Element, i: number, className: string, stateVal?: boolean) => string), stateVal?: boolean): R;
- export {};
|