-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelement_classes.d.ts
More file actions
35 lines (29 loc) · 1.58 KB
/
Copy pathelement_classes.d.ts
File metadata and controls
35 lines (29 loc) · 1.58 KB
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
declare class ElementClasses {
/** One of the elements must have the given class */
one(name: string): ElementClasses;
/** One of the elements must have the given class */
exactlyOne(name: string): ElementClasses;
/** At least one of the elements must have the given class */
atLeastOne(name: string): ElementClasses;
/** At most one of the elements must have the given class */
atMostOne(name: string): ElementClasses;
/** A number of elements between the given min and max must have the given class */
between(min: number, max: number, name: string): ElementClasses;
/** Each element must have one of the given classes */
each(...names: string[]): ElementClasses;
/** Each element must have one of the given classes */
eachExactlyOne(...names: string[]): ElementClasses;
/** Each element must have at least one of the given classes */
eachAtLeastOne(...names: string[]): ElementClasses;
/** Each element must have at most one of the given classes */
eachAtMostOne(...names: string[]): ElementClasses;
/** Each element must have a number of given classes between the given min and max */
eachBetween(min: number, max: number, ...names: string[]): ElementClasses;
}
/**
* Define constraints that should be applied to the classes of a collection of elements.
*
* @param {string | Element[] | NodeList} elements - Selector string or array of elements.
* @returns {ElementClasses} Instance of ElementClasses to define the constraints.
*/
declare function element_classes(elements: string | Element[] | NodeList): ElementClasses;