-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
60 lines (51 loc) · 1.2 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
59
60
type RGB = `rgb(${number}, ${number}, ${number})`;
type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
type HEX = `#${string}`;
export type Color = RGB | RGBA | HEX;
export type Theme = {
primary: Color;
secondary: Color;
background: Color;
navborder: Color;
navbackground: Color;
};
export type ImageProps = {
src?: string;
alt?: string;
};
//Link for navigation component
export type NavLink = {
link: string;
displayName: string;
};
//DataTable column
export type Column = {
field: string;
title: string;
filter?: ((input: string) => string);
};
//Text inside of the Dialog
export interface DialogText {
title?: string;
message?: string;
cancelButton?: string;
confirmButton?: string;
}
//Config of the dialog including text and callback
export interface DialogConfig extends DialogText {
actionCallback?: (confirmed: boolean) => void;
}
//Action at the end of a DataTable row
export type RowMenuAction = {
name: string;
onClick: ((idx: string) => void );
needsConfirmation?: boolean;
dialogText?: DialogText;
};
//Dropdown menu action
export type MenuAction = {
name: string;
onClick: () => void;
needsConfirmation?: boolean;
dialogText?: DialogText;
};