@decartai/sdk 0.0.67 → 0.1.0

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.
Files changed (45) hide show
  1. package/README.md +55 -5
  2. package/dist/index.d.ts +7 -5
  3. package/dist/index.js +43 -28
  4. package/dist/process/client.js +1 -3
  5. package/dist/process/request.js +1 -3
  6. package/dist/queue/client.js +1 -3
  7. package/dist/queue/polling.js +1 -2
  8. package/dist/queue/request.js +1 -3
  9. package/dist/realtime/client.d.ts +23 -13
  10. package/dist/realtime/client.js +74 -244
  11. package/dist/realtime/config-realtime.js +49 -0
  12. package/dist/realtime/event-buffer.js +1 -3
  13. package/dist/realtime/initial-state-gate.js +21 -0
  14. package/dist/realtime/media-channel.js +82 -0
  15. package/dist/realtime/methods.js +12 -42
  16. package/dist/realtime/mirror-stream.js +1 -2
  17. package/dist/realtime/observability/diagnostics.d.ts +39 -0
  18. package/dist/realtime/observability/livekit-stats-provider.js +25 -0
  19. package/dist/realtime/observability/realtime-observability.js +173 -0
  20. package/dist/realtime/{telemetry-reporter.js → observability/telemetry-reporter.js} +12 -31
  21. package/dist/realtime/observability/webrtc-stats.d.ts +148 -0
  22. package/dist/realtime/observability/webrtc-stats.js +276 -0
  23. package/dist/realtime/signaling-channel.js +286 -0
  24. package/dist/realtime/stream-session.js +252 -0
  25. package/dist/realtime/subscribe-client.d.ts +2 -1
  26. package/dist/realtime/subscribe-client.js +115 -11
  27. package/dist/realtime/types.d.ts +25 -1
  28. package/dist/shared/model.d.ts +11 -1
  29. package/dist/shared/model.js +51 -14
  30. package/dist/shared/request.js +1 -3
  31. package/dist/shared/types.js +1 -3
  32. package/dist/tokens/client.js +1 -3
  33. package/dist/utils/env.js +1 -2
  34. package/dist/utils/errors.js +1 -2
  35. package/dist/utils/logger.js +1 -2
  36. package/dist/utils/media.js +43 -0
  37. package/dist/utils/platform.js +13 -0
  38. package/dist/utils/user-agent.js +1 -3
  39. package/dist/version.js +1 -2
  40. package/package.json +2 -1
  41. package/dist/realtime/diagnostics.d.ts +0 -78
  42. package/dist/realtime/webrtc-connection.js +0 -501
  43. package/dist/realtime/webrtc-manager.js +0 -189
  44. package/dist/realtime/webrtc-stats.d.ts +0 -59
  45. package/dist/realtime/webrtc-stats.js +0 -154
package/README.md CHANGED
@@ -15,12 +15,15 @@ yarn add @decartai/sdk
15
15
  ## Documentation
16
16
 
17
17
  For complete documentation, guides, and examples, visit:
