-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
58 lines (48 loc) · 1.03 KB
/
types.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
import {ReactNode} from 'react';
export interface INote {
note_id: number,
name: string,
created: Date,
category_id: number,
content: string,
dates?: string,
archived: boolean,
category: ICategory,
}
export interface INoteToAddOrUpdate {
name: string,
category_id: number,
content: string
}
export interface ICategory {
category_id: number,
name: string
}
export interface IAppState {
notes: INote[],
categories: ICategory[]
}
interface IAction {
type: string,
}
export interface INoteAction extends IAction {
note: INote,
}
export interface ISetNotesAction extends IAction {
notes: INote[],
}
export interface ISetCategoriesAction extends IAction {
categories: ICategory[]
}
export interface ITableColumn<T> {
key: keyof T | string;
header?: string;
icon?: ReactNode;
onclick?: (item: T) => void
}
export interface Summary {
category: string,
active: number,
archived: number
}
export type DispatchType = (args: INoteAction) => INoteAction