diff options
author | Minteck <contact@minteck.org> | 2022-02-09 17:58:07 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-02-09 17:58:07 +0100 |
commit | 22a25ded9f7d9c9a96cce8d1bc12475ca0434201 (patch) | |
tree | 0e33d0650fe58f41c00bbc4b8047956905766823 /node_modules/cheerio/lib/load.d.ts | |
parent | 8f54d903fb3470823a5e4d6ff4655de009836245 (diff) | |
download | youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.tar.gz youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.tar.bz2 youtoo-22a25ded9f7d9c9a96cce8d1bc12475ca0434201.zip |
Major update
Diffstat (limited to 'node_modules/cheerio/lib/load.d.ts')
-rw-r--r-- | node_modules/cheerio/lib/load.d.ts | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/node_modules/cheerio/lib/load.d.ts b/node_modules/cheerio/lib/load.d.ts new file mode 100644 index 0000000..0dbc24f --- /dev/null +++ b/node_modules/cheerio/lib/load.d.ts @@ -0,0 +1,73 @@ +/// <reference types="node" /> +import { CheerioOptions, InternalOptions } from './options'; +import * as staticMethods from './static'; +import { Cheerio } from './cheerio'; +import type { Node, Document, Element } from 'domhandler'; +import type * as Load from './load'; +import { SelectorType, BasicAcceptedElems } from './types'; +declare type StaticType = typeof staticMethods; +declare type LoadType = typeof Load; +/** + * A querying function, bound to a document created from the provided markup. + * + * Also provides several helper methods for dealing with the document as a whole. + */ +export interface CheerioAPI extends StaticType, LoadType { + /** + * This selector method is the starting point for traversing and manipulating + * the document. Like jQuery, it's the primary method for selecting elements + * in the document. + * + * `selector` searches within the `context` scope which searches within the + * `root` scope. + * + * @example + * + * ```js + * $('.apple', '#fruits').text(); + * //=> Apple + * + * $('ul .pear').attr('class'); + * //=> pear + * + * $('li[class=orange]').html(); + * //=> Orange + * ``` + * + * @param selector - Either a selector to look for within the document, or the + * contents of a new Cheerio instance. + * @param context - Either a selector to look for within the root, or the + * contents of the document to query. + * @param root - Optional HTML document string. + */ + <T extends Node, S extends string>(selector?: S | BasicAcceptedElems<T>, context?: BasicAcceptedElems<Node> | null, root?: BasicAcceptedElems<Document>, options?: CheerioOptions): Cheerio<S extends SelectorType ? Element : T>; + /** + * The root the document was originally loaded with. + * + * @private + */ + _root: Document; + /** + * The options the document was originally loaded with. + * + * @private + */ + _options: InternalOptions; + /** Mimic jQuery's prototype alias for plugin authors. */ + fn: typeof Cheerio.prototype; +} +/** + * Create a querying function, bound to a document created from the provided + * markup. Note that similar to web browser contexts, this operation may + * introduce `<html>`, `<head>`, and `<body>` elements; set `isDocument` to + * `false` to switch to fragment mode and disable this. + * + * @param content - Markup to be loaded. + * @param options - Options for the created instance. + * @param isDocument - Allows parser to be switched to fragment mode. + * @returns The loaded document. + * @see {@link https://cheerio.js.org#loading} for additional usage information. + */ +export declare function load(content: string | Node | Node[] | Buffer, options?: CheerioOptions | null, isDocument?: boolean): CheerioAPI; +export {}; +//# sourceMappingURL=load.d.ts.map
\ No newline at end of file |