🤖 Merge PR #45905 fix(cheerio): xml() to accept dom parameter by @privatenumber

* fix(cheerio): xml() to accept Cheerio parameter

* refactor(cheerio): used union type

* docs(cheerio): added name

* docs: removed trevorhreed
This commit is contained in:
hiroki 2020-07-08 00:07:19 -04:00 committed by GitHub
parent 201779301e
commit 3e0007a3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -306,6 +306,7 @@ $el.css('width', '50px');
$.html();
$.html('.class');
$.xml();
$.xml($el);
/**
* Miscellaneous

View File

@ -8,6 +8,7 @@
// Chennakrishna <https://github.com/chennakrishna8>
// AzSiAz <https://github.com/AzSiAz>
// Ryo Ota <https://github.com/nwtgck>
// Hiroki Osame <https://github.com/privatenumber>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@ -258,15 +259,14 @@ interface CheerioStatic extends CheerioSelector {
// Document References
// Cheerio https://github.com/cheeriojs/cheerio
// JQuery http://api.jquery.com
xml(): string;
root(): Cheerio;
contains(container: CheerioElement, contained: CheerioElement): boolean;
parseHTML(data: string, context?: Document, keepScripts?: boolean): Document[];
html(options?: CheerioOptionsInterface): string;
html(selector: string, options?: CheerioOptionsInterface): string;
html(element: Cheerio, options?: CheerioOptionsInterface): string;
html(element: CheerioElement, options?: CheerioOptionsInterface): string;
html(dom: string | Cheerio | CheerioElement, options?: CheerioOptionsInterface): string;
xml(dom?: string | Cheerio | CheerioElement): string;
}
interface CheerioElement {