@3dverse/livelink.core 1.0.7 → 1.0.8
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.
|
@@ -4,21 +4,27 @@
|
|
|
4
4
|
* Activity is defined as any message sent to the gateway that is **not** a heartbeat.
|
|
5
5
|
*
|
|
6
6
|
* Internally the activity watcher uses two timeouts:
|
|
7
|
-
* - Inactivity warning: the time in seconds after which the
|
|
8
|
-
* - Inactivity timeout: the time in seconds after which the
|
|
7
|
+
* - Inactivity warning: the time in seconds after which the {@link InactivityWarningEvent} event is dispatched.
|
|
8
|
+
* - Inactivity timeout: the time in seconds after which the {@link DisconnectedEvent} event is dispatched.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* Whenever an internal activity is detected like a message being sent to the gateway, the activity watcher is reset
|
|
11
|
+
* and a {@link ActivityDetectedEvent} event is dispatched.
|
|
11
12
|
*
|
|
12
13
|
* The application **should** listen to these events and act accordingly.
|
|
13
14
|
*
|
|
14
|
-
* Usually, when the
|
|
15
|
+
* Usually, when the {@link InactivityWarningEvent} event is dispatched, the application should display a warning to
|
|
16
|
+
* the user.
|
|
15
17
|
* It is up to the application to decide what can be qualified as activity.
|
|
16
18
|
* For example, the application could consider the user moving the mouse as activity. In this case, the application
|
|
17
19
|
* would listen to the "mousemove" event and reset the activity watcher whenever the mouse is moved calling
|
|
18
|
-
* the {@
|
|
20
|
+
* the {@link ActivityWatcher.reset} method.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
+
* The application should also listen to the {@link ActivityDetectedEvent} event and update the UI accordingly.
|
|
23
|
+
*
|
|
24
|
+
* Once the inactivity timeout is reached it automatically triggers the disconnection from the gateway, and a
|
|
25
|
+
* {@link DisconnectedEvent} is dispatched with `inactivity` as the reason.
|
|
26
|
+
* In this case, there is no way to recover the connection. The application should let the user know that the connection
|
|
27
|
+
* has been lost.
|
|
22
28
|
*
|
|
23
29
|
* @category Core
|
|
24
30
|
*/
|
|
@@ -19,6 +19,10 @@ import { EntityResponse, FindEntityOptions, FindEntityQuery, UpdateEntityCommand
|
|
|
19
19
|
* If the client is inactive for a certain amount of time, the connection is closed.
|
|
20
20
|
* See {@link ActivityWatcher}.
|
|
21
21
|
*
|
|
22
|
+
* ## Events
|
|
23
|
+
*
|
|
24
|
+
* See {@link CoreEvents}.
|
|
25
|
+
*
|
|
22
26
|
* @category Core
|
|
23
27
|
*/
|
|
24
28
|
export declare class LivelinkCore extends TypedEventTarget<CoreEvents> {
|
|
@@ -27,6 +31,10 @@ export declare class LivelinkCore extends TypedEventTarget<CoreEvents> {
|
|
|
27
31
|
* Get the gateway activity watcher.
|
|
28
32
|
*/
|
|
29
33
|
get activity_watcher(): ActivityWatcher;
|
|
34
|
+
/**
|
|
35
|
+
* Get the latency of the connection in milliseconds.
|
|
36
|
+
*/
|
|
37
|
+
get latency(): number;
|
|
30
38
|
/**
|
|
31
39
|
* Connect to the session
|
|
32
40
|
*
|
|
@@ -149,7 +157,7 @@ export declare class LivelinkCore extends TypedEventTarget<CoreEvents> {
|
|
|
149
157
|
*
|
|
150
158
|
* @param params
|
|
151
159
|
* @param params.screenSpaceRayQuery - The screen space ray query.
|
|
152
|
-
* @returns A promise that resolves to the screen space ray
|
|
160
|
+
* @returns A promise that resolves to the screen space ray response.
|
|
153
161
|
*/
|
|
154
162
|
castScreenSpaceRay({ screenSpaceRayQuery, }: {
|
|
155
163
|
screenSpaceRayQuery: GatewayMessages.Queries.ScreenSpaceRayQuery;
|