UNPKG

2 kBTypeScriptView Raw
1export declare type Selector = PseudoSelector | PseudoElement | AttributeSelector | TagSelector | UniversalSelector | Traversal;
2export declare enum SelectorType {
3 Attribute = "attribute",
4 Pseudo = "pseudo",
5 PseudoElement = "pseudo-element",
6 Tag = "tag",
7 Universal = "universal",
8 Adjacent = "adjacent",
9 Child = "child",
10 Descendant = "descendant",
11 Parent = "parent",
12 Sibling = "sibling",
13 ColumnCombinator = "column-combinator"
14}
15/**
16 * Modes for ignore case.
17 *
18 * This could be updated to an enum, and the object is
19 * the current stand-in that will allow code to be updated
20 * without big changes.
21 */
22export declare const IgnoreCaseMode: {
23 readonly Unknown: null;
24 readonly QuirksMode: "quirks";
25 readonly IgnoreCase: true;
26 readonly CaseSensitive: false;
27};
28export interface AttributeSelector {
29 type: SelectorType.Attribute;
30 name: string;
31 action: AttributeAction;
32 value: string;
33 ignoreCase: "quirks" | boolean | null;
34 namespace: string | null;
35}
36export declare type DataType = Selector[][] | null | string;
37export interface PseudoSelector {
38 type: SelectorType.Pseudo;
39 name: string;
40 data: DataType;
41}
42export interface PseudoElement {
43 type: SelectorType.PseudoElement;
44 name: string;
45 data: string | null;
46}
47export interface TagSelector {
48 type: SelectorType.Tag;
49 name: string;
50 namespace: string | null;
51}
52export interface UniversalSelector {
53 type: SelectorType.Universal;
54 namespace: string | null;
55}
56export interface Traversal {
57 type: TraversalType;
58}
59export declare enum AttributeAction {
60 Any = "any",
61 Element = "element",
62 End = "end",
63 Equals = "equals",
64 Exists = "exists",
65 Hyphen = "hyphen",
66 Not = "not",
67 Start = "start"
68}
69export declare type TraversalType = SelectorType.Adjacent | SelectorType.Child | SelectorType.Descendant | SelectorType.Parent | SelectorType.Sibling | SelectorType.ColumnCombinator;
70//# sourceMappingURL=types.d.ts.map
\No newline at end of file