-
Notifications
You must be signed in to change notification settings - Fork 0
/
cons.ts
61 lines (54 loc) · 1.23 KB
/
cons.ts
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
export type ToDoItem = {
text: string
completed: boolean
editing: boolean
}
export type ValidInput = {
text: string
type: 'valid'
}
export type TrimInput = {
text: string
type: 'trim'
}
export type WhiteSpaceInput = {
text: string
type: 'whitespace'
}
export type EmptyInput = {
text: string
type: 'empty'
}
export type Model = {
input: ValidInput | TrimInput | WhiteSpaceInput | EmptyInput,
toDos: ToDoItem[]
completeAll: boolean
filter: 'all' | 'active' | 'completed',
navigation: Model['filter'][]
};
export const STATIC = {
VALID: 'valid',
TRIM: 'trim',
WHITESPACE: 'whitespace',
EMPTY: 'empty',
ALL: 'all',
ACTIVE: 'active',
COMPLETED: 'completed'
} as const
export const CLASS_SELECTORS = {
NEW_TODO: '.new-todo',
TODO_LIST: '.todo-list',
TODO_ITEMS: '.todo-list li',
TODO_ITEMS_INPUT: '.todo-list li .toggle',
TODO_ITEMS_VISIBLE: '.todo-list li:visible',
TODO_ITEMS_LABEL: '.todo-list li label',
COUNT: 'span.todo-count',
MAIN: '.main',
FOOTER: '.footer',
TOGGLE_ALL: '.toggle-all',
// TOGGLE_ALL: 'label[for="toggle-all"]',
TOGGLE_ALL_LABEL: 'label[for="toggle-all"]',
CLEAR_COMPLETED: '.clear-completed',
FILTERS: '.filters',
FILTER_ITEMS: '.filters li a'
} as const