18
- **https://docs.platform.decart.ai/sdks/javascript**
18
+ **[https://docs.platform.decart.ai/sdks/javascript](https://docs.platform.decart.ai/sdks/javascript)**
19
19
 
20
20
  ## Quick Start
21
21
 
22
22
  ### Real-time Video Transformation
23
23
 
24
+ Realtime connections are LiveKit-backed in the SDK. Existing client usage stays the same: provide a
25
+ camera `MediaStream`, choose a realtime model, and handle the transformed remote stream.
26
+
24
27
  ```typescript
25
28
  import { createDecartClient, models } from "@decartai/sdk";
26
29
 
@@ -79,6 +82,53 @@ Options:
79
82
  - `"auto"` — mirror when the input track reports `facingMode: "user"` (mobile front cameras).
80
83
  - `true` — always mirror (e.g. desktop webcams).
81
84
 
85
+ ### Watch a Stream
86
+
87
+ A connected realtime session exposes an SDK `subscribeToken` once it reaches a
88
+ connected state. Share that SDK token with viewers — `client.realtime.subscribe`
89
+ uses it to request receive-only LiveKit credentials from Decart, then connects to
90
+ the LiveKit room for the styled output stream. No viewer camera is required.
91
+
92
+ **Producer** — capture the token from the active session:
93
+
94
+ ```typescript
95
+ const realtimeClient = await client.realtime.connect(stream, {
96
+ model,
97
+ onRemoteStream: (transformedStream) => {
98
+ videoElement.srcObject = transformedStream;
99
+ },
100
+ });
101
+
102
+ realtimeClient.on("connectionChange", (state) => {
103
+ if ((state === "connected" || state === "generating") && realtimeClient.subscribeToken) {
104
+ const subscribeToken = realtimeClient.subscribeToken;
105
+ // Pass `subscribeToken` to the viewer snippet below.
106
+ }
107
+ });
108
+ ```
109
+
110
+ **Viewer** — attach to the producer's stream with the token:
111
+
112
+ ```typescript
113
+ import { createDecartClient, type RealTimeSubscribeClient } from "@decartai/sdk";
114
+
115
+ const client = createDecartClient({ apiKey: "your-api-key-here" });
116
+
117
+ const subscriber: RealTimeSubscribeClient = await client.realtime.subscribe({
118
+ token: subscribeToken,
119
+ onRemoteStream: (stream) => {
120
+ videoElement.srcObject = stream;
121
+ },
122
+ });
123
+
124
+ subscriber.on("connectionChange", (state) => {
125
+ console.log(`Viewer state: ${state}`);
126
+ });
127
+
128
+ // Disconnect when done
129
+ subscriber.disconnect();
130
+ ```
131
+
82
132
  ### Async Processing (Queue API)
83
133
 
84
134
  For video generation jobs, use the queue API to submit jobs and poll for results:
@@ -151,12 +201,12 @@ pnpm install
151
201
 
152
202
  1. **Version bump**: Run `pnpm release` to bump the version (this uses `bumpp` to create a new version tag) and push it to GitHub
153
203
  2. **Automated publish**: The GitHub Actions workflow will:
154
- - Build the project
155
- - Publish to npm
156
- - Create a GitHub release with changelog
204
+ - Build the project
205
+ - Publish to npm
206
+ - Create a GitHub release with changelog
157
207
 
158
208
  The package is published to npm as `@decartai/sdk`.
159
209
 
160
210
  ## License
161
211
 
162
- MIT
212
+ MIT
package/dist/index.d.ts CHANGED
@@ -5,12 +5,12 @@ import { ProcessClient } from "./process/client.js";
5
5
  import { JobStatus, JobStatusResponse, JobSubmitResponse, QueueJobResult, QueueSubmitAndPollOptions, QueueSubmitOptions } from "./queue/types.js";
6
6
  import { QueueClient } from "./queue/client.js";
7
7
  import { DecartSDKError, ERROR_CODES } from "./utils/errors.js";
8
- import { ConnectionPhase, DiagnosticEvent, DiagnosticEventName, DiagnosticEvents, IceCandidateEvent, IceStateEvent, PeerConnectionStateEvent, PhaseTimingEvent, ReconnectEvent, SelectedCandidatePairEvent, SignalingStateEvent, VideoStallEvent } from "./realtime/diagnostics.js";
9
- import { ConnectionState } from "./realtime/types.js";
8
+ import { ClientSessionConnectionBreakdownEvent, ClientSessionConnectionBreakdownPhase, DiagnosticEvent, DiagnosticEventName, DiagnosticEvents, ReconnectEvent, VideoStallEvent } from "./realtime/observability/diagnostics.js";
9
+ import { WebRTCStats } from "./realtime/observability/webrtc-stats.js";
10
+ import { ConnectionState, GenerationEndedMessage, QueuePosition, QueuePositionMessage } from "./realtime/types.js";
10
11
  import { SetInput } from "./realtime/methods.js";
11
- import { RealTimeSubscribeClient, SubscribeEvents, SubscribeOptions } from "./realtime/subscribe-client.js";
12
- import { WebRTCStats } from "./realtime/webrtc-stats.js";
13
12
  import { Events, RealTimeClient, RealTimeClientConnectOptions, RealTimeClientInitialState } from "./realtime/client.js";
13
+ import { RealTimeSubscribeClient, SubscribeEvents, SubscribeOptions } from "./realtime/subscribe-client.js";
14
14
  import { ModelState } from "./shared/types.js";
15
15
  import { CreateTokenOptions, CreateTokenResponse, TokensClient } from "./tokens/client.js";
16
16
 
@@ -42,6 +42,8 @@ type DecartClientOptions = {
42
42
  * @param options.realtimeBaseUrl - Override the default WebSocket base URL for realtime connections.
43
43
  * @param options.integration - Optional integration identifier.
44
44
  *
45
+ * Realtime media uses LiveKit only (inference must enable it in `TRANSPORTS_ENABLED`).
46
+ *
45
47
  * @example
46
48
  * ```ts
47
49
  * // (direct API access)Option 1: Explicit API key
@@ -134,4 +136,4 @@ declare const createDecartClient: (options?: DecartClientOptions) => {
134
136
  tokens: TokensClient;
135
137
  };
136
138
  //#endregion
137
- export { type CanonicalModel, type ConnectionPhase, type ConnectionState, type CreateTokenOptions, type CreateTokenResponse, type CustomModelDefinition, DecartClientOptions, type DecartSDKError, type DiagnosticEvent, type DiagnosticEventName, type DiagnosticEvents, ERROR_CODES, type FileInput, type IceCandidateEvent, type IceStateEvent, type ImageModelDefinition, type ImageModels, type JobStatus, type JobStatusResponse, type JobSubmitResponse, type ListedModelDefinition, type LogLevel, type Logger, type Model, type ModelDefinition, type ModelKind, type ModelState, type PeerConnectionStateEvent, type PhaseTimingEvent, type ProcessClient, type ProcessOptions, type QueueClient, type QueueJobResult, type QueueSubmitAndPollOptions, type QueueSubmitOptions, type ReactNativeFile, type RealTimeClient, type RealTimeClientConnectOptions, type RealTimeClientInitialState, type Events as RealTimeEvents, type RealTimeModels, type RealTimeSubscribeClient, type ReconnectEvent, type SelectedCandidatePairEvent, type SetInput, type SignalingStateEvent, type SubscribeEvents, type SubscribeOptions, type TokensClient, type VideoModelDefinition, type VideoModels, type VideoStallEvent, type WebRTCStats, createConsoleLogger, createDecartClient, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, noopLogger, resolveCanonicalModelAlias, resolveModelAlias };
139
+ export { type CanonicalModel, type ClientSessionConnectionBreakdownEvent, type ClientSessionConnectionBreakdownPhase, type ConnectionState, type CreateTokenOptions, type CreateTokenResponse, type CustomModelDefinition, DecartClientOptions, type DecartSDKError, type DiagnosticEvent, type DiagnosticEventName, type DiagnosticEvents, ERROR_CODES, type FileInput, type GenerationEndedMessage, type ImageModelDefinition, type ImageModels, type JobStatus, type JobStatusResponse, type JobSubmitResponse, type ListedModelDefinition, type LogLevel, type Logger, type Model, type ModelDefinition, type ModelKind, type ModelState, type ProcessClient, type ProcessOptions, type QueueClient, type QueueJobResult, type QueuePosition, type QueuePositionMessage, type QueueSubmitAndPollOptions, type QueueSubmitOptions, type ReactNativeFile, type RealTimeClient, type RealTimeClientConnectOptions, type RealTimeClientInitialState, type Events as RealTimeEvents, type RealTimeModels, type RealTimeSubscribeClient, type ReconnectEvent, type SetInput, type SubscribeEvents, type SubscribeOptions, type TokensClient, type VideoModelDefinition, type VideoModels, type VideoStallEvent, type WebRTCStats, createConsoleLogger, createDecartClient, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, noopLogger, resolveCanonicalModelAlias, resolveModelAlias };
package/dist/index.js CHANGED
@@ -2,12 +2,12 @@ import { ERROR_CODES, createInvalidApiKeyError, createInvalidBaseUrlError } from
2
2
  import { createProcessClient } from "./process/client.js";
3
3
  import { createQueueClient } from "./queue/client.js";
4
4
  import { isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, resolveCanonicalModelAlias, resolveModelAlias } from "./shared/model.js";
5
+ import { createConsoleLogger, noopLogger } from "./utils/logger.js";
5
6
  import { createRealTimeClient } from "./realtime/client.js";
7
+ import { createRealTimeSubscribeClient } from "./realtime/subscribe-client.js";
6
8
  import { createTokensClient } from "./tokens/client.js";
7
9
  import { readEnv } from "./utils/env.js";
8
- import { createConsoleLogger, noopLogger } from "./utils/logger.js";
9
10
  import { z } from "zod";
10
-
11
11
  //#region src/index.ts
12
12
  const proxySchema = z.union([z.string().url(), z.string().startsWith("/")]);
13
13
  const decartClientOptionsSchema = z.object({
@@ -31,6 +31,8 @@ const decartClientOptionsSchema = z.object({
31
31
  * @param options.realtimeBaseUrl - Override the default WebSocket base URL for realtime connections.
32
32
  * @param options.integration - Optional integration identifier.
33
33
  *
34
+ * Realtime media uses LiveKit only (inference must enable it in `TRANSPORTS_ENABLED`).
35
+ *
34
36
  * @example
35
37
  * ```ts
36
38
  * // (direct API access)Option 1: Explicit API key
@@ -59,33 +61,46 @@ const createDecartClient = (options = {}) => {
59
61
  if (isProxyMode && "proxy" in parsedOptions.data && parsedOptions.data.proxy) baseUrl = parsedOptions.data.proxy;
60
62
  else baseUrl = parsedOptions.data.baseUrl || "https://api.decart.ai";
61
63
  const { integration } = parsedOptions.data;
62
- const logger = "logger" in options && options.logger ? options.logger : noopLogger;
63
- const telemetryEnabled = "telemetry" in options && options.telemetry === false ? false : true;
64
+ const logger = "logger" in options && options.logger ? options.logger : createConsoleLogger("info");
65
+ const telemetryEnabled = !("telemetry" in options && options.telemetry === false);
66
+ const wsBaseUrl = parsedOptions.data.realtimeBaseUrl || "wss://api3.decart.ai";
67
+ const realtimePublish = createRealTimeClient({
68
+ baseUrl: wsBaseUrl,
69
+ apiKey: apiKey || "",
70
+ integration,
71
+ logger,
72
+ telemetryEnabled
73
+ });
74
+ const realtimeSubscribe = createRealTimeSubscribeClient({
75
+ baseUrl: isProxyMode || parsedOptions.data.baseUrl !== void 0 ? baseUrl : wsBaseUrl.replace(/^wss?:\/\//i, "https://"),
76
+ apiKey: apiKey || "",
77
+ integration,
78
+ logger
79
+ });
80
+ const process = createProcessClient({
81
+ baseUrl,
82
+ apiKey: apiKey || "",
83
+ integration
84
+ });
85
+ const queue = createQueueClient({
86
+ baseUrl,
87
+ apiKey: apiKey || "",
88
+ integration
89
+ });
90
+ const tokens = createTokensClient({
91
+ baseUrl,
92
+ apiKey: apiKey || "",
93
+ integration
94
+ });
64
95
  return {
65
- realtime: createRealTimeClient({
66
- baseUrl: parsedOptions.data.realtimeBaseUrl || "wss://api3.decart.ai",
67
- apiKey: apiKey || "",
68
- integration,
69
- logger,
70
- telemetryEnabled
71
- }),
72
- process: createProcessClient({
73
- baseUrl,
74
- apiKey: apiKey || "",
75
- integration
76
- }),
77
- queue: createQueueClient({
78
- baseUrl,
79
- apiKey: apiKey || "",
80
- integration
81
- }),
82
- tokens: createTokensClient({
83
- baseUrl,
84
- apiKey: apiKey || "",
85
- integration
86
- })
96
+ realtime: {
97
+ connect: realtimePublish.connect,
98
+ subscribe: realtimeSubscribe.subscribe
99
+ },
100
+ process,
101
+ queue,
102
+ tokens
87
103
  };
88
104
  };
89
-
90
105
  //#endregion
91
- export { ERROR_CODES, createConsoleLogger, createDecartClient, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, noopLogger, resolveCanonicalModelAlias, resolveModelAlias };
106
+ export { ERROR_CODES, createConsoleLogger, createDecartClient, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, noopLogger, resolveCanonicalModelAlias, resolveModelAlias };
@@ -1,7 +1,6 @@
1
1
  import { createInvalidInputError } from "../utils/errors.js";
2
2
  import { fileInputToBlob } from "../shared/request.js";
3
3
  import { sendRequest } from "./request.js";
4
-
5
4
  //#region src/process/client.ts
6
5
  const createProcessClient = (opts) => {
7
6
  const { apiKey, baseUrl, integration } = opts;
@@ -23,6 +22,5 @@ const createProcessClient = (opts) => {
23
22
  };
24
23
  return _process;
25
24
  };
26
-
27
25
  //#endregion
28
- export { createProcessClient };
26
+ export { createProcessClient };
@@ -1,6 +1,5 @@
1
1
  import { createSDKError } from "../utils/errors.js";
2
2
  import { buildAuthHeaders, buildFormData } from "../shared/request.js";
3
-
4
3
  //#region src/process/request.ts
5
4
  async function sendRequest({ baseUrl, apiKey, model, inputs, signal, integration }) {
6
5
  const formData = buildFormData(inputs);
@@ -21,6 +20,5 @@ async function sendRequest({ baseUrl, apiKey, model, inputs, signal, integration
21
20
  }
22
21
  return response.blob();
23
22
  }
24
-
25
23
  //#endregion
26
- export { sendRequest };
24
+ export { sendRequest };
@@ -2,7 +2,6 @@ import { createInvalidInputError } from "../utils/errors.js";
2
2
  import { fileInputToBlob } from "../shared/request.js";
3
3
  import { pollUntilComplete } from "./polling.js";
4
4
  import { getJobContent, getJobStatus, submitJob } from "./request.js";
5
-
6
5
  //#region src/queue/client.ts
7
6
  const createQueueClient = (opts) => {
8
7
  const { apiKey, baseUrl, integration } = opts;
@@ -68,6 +67,5 @@ const createQueueClient = (opts) => {
68
67
  submitAndPoll
69
68
  };
70
69
  };
71
-
72
70
  //#endregion
73
- export { createQueueClient };
71
+ export { createQueueClient };
@@ -35,6 +35,5 @@ async function pollUntilComplete({ checkStatus, getContent, onStatusChange, sign
35
35
  await sleep(POLLING_DEFAULTS.interval);
36
36
  }
37
37
  }
38
-
39
38
  //#endregion
40
- export { pollUntilComplete };
39
+ export { pollUntilComplete };
@@ -1,6 +1,5 @@
1
1
  import { createQueueResultError, createQueueStatusError, createQueueSubmitError } from "../utils/errors.js";
2
2
  import { buildAuthHeaders, buildFormData } from "../shared/request.js";
3
-
4
3
  //#region src/queue/request.ts
5
4
  /**
6
5
  * Submit a job to the queue.
@@ -68,6 +67,5 @@ async function getJobContent({ baseUrl, apiKey, jobId, signal, integration }) {
68
67
  }
69
68
  return response.blob();
70
69
  }
71
-
72
70
  //#endregion
73
- export { getJobContent, getJobStatus, submitJob };
71
+ export { getJobContent, getJobStatus, submitJob };
@@ -1,9 +1,9 @@
1
1
  import { CustomModelDefinition, ModelDefinition } from "../shared/model.js";
2
2
  import { DecartSDKError } from "../utils/errors.js";
3
- import { DiagnosticEvent } from "./diagnostics.js";
4
- import { ConnectionState } from "./types.js";
3
+ import { DiagnosticEvent } from "./observability/diagnostics.js";
4
+ import { WebRTCStats } from "./observability/webrtc-stats.js";
5
+ import { ConnectionState, GenerationEnded, GenerationTick, ImageSetOptions, QueuePosition } from "./types.js";
5
6
  import { SetInput } from "./methods.js";
6
- import { WebRTCStats } from "./webrtc-stats.js";
7
7
  import { z } from "zod";
8
8
 
9
9
  //#region src/realtime/client.d.ts
@@ -16,18 +16,27 @@ declare const realTimeClientInitialStateSchema: z.ZodObject<{
16
16
  image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<Blob, Blob>, z.ZodCustom<File, File>, z.ZodString]>>;
17
17
  }, z.core.$strip>;
18
18
  type OnRemoteStreamFn = (stream: MediaStream) => void;
19
+ type OnConnectionChangeFn = (state: ConnectionState) => void;
20
+ type OnQueuePositionFn = (queuePosition: QueuePosition) => void;
19
21
  type RealTimeClientInitialState = z.infer<typeof realTimeClientInitialStateSchema>;
20
22
  declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
21
23
  model: z.ZodObject<{
22
24
  name: z.ZodString;
23
25
  urlPath: z.ZodString;
24
26
  queueUrlPath: z.ZodOptional<z.ZodString>;
25
- fps: z.ZodNumber;
27
+ fps: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
28
+ max: z.ZodOptional<z.ZodNumber>;
29
+ min: z.ZodOptional<z.ZodNumber>;
30
+ ideal: z.ZodOptional<z.ZodNumber>;
31
+ exact: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strip>]>;
26
33
  width: z.ZodNumber;
27
34
  height: z.ZodNumber;
28
35
  inputSchema: z.ZodOptional<z.ZodAny>;
29
36
  }, z.core.$strip>;
30
37
  onRemoteStream: z.ZodCustom<OnRemoteStreamFn, OnRemoteStreamFn>;
38
+ onConnectionChange: z.ZodOptional<z.ZodCustom<OnConnectionChangeFn, OnConnectionChangeFn>>;
39
+ onQueuePosition: z.ZodOptional<z.ZodCustom<OnQueuePositionFn, OnQueuePositionFn>>;
31
40
  initialState: z.ZodOptional<z.ZodObject<{
32
41
  prompt: z.ZodOptional<z.ZodObject<{
33
42
  text: z.ZodString;
@@ -35,18 +44,22 @@ declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
35
44
  }, z.core.$strip>>;
36
45
  image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<Blob, Blob>, z.ZodCustom<File, File>, z.ZodString]>>;
37
46
  }, z.core.$strip>>;
38
- customizeOffer: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>, z.core.$InferInnerFunctionTypeAsync<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
47
+ queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
39
48
  mirror: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodBoolean]>>;
49
+ resolution: z.ZodOptional<z.ZodEnum<{
50
+ "720p": "720p";
51
+ "1080p": "1080p";
52
+ }>>;
40
53
  }, z.core.$strip>;
41
54
  type RealTimeClientConnectOptions = Omit<z.infer<typeof realTimeClientConnectOptionsSchema>, "model"> & {
42
55
  model: ModelDefinition | CustomModelDefinition;
43
56
  };
44
57
  type Events = {
45
58
  connectionChange: ConnectionState;
59
+ queuePosition: QueuePosition;
46
60
  error: DecartSDKError;
47
- generationTick: {
48
- seconds: number;
49
- };
61
+ generationTick: GenerationTick;
62
+ generationEnded: GenerationEnded;
50
63
  diagnostic: DiagnosticEvent;
51
64
  stats: WebRTCStats;
52
65
  };
@@ -64,11 +77,8 @@ type RealTimeClient = {
64
77
  off: <K extends keyof Events>(event: K, listener: (data: Events[K]) => void) => void;
65
78
  sessionId: string | null;
66
79
  subscribeToken: string | null;
67
- setImage: (image: Blob | File | string | null, options?: {
68
- prompt?: string;
69
- enhance?: boolean;
70
- timeout?: number;
71
- }) => Promise<void>;
80
+ getSubscribeToken: () => string | null;
81
+ setImage: (image: Blob | File | string | null, options?: ImageSetOptions) => Promise<void>;
72
82
  };
73
83
  //#endregion
74
84
  export { Events, RealTimeClient, RealTimeClientConnectOptions, RealTimeClientInitialState };