aboutsummaryrefslogtreecommitdiff
path: root/node_modules/cheerio/lib/api/forms.d.ts
blob: 32f87392d07f40f5a6d0cdf052cb2291a1501c8e (plain)
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
import type { Node } from 'domhandler';
import type { Cheerio } from '../cheerio';
/**
 * Encode a set of form elements as a string for submission.
 *
 * @category Forms
 * @returns The serialized form.
 * @see {@link https://api.jquery.com/serialize/}
 */
export declare function serialize<T extends Node>(this: Cheerio<T>): string;
interface SerializedField {
    name: string;
    value: string;
}
/**
 * Encode a set of form elements as an array of names and values.
 *
 * @category Forms
 * @example
 *
 * ```js
 * $('<form><input name="foo" value="bar" /></form>').serializeArray();
 * //=> [ { name: 'foo', value: 'bar' } ]
 * ```
 *
 * @returns The serialized form.
 * @see {@link https://api.jquery.com/serializeArray/}
 */
export declare function serializeArray<T extends Node>(this: Cheerio<T>): SerializedField[];
export {};
//# sourceMappingURL=forms.d.ts.map