@mui-toolpad-extended-tuni/courses 3.0.0 → 3.0.2
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/README.md +6 -6
- package/dist/hooks/useVisitedCourses.d.ts +18 -0
- package/dist/index.cjs +32 -31
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +10336 -3084
- package/dist/utils/__tests__/courseFilters.test.d.ts +2 -0
- package/package.json +1 -1
- package/dist/mocks/commented.d.ts +0 -0
- package/dist/mocks/constants.d.ts +0 -9
- package/dist/mocks/endpoints.d.ts +0 -8
- package/dist/mocks/generators.d.ts +0 -19
- package/dist/mocks/types.d.ts +0 -109
package/README.md
CHANGED
|
@@ -32,18 +32,18 @@ The courses microservice automatically registers itself when imported:
|
|
|
32
32
|
|
|
33
33
|
```tsx
|
|
34
34
|
import { BrowserRouter } from 'react-router-dom';
|
|
35
|
-
import {
|
|
35
|
+
import { ToolpadProvider, Microservices } from 'mui-toolpad-extended-tuni';
|
|
36
36
|
import { CourseMicroservice } from '@mui-toolpad-extended-tuni/courses';
|
|
37
37
|
|
|
38
38
|
function App() {
|
|
39
39
|
return (
|
|
40
40
|
<BrowserRouter>
|
|
41
|
-
<
|
|
41
|
+
<ToolpadProvider>
|
|
42
42
|
<Microservices>
|
|
43
43
|
<CourseMicroservice />
|
|
44
44
|
{/* Other microservices */}
|
|
45
45
|
</Microservices>
|
|
46
|
-
</
|
|
46
|
+
</ToolpadProvider>
|
|
47
47
|
</BrowserRouter>
|
|
48
48
|
);
|
|
49
49
|
}
|
|
@@ -228,14 +228,14 @@ Simply include both microservices - the integration happens automatically:
|
|
|
228
228
|
|
|
229
229
|
```tsx
|
|
230
230
|
import { BrowserRouter } from 'react-router-dom';
|
|
231
|
-
import {
|
|
231
|
+
import { ToolpadProvider, Microservices } from 'mui-toolpad-extended-tuni';
|
|
232
232
|
import { CourseMicroservice } from '@mui-toolpad-extended-tuni/courses';
|
|
233
233
|
import { CalendarMicroservice } from '@mui-toolpad-extended-tuni/calendar';
|
|
234
234
|
|
|
235
235
|
function App() {
|
|
236
236
|
return (
|
|
237
237
|
<BrowserRouter>
|
|
238
|
-
<
|
|
238
|
+
<ToolpadProvider>
|
|
239
239
|
<Microservices>
|
|
240
240
|
{/* CourseEventPublisher is automatically included */}
|
|
241
241
|
<CourseMicroservice />
|
|
@@ -243,7 +243,7 @@ function App() {
|
|
|
243
243
|
{/* CalendarEventAggregator is automatically included */}
|
|
244
244
|
<CalendarMicroservice />
|
|
245
245
|
</Microservices>
|
|
246
|
-
</
|
|
246
|
+
</ToolpadProvider>
|
|
247
247
|
</BrowserRouter>
|
|
248
248
|
);
|
|
249
249
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Course } from '../store/useCourseStore';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a course to the visited courses list and updates user preferences
|
|
4
|
+
* @param {Course} course - The course to add to visited courses
|
|
5
|
+
* @returns {Promise<void>}
|
|
6
|
+
*/
|
|
7
|
+
export declare const addVisitedCourse: (course: Course) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the current list of visited course IDs from user preferences
|
|
10
|
+
* @returns {string[]} Array of course IDs in "code:instance" format
|
|
11
|
+
*/
|
|
12
|
+
export declare const getVisitedCourses: () => string[];
|
|
13
|
+
/**
|
|
14
|
+
* Subscribes to visited courses updates
|
|
15
|
+
* @param {Function} callback - Function to call when visited courses list changes
|
|
16
|
+
* @returns {Function} Unsubscribe function
|
|
17
|
+
*/
|
|
18
|
+
export declare const onVisitedCoursesUpdate: (callback: (courseIds: string[]) => void) => () => void;
|