-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
66 lines (59 loc) · 1.42 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
61
62
63
64
65
66
export type TContext = {
show: boolean;
setShow: (value: boolean) => void;
toggleMenu: boolean;
setToggleMenu: (value: boolean) => void;
toggle: () => void;
pages: TNavlinks[];
setPages: React.Dispatch<React.SetStateAction<TNavlinks[]>>;
loading: boolean;
setLoading?: (value: boolean) => void;
getPageTitle: (id: string) => TPageProp;
updateState: UpdateStateFn<TNavlinks>;
getGroupPages: (name: "private" | "favorite") => TNavlinks[];
};
export type TPageProp = {
cover: string;
icon: string;
title: string;
};
export type UpdateStateFn<T extends { id: string }> = (
setState: React.Dispatch<React.SetStateAction<T[]>>,
id: T["id"], // Ensures the id matches the type of the `id` property in T
prop: keyof T,
value: T[keyof T],
) => void;
export type TNavlinks = {
id: string;
slug: string;
title: string;
icon: string;
cover: string;
is_favorite: boolean;
};
export type TEmoji<T> = {
alises: T[];
id: T;
keywords: T[];
name: T;
native: T;
shortcodes: T;
skin: number;
unified: T;
};
export type EmojiCompProps = {
toggle?: () => void;
show: boolean;
value?: string;
add: (value: TEmoji<string>) => void;
setShow: React.Dispatch<React.SetStateAction<boolean>>;
};
export type TControl = {
title: string;
cover: string;
icon: string;
};
export type TTopBarProps = {
controlData?: TControl;
setControlData?: React.Dispatch<React.SetStateAction<TControl>>;
};