@reactor-team/js-sdk 1.0.15 → 1.0.17
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/index.d.mts +32 -7
- package/dist/index.d.ts +32 -7
- package/dist/index.js +514 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +497 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
4
|
import { RemoteVideoTrack } from 'livekit-client';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal types for the Reactor SDK.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare const WaitingInfoDataSchema: z.ZodObject<{
|
|
11
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
estimatedWaitTime: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
averageWaitTime: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const SessionExpirationDataSchema: z.ZodObject<{
|
|
16
|
+
expire: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
|
|
6
19
|
type ReactorStatus = "disconnected" | "connecting" | "waiting" | "ready";
|
|
7
|
-
interface ReactorWaitingInfo {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
averageWaitTime?: number;
|
|
20
|
+
interface ReactorWaitingInfo extends z$1.infer<typeof WaitingInfoDataSchema> {
|
|
21
|
+
}
|
|
22
|
+
interface ReactorSessionExpiration extends z$1.infer<typeof SessionExpirationDataSchema> {
|
|
11
23
|
}
|
|
12
24
|
interface ReactorError {
|
|
13
25
|
code: string;
|
|
@@ -22,7 +34,7 @@ interface ReactorState$1 {
|
|
|
22
34
|
waitingInfo?: ReactorWaitingInfo;
|
|
23
35
|
lastError?: ReactorError;
|
|
24
36
|
}
|
|
25
|
-
type ReactorEvent = "statusChanged" | "waitingInfoChanged" | "newMessage" | "fps" | "streamChanged" | "error";
|
|
37
|
+
type ReactorEvent = "statusChanged" | "waitingInfoChanged" | "newMessage" | "fps" | "streamChanged" | "error" | "sessionExpirationChanged";
|
|
26
38
|
|
|
27
39
|
declare const OptionsSchema: z.ZodObject<{
|
|
28
40
|
directConnection: z.ZodOptional<z.ZodObject<{
|
|
@@ -51,6 +63,7 @@ declare class Reactor {
|
|
|
51
63
|
private modelName;
|
|
52
64
|
private modelVersion;
|
|
53
65
|
private queueing;
|
|
66
|
+
private sessionExpiration?;
|
|
54
67
|
constructor(options: Options);
|
|
55
68
|
private eventListeners;
|
|
56
69
|
on(event: ReactorEvent, handler: EventHandler): void;
|
|
@@ -92,6 +105,11 @@ declare class Reactor {
|
|
|
92
105
|
disconnect(): Promise<void>;
|
|
93
106
|
private setStatus;
|
|
94
107
|
private setWaitingInfo;
|
|
108
|
+
/**
|
|
109
|
+
* Set the session expiration time.
|
|
110
|
+
* @param newSessionExpiration The new session expiration time in seconds.
|
|
111
|
+
*/
|
|
112
|
+
private setSessionExpiration;
|
|
95
113
|
getStatus(): ReactorStatus;
|
|
96
114
|
/**
|
|
97
115
|
* Get the current state including status, error, and waiting info
|
|
@@ -117,6 +135,7 @@ interface ReactorState {
|
|
|
117
135
|
fps?: number;
|
|
118
136
|
waitingInfo?: ReactorWaitingInfo;
|
|
119
137
|
lastError?: ReactorError;
|
|
138
|
+
sessionExpiration?: number;
|
|
120
139
|
}
|
|
121
140
|
interface ReactorActions {
|
|
122
141
|
sendMessage(message: any): Promise<void>;
|
|
@@ -150,6 +169,12 @@ interface ReactorViewProps {
|
|
|
150
169
|
}
|
|
151
170
|
declare function ReactorView({ width, height, className, style, videoObjectFit, }: ReactorViewProps): react_jsx_runtime.JSX.Element;
|
|
152
171
|
|
|
172
|
+
interface ReactorControllerProps {
|
|
173
|
+
className?: string;
|
|
174
|
+
style?: React.CSSProperties;
|
|
175
|
+
}
|
|
176
|
+
declare function ReactorController({ className, style, }: ReactorControllerProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
|
|
153
178
|
interface Props {
|
|
154
179
|
className?: string;
|
|
155
180
|
style?: React.CSSProperties;
|
|
@@ -173,4 +198,4 @@ declare function useReactor<T>(selector: (state: ReactorStore) => T): T;
|
|
|
173
198
|
*/
|
|
174
199
|
declare function useReactorMessage(handler: (message: any) => void): void;
|
|
175
200
|
|
|
176
|
-
export { type Options, Reactor, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorState$1 as ReactorState, type ReactorStatus, ReactorView, type ReactorViewProps, type ReactorWaitingInfo, WebcamStream, useReactor, useReactorMessage, useReactorStore };
|
|
201
|
+
export { type Options, Reactor, ReactorController, type ReactorControllerProps, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorSessionExpiration, type ReactorState$1 as ReactorState, type ReactorStatus, ReactorView, type ReactorViewProps, type ReactorWaitingInfo, WebcamStream, useReactor, useReactorMessage, useReactorStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import z$1, { z } from 'zod';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import React, { ReactNode } from 'react';
|
|
4
4
|
import { RemoteVideoTrack } from 'livekit-client';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal types for the Reactor SDK.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare const WaitingInfoDataSchema: z.ZodObject<{
|
|
11
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
estimatedWaitTime: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
averageWaitTime: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const SessionExpirationDataSchema: z.ZodObject<{
|
|
16
|
+
expire: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
|
|
6
19
|
type ReactorStatus = "disconnected" | "connecting" | "waiting" | "ready";
|
|
7
|
-
interface ReactorWaitingInfo {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
averageWaitTime?: number;
|
|
20
|
+
interface ReactorWaitingInfo extends z$1.infer<typeof WaitingInfoDataSchema> {
|
|
21
|
+
}
|
|
22
|
+
interface ReactorSessionExpiration extends z$1.infer<typeof SessionExpirationDataSchema> {
|
|
11
23
|
}
|
|
12
24
|
interface ReactorError {
|
|
13
25
|
code: string;
|
|
@@ -22,7 +34,7 @@ interface ReactorState$1 {
|
|
|
22
34
|
waitingInfo?: ReactorWaitingInfo;
|
|
23
35
|
lastError?: ReactorError;
|
|
24
36
|
}
|
|
25
|
-
type ReactorEvent = "statusChanged" | "waitingInfoChanged" | "newMessage" | "fps" | "streamChanged" | "error";
|
|
37
|
+
type ReactorEvent = "statusChanged" | "waitingInfoChanged" | "newMessage" | "fps" | "streamChanged" | "error" | "sessionExpirationChanged";
|
|
26
38
|
|
|
27
39
|
declare const OptionsSchema: z.ZodObject<{
|
|
28
40
|
directConnection: z.ZodOptional<z.ZodObject<{
|
|
@@ -51,6 +63,7 @@ declare class Reactor {
|
|
|
51
63
|
private modelName;
|
|
52
64
|
private modelVersion;
|
|
53
65
|
private queueing;
|
|
66
|
+
private sessionExpiration?;
|
|
54
67
|
constructor(options: Options);
|
|
55
68
|
private eventListeners;
|
|
56
69
|
on(event: ReactorEvent, handler: EventHandler): void;
|
|
@@ -92,6 +105,11 @@ declare class Reactor {
|
|
|
92
105
|
disconnect(): Promise<void>;
|
|
93
106
|
private setStatus;
|
|
94
107
|
private setWaitingInfo;
|
|
108
|
+
/**
|
|
109
|
+
* Set the session expiration time.
|
|
110
|
+
* @param newSessionExpiration The new session expiration time in seconds.
|
|
111
|
+
*/
|
|
112
|
+
private setSessionExpiration;
|
|
95
113
|
getStatus(): ReactorStatus;
|
|
96
114
|
/**
|
|
97
115
|
* Get the current state including status, error, and waiting info
|
|
@@ -117,6 +135,7 @@ interface ReactorState {
|
|
|
117
135
|
fps?: number;
|
|
118
136
|
waitingInfo?: ReactorWaitingInfo;
|
|
119
137
|
lastError?: ReactorError;
|
|
138
|
+
sessionExpiration?: number;
|
|
120
139
|
}
|
|
121
140
|
interface ReactorActions {
|
|
122
141
|
sendMessage(message: any): Promise<void>;
|
|
@@ -150,6 +169,12 @@ interface ReactorViewProps {
|
|
|
150
169
|
}
|
|
151
170
|
declare function ReactorView({ width, height, className, style, videoObjectFit, }: ReactorViewProps): react_jsx_runtime.JSX.Element;
|
|
152
171
|
|
|
172
|
+
interface ReactorControllerProps {
|
|
173
|
+
className?: string;
|
|
174
|
+
style?: React.CSSProperties;
|
|
175
|
+
}
|
|
176
|
+
declare function ReactorController({ className, style, }: ReactorControllerProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
|
|
153
178
|
interface Props {
|
|
154
179
|
className?: string;
|
|
155
180
|
style?: React.CSSProperties;
|
|
@@ -173,4 +198,4 @@ declare function useReactor<T>(selector: (state: ReactorStore) => T): T;
|
|
|
173
198
|
*/
|
|
174
199
|
declare function useReactorMessage(handler: (message: any) => void): void;
|
|
175
200
|
|
|
176
|
-
export { type Options, Reactor, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorState$1 as ReactorState, type ReactorStatus, ReactorView, type ReactorViewProps, type ReactorWaitingInfo, WebcamStream, useReactor, useReactorMessage, useReactorStore };
|
|
201
|
+
export { type Options, Reactor, ReactorController, type ReactorControllerProps, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorSessionExpiration, type ReactorState$1 as ReactorState, type ReactorStatus, ReactorView, type ReactorViewProps, type ReactorWaitingInfo, WebcamStream, useReactor, useReactorMessage, useReactorStore };
|