@@ -16,41 +16,41 @@ export type Selector =
16
16
| UniversalSelector
17
17
| Traversal ;
18
18
19
- interface AttributeSelector {
19
+ export interface AttributeSelector {
20
20
type : "attribute" ;
21
21
name : string ;
22
- action : Action ;
22
+ action : AttributeAction ;
23
23
value : string ;
24
24
ignoreCase : boolean ;
25
25
}
26
26
27
27
type DataType = Selector [ ] [ ] | null | string ;
28
28
29
- interface PseudoSelector {
29
+ export interface PseudoSelector {
30
30
type : "pseudo" ;
31
31
name : string ;
32
32
data : DataType ;
33
33
}
34
34
35
- interface PseudoElement {
35
+ export interface PseudoElement {
36
36
type : "pseudo-element" ;
37
37
name : string ;
38
38
}
39
39
40
- interface TagSelector {
40
+ export interface TagSelector {
41
41
type : "tag" ;
42
42
name : string ;
43
43
}
44
44
45
- interface UniversalSelector {
45
+ export interface UniversalSelector {
46
46
type : "universal" ;
47
47
}
48
48
49
- interface Traversal {
49
+ export interface Traversal {
50
50
type : TraversalType ;
51
51
}
52
52
53
- type Action =
53
+ export type AttributeAction =
54
54
| "any"
55
55
| "element"
56
56
| "end"
@@ -60,14 +60,19 @@ type Action =
60
60
| "not"
61
61
| "start" ;
62
62
63
- type TraversalType = "adjacent" | "child" | "descendant" | "parent" | "sibling" ;
63
+ export type TraversalType =
64
+ | "adjacent"
65
+ | "child"
66
+ | "descendant"
67
+ | "parent"
68
+ | "sibling" ;
64
69
65
70
const reName = / ^ (?: \\ .| [ \w \- \u00b0 - \uFFFF ] ) + / ,
66
71
reEscape = / \\ ( [ \d a - f ] { 1 , 6 } \s ? | ( \s ) | .) / gi,
67
72
//modified version of https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L87
68
73
reAttr = / ^ \s * ( (?: \\ .| [ \w \u00b0 - \uFFFF - ] ) + ) \s * (?: ( \S ? ) = \s * (?: ( [ ' " ] ) ( [ ^ ] * ?) \3| ( # ? (?: \\ .| [ \w \u00b0 - \uFFFF - ] ) * ) | ) | ) \s * ( i ) ? \] / ;
69
74
70
- const actionTypes : { [ key : string ] : Action } = {
75
+ const actionTypes : { [ key : string ] : AttributeAction } = {
71
76
undefined : "exists" ,
72
77
"" : "equals" ,
73
78
"~" : "element" ,
@@ -85,7 +90,7 @@ const Traversals: { [key: string]: TraversalType } = {
85
90
"+" : "adjacent"
86
91
} ;
87
92
88
- const attribSelectors : { [ key : string ] : [ string , Action ] } = {
93
+ const attribSelectors : { [ key : string ] : [ string , AttributeAction ] } = {
89
94
"#" : [ "id" , "equals" ] ,
90
95
"." : [ "class" , "element" ]
91
96
} ;
0 commit comments