@andrew.verdyanwar/microfrontend-types 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +29 -28
- package/src/components/datable.d.ts +3 -0
- package/src/sidebar.d.ts +54 -54
- package/src/stores/useAuthStore.d.ts +52 -0
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
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
|
-
}
|
|
2
|
+
"name": "@andrew.verdyanwar/microfrontend-types",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "TypeScript definitions for microfrontend components and utilities",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"typescript": "^5.0.0",
|
|
13
|
+
"@types/react": "^18.0.0"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"typescript",
|
|
17
|
+
"microfrontend",
|
|
18
|
+
"types",
|
|
19
|
+
"definitions"
|
|
20
|
+
],
|
|
21
|
+
"author": "Wasco Energy",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"dev": "tsc --watch"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -7,6 +7,9 @@ declare module "container/components" {
|
|
|
7
7
|
title?: string;
|
|
8
8
|
useQueryHook?: () => any;
|
|
9
9
|
onSelectionChange?: () => any;
|
|
10
|
+
optionsFilter?: any;
|
|
11
|
+
onFilterChange?: (filters: Record<string, string>) => void;
|
|
12
|
+
noFilter?:boolean
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
const ServerDataTable: ComponentType<ServerDataTableProps>;
|
package/src/sidebar.d.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
declare module "container/hooks" {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
// Sidebar types
|
|
3
|
+
export interface SidebarItem {
|
|
4
|
+
name: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
link: string;
|
|
7
|
+
children?: {
|
|
8
|
+
name: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
link: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
export interface SidebarProps {
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
onToggle: () => void;
|
|
17
|
+
activeItem: string;
|
|
18
|
+
onItemSelect: (item: SidebarItem) => void;
|
|
19
|
+
expandedItems: string[];
|
|
20
|
+
onToggleExpanded: (item: string) => void;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
// Sidebar store state and actions
|
|
24
|
+
interface SideBarState {
|
|
25
|
+
activeItem: string;
|
|
26
|
+
expandedItems: string[];
|
|
27
|
+
sidebarItems: SidebarItem[];
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
interface SideBarActions {
|
|
31
|
+
setActiveItem: (item: string) => void;
|
|
32
|
+
setSidebarItem: (items: SidebarItem[]) => void;
|
|
33
|
+
setExpandedItems: (item: string) => void;
|
|
34
|
+
clearExpandedItems: () => void;
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
type SidebarStore = SideBarState & SideBarActions;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
// Zustand store interface for sidebar
|
|
40
|
+
interface ZustandSidebarStore {
|
|
41
|
+
(): SidebarStore;
|
|
42
|
+
getState: () => SidebarStore;
|
|
43
|
+
setState: (
|
|
44
|
+
partial:
|
|
45
|
+
| Partial<SidebarStore>
|
|
46
|
+
| ((state: SidebarStore) => Partial<SidebarStore>),
|
|
47
|
+
) => void;
|
|
48
|
+
subscribe: (
|
|
49
|
+
listener: (state: SidebarStore, prevState: SidebarStore) => void,
|
|
50
|
+
) => () => void;
|
|
51
|
+
persist: {
|
|
52
|
+
setOptions: (options: any) => void;
|
|
53
|
+
clearStorage: () => void;
|
|
54
|
+
rehydrate: () => void;
|
|
55
|
+
hasHydrated: () => boolean;
|
|
56
|
+
onHydrate: (fn: (state: SidebarStore) => void) => () => void;
|
|
57
|
+
onFinishHydration: (fn: (state: SidebarStore) => void) => () => void;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
export const useSidebarStore: ZustandSidebarStore;
|
|
62
62
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare module "container/hooks" {
|
|
2
|
+
interface User {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
department: string;
|
|
6
|
+
position: string;
|
|
7
|
+
category: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface AuthState {
|
|
11
|
+
user: User | null;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
isAuthenticated: boolean;
|
|
15
|
+
isInitialized: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface AuthActions {
|
|
19
|
+
checkAuth: () => Promise<void>;
|
|
20
|
+
clearError: () => void;
|
|
21
|
+
setLoading: (loading: boolean) => void;
|
|
22
|
+
getAuthState: () => {
|
|
23
|
+
user: User | null;
|
|
24
|
+
isAuthenticated: boolean;
|
|
25
|
+
isInitialized: boolean;
|
|
26
|
+
};
|
|
27
|
+
setAuthData: (user: User) => void;
|
|
28
|
+
clearAuthData: () => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type AuthStore = AuthState & AuthActions;
|
|
32
|
+
|
|
33
|
+
// Zustand store interface for applications
|
|
34
|
+
interface ZustandAuthStore {
|
|
35
|
+
(): AuthStore;
|
|
36
|
+
getState: () => AuthStore;
|
|
37
|
+
setState: (
|
|
38
|
+
partial: Partial<AuthStore> | ((state: AuthStore) => Partial<AuthStore>),
|
|
39
|
+
) => void;
|
|
40
|
+
subscribe: (
|
|
41
|
+
listener: (state: AuthStore, prevState: AuthStore) => void,
|
|
42
|
+
) => () => void;
|
|
43
|
+
persist: {
|
|
44
|
+
setOptions: (options: any) => void;
|
|
45
|
+
clearStorage: () => void;
|
|
46
|
+
rehydrate: () => void;
|
|
47
|
+
hasHydrated: () => boolean;
|
|
48
|
+
onHydrate: (fn: (state: AuthStore) => void) => () => void;
|
|
49
|
+
onFinishHydration: (fn: (state: AuthStore) => void) => () => void;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|