@momo2555/koppeliajs 0.0.162 → 0.0.163
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/dist/scripts/console.d.ts +64 -38
- package/dist/scripts/console.js +72 -50
- package/dist/scripts/customCallback.d.ts +18 -0
- package/dist/scripts/customCallback.js +22 -4
- package/dist/scripts/device.d.ts +47 -12
- package/dist/scripts/device.js +49 -19
- package/dist/scripts/koppelia.d.ts +155 -36
- package/dist/scripts/koppelia.js +156 -48
- package/dist/scripts/koppeliaWebsocket.d.ts +33 -28
- package/dist/scripts/koppeliaWebsocket.js +37 -41
- package/dist/scripts/message.d.ts +46 -29
- package/dist/scripts/message.js +47 -31
- package/dist/scripts/option.d.ts +26 -11
- package/dist/scripts/option.js +26 -14
- package/dist/scripts/play.d.ts +46 -4
- package/dist/scripts/play.js +46 -4
- package/dist/scripts/resident.d.ts +19 -0
- package/dist/scripts/resident.js +21 -1
- package/dist/scripts/song.d.ts +36 -0
- package/dist/scripts/song.js +36 -0
- package/dist/scripts/stage.d.ts +29 -0
- package/dist/scripts/stage.js +29 -2
- package/dist/scripts/state.d.ts +26 -9
- package/dist/scripts/state.js +28 -14
- package/dist/stores/routeStore.d.ts +13 -0
- package/dist/stores/routeStore.js +23 -13
- package/package.json +1 -1
|
@@ -1,2 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reactive Svelte store that holds the active route context of the application.
|
|
3
|
+
* Developers can subscribe to this store to adapt UI or logic based on the current view.
|
|
4
|
+
* * Possible values:
|
|
5
|
+
* - `"controller"`: If the user is on a controller interface.
|
|
6
|
+
* - `"monitor"`: If the user is on a monitor interface.
|
|
7
|
+
* - `""` (empty string): If the current route matches neither.
|
|
8
|
+
*/
|
|
1
9
|
export declare const routeType: import("svelte/store").Writable<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Evaluates the current SvelteKit page URL and updates the `routeType` store accordingly.
|
|
12
|
+
* This function should typically be called during layout initialization or whenever
|
|
13
|
+
* a route change is detected to ensure the store stays synchronized with the actual URL.
|
|
14
|
+
*/
|
|
2
15
|
export declare function updateRoute(): void;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { get, writable } from "svelte/store";
|
|
2
|
+
import { page } from "$app/stores";
|
|
3
|
+
import { logger } from "../scripts/logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* A reactive Svelte store that holds the active route context of the application.
|
|
6
|
+
* Developers can subscribe to this store to adapt UI or logic based on the current view.
|
|
7
|
+
* * Possible values:
|
|
8
|
+
* - `"controller"`: If the user is on a controller interface.
|
|
9
|
+
* - `"monitor"`: If the user is on a monitor interface.
|
|
10
|
+
* - `""` (empty string): If the current route matches neither.
|
|
11
|
+
*/
|
|
12
|
+
export const routeType = writable("");
|
|
13
|
+
/**
|
|
14
|
+
* Evaluates the current SvelteKit page URL and updates the `routeType` store accordingly.
|
|
15
|
+
* This function should typically be called during layout initialization or whenever
|
|
16
|
+
* a route change is detected to ensure the store stays synchronized with the actual URL.
|
|
17
|
+
*/
|
|
8
18
|
export function updateRoute() {
|
|
9
19
|
const path = get(page).url.pathname;
|
|
10
|
-
logger.log("
|
|
11
|
-
if (path.includes(
|
|
12
|
-
routeType.set(
|
|
20
|
+
logger.log("updateRoute with path = ", path);
|
|
21
|
+
if (path.includes("controller")) {
|
|
22
|
+
routeType.set("controller");
|
|
13
23
|
logger.log(path, "CONTROLLER");
|
|
14
24
|
}
|
|
15
|
-
else if (path.includes(
|
|
16
|
-
routeType.set(
|
|
25
|
+
else if (path.includes("monitor")) {
|
|
26
|
+
routeType.set("monitor");
|
|
17
27
|
logger.log(path, "MONITOR");
|
|
18
28
|
}
|
|
19
29
|
else {
|
|
20
|
-
routeType.set(
|
|
30
|
+
routeType.set("");
|
|
21
31
|
}
|
|
22
32
|
}
|