@xmaxai/sdk 1.0.1 → 1.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/CHANGELOG.md +10 -2
- package/README.md +9 -5
- package/dist/{chunk-V4NR6CPP.js → chunk-F567ONBH.js} +7 -184
- package/dist/chunk-F567ONBH.js.map +1 -0
- package/dist/{chunk-LCPC56BK.js → chunk-TFGYBN3Q.js} +493 -136
- package/dist/chunk-TFGYBN3Q.js.map +1 -0
- package/dist/index.cjs +30 -272
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +369 -8
- package/dist/index.d.ts +369 -8
- package/dist/index.js +1003 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +9 -271
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -3
- package/dist/react/index.d.ts +1 -3
- package/dist/react/index.js +6 -26
- package/dist/react/index.js.map +1 -1
- package/dist/{rtc-manager-gYDkADGw.d.ts → rtc-manager-DnQoznIg.d.cts} +2 -17
- package/dist/{rtc-manager-gYDkADGw.d.cts → rtc-manager-DnQoznIg.d.ts} +2 -17
- package/dist/video-file-stream-4TAGKL2Q.js +3 -0
- package/dist/{video-file-stream-K7GQMIJ5.js.map → video-file-stream-4TAGKL2Q.js.map} +1 -1
- package/package.json +1 -6
- package/dist/chunk-4YHBCQ2C.js +0 -432
- package/dist/chunk-4YHBCQ2C.js.map +0 -1
- package/dist/chunk-LCPC56BK.js.map +0 -1
- package/dist/chunk-V4NR6CPP.js.map +0 -1
- package/dist/chunk-VLJZ56PT.js +0 -997
- package/dist/chunk-VLJZ56PT.js.map +0 -1
- package/dist/experimental/index.cjs +0 -3897
- package/dist/experimental/index.cjs.map +0 -1
- package/dist/experimental/index.d.cts +0 -2
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/index.js +0 -5
- package/dist/experimental/index.js.map +0 -1
- package/dist/index-Cw8C8LbO.d.ts +0 -367
- package/dist/index-Dg1ElHAj.d.cts +0 -367
- package/dist/video-file-stream-K7GQMIJ5.js +0 -4
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { D as DragTrackController, a as DragTrackControllerOptions, R as RealtimeConnectOptions, b as RealtimeInitialState, c as RealtimeModel, d as RealtimePrewarmHandle, e as RealtimePromptState, f as RealtimeRestartOptions, g as RealtimeSession, h as RealtimeSetImageOptions, i as RealtimeSetInput, j as RealtimeSetModeOptions, k as RemoteViewHost, X as XmaxClient, l as XmaxClientFiles, m as XmaxClientOptions, n as XmaxRealtimeSession, o as createDragTrackController, q as createRemoteViewHost, r as createXmaxClient, s as getContentRect, t as mapTargetPointToCanvas, u as mapViewportPointToCoordinateSpace, v as models, w as observeDragSurfaceVideoSync, y as syncDragSurfaceToVideo } from '../index-Dg1ElHAj.cjs';
|
|
2
|
-
import '../rtc-manager-gYDkADGw.cjs';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { D as DragTrackController, a as DragTrackControllerOptions, R as RealtimeConnectOptions, b as RealtimeInitialState, c as RealtimeModel, d as RealtimePrewarmHandle, e as RealtimePromptState, f as RealtimeRestartOptions, g as RealtimeSession, h as RealtimeSetImageOptions, i as RealtimeSetInput, j as RealtimeSetModeOptions, k as RemoteViewHost, X as XmaxClient, l as XmaxClientFiles, m as XmaxClientOptions, n as XmaxRealtimeSession, o as createDragTrackController, q as createRemoteViewHost, r as createXmaxClient, s as getContentRect, t as mapTargetPointToCanvas, u as mapViewportPointToCoordinateSpace, v as models, w as observeDragSurfaceVideoSync, y as syncDragSurfaceToVideo } from '../index-Cw8C8LbO.js';
|
|
2
|
-
import '../rtc-manager-gYDkADGw.js';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { RealtimePrewarmHandle, RealtimeSession, createRemoteViewHost, createXmaxClient, observeDragSurfaceVideoSync, syncDragSurfaceToVideo } from '../chunk-VLJZ56PT.js';
|
|
2
|
-
export { createDragTrackController, getContentRect, mapTargetPointToCanvas, mapViewportPointToCoordinateSpace, models } from '../chunk-V4NR6CPP.js';
|
|
3
|
-
import '../chunk-LCPC56BK.js';
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index-Cw8C8LbO.d.ts
DELETED
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import { a as SDKI18n, b as XmaxOpenClient, u as RtcManager, X as XmaxErrorNotifier, U as UploadImageResult, y as UploadVideoResult } from './rtc-manager-gYDkADGw.js';
|
|
2
|
-
|
|
3
|
-
type NativeCameraStream = {
|
|
4
|
-
sourceStream: MediaStream;
|
|
5
|
-
previewStream: MediaStream;
|
|
6
|
-
videoTrack: MediaStreamTrack;
|
|
7
|
-
videoEl: HTMLVideoElement;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
destroy: () => void;
|
|
11
|
-
};
|
|
12
|
-
type OpenNativeCameraStreamOptions = {
|
|
13
|
-
width?: number;
|
|
14
|
-
height?: number;
|
|
15
|
-
frameRate?: number;
|
|
16
|
-
facingMode?: ConstrainDOMString;
|
|
17
|
-
i18n?: SDKI18n;
|
|
18
|
-
};
|
|
19
|
-
declare function openNativeCameraStream(options?: OpenNativeCameraStreamOptions): Promise<NativeCameraStream>;
|
|
20
|
-
declare function createNativeCameraStream(sourceStream: MediaStream, options?: {
|
|
21
|
-
i18n?: SDKI18n;
|
|
22
|
-
}): Promise<NativeCameraStream>;
|
|
23
|
-
|
|
24
|
-
type PrewarmedRoomResources = {
|
|
25
|
-
client: XmaxOpenClient;
|
|
26
|
-
rtc: RtcManager;
|
|
27
|
-
sessionUid: string;
|
|
28
|
-
};
|
|
29
|
-
/** Holds a joined RTC room before camera input is attached — iOS enterRoom-at-launch equivalent. */
|
|
30
|
-
declare class RealtimePrewarmHandle {
|
|
31
|
-
readonly client: XmaxOpenClient;
|
|
32
|
-
readonly rtc: RtcManager;
|
|
33
|
-
readonly sessionUid: string;
|
|
34
|
-
readonly modelName: string;
|
|
35
|
-
private consumed;
|
|
36
|
-
private disposed;
|
|
37
|
-
private constructor();
|
|
38
|
-
static create(model: RealtimeModel, clientOptions: XmaxClientOptions): Promise<RealtimePrewarmHandle>;
|
|
39
|
-
consume(expectedModelName: string): PrewarmedRoomResources | null;
|
|
40
|
-
cancel(): Promise<void>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type RealtimeModel = {
|
|
44
|
-
name: string;
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
fps?: number;
|
|
48
|
-
};
|
|
49
|
-
type RealtimePromptState = {
|
|
50
|
-
text: string;
|
|
51
|
-
enhance?: boolean;
|
|
52
|
-
};
|
|
53
|
-
type RemoteSeiReceivedPayload = {
|
|
54
|
-
sei: string;
|
|
55
|
-
userId: string;
|
|
56
|
-
};
|
|
57
|
-
type SeiGateState = {
|
|
58
|
-
expectedSei: string | null;
|
|
59
|
-
sei: string | null;
|
|
60
|
-
userId: string | null;
|
|
61
|
-
matched: boolean;
|
|
62
|
-
};
|
|
63
|
-
type XmaxClientOptions = {
|
|
64
|
-
apiKey: string;
|
|
65
|
-
/** @default {@link XMAX_OPEN_API_PRODUCTION_BASE_URL} */
|
|
66
|
-
baseUrl?: string;
|
|
67
|
-
authToken?: string;
|
|
68
|
-
heartbeatIntervalMs?: number;
|
|
69
|
-
onError?: XmaxErrorNotifier;
|
|
70
|
-
onLog?: (entry: {
|
|
71
|
-
scope: 'client' | 'rtc';
|
|
72
|
-
level: 'info' | 'success' | 'warn' | 'error';
|
|
73
|
-
message: string;
|
|
74
|
-
data?: unknown;
|
|
75
|
-
}) => void;
|
|
76
|
-
/** Fired when H.264 SEI is received on the remote backend/bot output stream (not local publish). */
|
|
77
|
-
onRemoteSei?: (payload: RemoteSeiReceivedPayload) => void;
|
|
78
|
-
/** Fired when remote SEI gate state changes. */
|
|
79
|
-
onSeiGateChange?: (state: SeiGateState) => void;
|
|
80
|
-
/** Cleared when generation start completes; used to reset host loading state set before connect. */
|
|
81
|
-
onPublishPipelineWaitChange?: (waiting: boolean) => void;
|
|
82
|
-
};
|
|
83
|
-
type RealtimeInitialState = {
|
|
84
|
-
/** Legacy string prompt or Decart-style `{ text, enhance? }`. */
|
|
85
|
-
prompt?: string | RealtimePromptState;
|
|
86
|
-
/** Legacy reference image path or URL. */
|
|
87
|
-
refImage?: string;
|
|
88
|
-
/** Decart-style reference image (path, URL, File, or Blob). */
|
|
89
|
-
image?: string | File | Blob;
|
|
90
|
-
/** When true, send a start event immediately after connect. */
|
|
91
|
-
autoStart?: boolean;
|
|
92
|
-
/** @internal Business model label in RTC start params; optional — SDK uses a default when omitted. */
|
|
93
|
-
model?: string;
|
|
94
|
-
/** MoX instant — when `true`, sent as `static_generate` on connect start only (never cached). */
|
|
95
|
-
staticGenerate?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* MoX instant — uploaded source still URL (COS). Sent as `static_image_path` on connect
|
|
98
|
-
* start only (never cached). Local RTC publish is still used for preview / room compatibility.
|
|
99
|
-
*/
|
|
100
|
-
staticImagePath?: string;
|
|
101
|
-
};
|
|
102
|
-
type RealtimeConnectOptions = {
|
|
103
|
-
model: RealtimeModel;
|
|
104
|
-
localElement?: HTMLElement;
|
|
105
|
-
remoteElement?: HTMLElement;
|
|
106
|
-
onRemoteStream?: (stream: MediaStream) => void;
|
|
107
|
-
initialState?: RealtimeInitialState;
|
|
108
|
-
size?: [number, number];
|
|
109
|
-
/** Mobile H5 uses 24fps publish; web uses 30fps. Auto-detected from viewport when omitted. */
|
|
110
|
-
mobile?: boolean;
|
|
111
|
-
/** `file` = pre-processed canvas stream (upload). `camera` = normalize via crop/mirror pipeline. */
|
|
112
|
-
inputKind?: 'camera' | 'file';
|
|
113
|
-
/** Pre-flip input video: `false` (default), `"auto"`, or `true`. */
|
|
114
|
-
mirror?: 'auto' | boolean;
|
|
115
|
-
/** @deprecated Use {@link RealtimeConnectOptions.mirror} instead. */
|
|
116
|
-
mirrorInput?: boolean;
|
|
117
|
-
/** Reuse an already prepared camera publish pipeline (mirror/crop canvas). */
|
|
118
|
-
prebuiltCameraStream?: NativeCameraStream;
|
|
119
|
-
/**
|
|
120
|
-
* Enable drag on {@link RealtimeConnectOptions.remoteElement} after generation starts.
|
|
121
|
-
* Defaults to `true` when `remoteElement` is provided; `false` for `onRemoteStream`-only connects.
|
|
122
|
-
*/
|
|
123
|
-
drag?: boolean;
|
|
124
|
-
/** Reuse a prewarmed RTC room from {@link XmaxClient.realtime.prewarm}. */
|
|
125
|
-
prewarmed?: RealtimePrewarmHandle;
|
|
126
|
-
};
|
|
127
|
-
type RealtimeRestartOptions = {
|
|
128
|
-
/** Pass `null` or `''` to clear the stored reference image. */
|
|
129
|
-
refImage?: string | null;
|
|
130
|
-
prompt?: string;
|
|
131
|
-
/** @internal Optional business model label; SDK uses a default when omitted. */
|
|
132
|
-
model?: string;
|
|
133
|
-
size?: [number, number];
|
|
134
|
-
/**
|
|
135
|
-
* MoX instant — when `true`, sent as `static_generate` on this start only (never cached).
|
|
136
|
-
* Omit on non-Instant starts.
|
|
137
|
-
*/
|
|
138
|
-
staticGenerate?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* MoX instant — COS URL sent as `static_image_path` on this start only (never cached).
|
|
141
|
-
* Omit on non-Instant starts.
|
|
142
|
-
*/
|
|
143
|
-
staticImagePath?: string;
|
|
144
|
-
/** Keep the last rendered remote frame visible while waiting for the next start output. */
|
|
145
|
-
preserveRemoteOutput?: boolean;
|
|
146
|
-
};
|
|
147
|
-
/** @deprecated Use {@link RealtimeRestartOptions} */
|
|
148
|
-
type RealtimeSetModeOptions = RealtimeRestartOptions;
|
|
149
|
-
type RealtimeSetInput = {
|
|
150
|
-
prompt?: string | RealtimePromptState;
|
|
151
|
-
image?: string | File | Blob | null;
|
|
152
|
-
enhance?: boolean;
|
|
153
|
-
};
|
|
154
|
-
type RealtimeSetImageOptions = {
|
|
155
|
-
prompt?: string | RealtimePromptState;
|
|
156
|
-
enhance?: boolean;
|
|
157
|
-
};
|
|
158
|
-
type RealtimeDisconnectOptions = {
|
|
159
|
-
/** @deprecated Session always destroys its publish pipeline; raw input is owned by the host app. */
|
|
160
|
-
preserveLocalInput?: boolean;
|
|
161
|
-
};
|
|
162
|
-
type XmaxRealtimeSession = {
|
|
163
|
-
setPrompt: (prompt: string | RealtimePromptState, options?: {
|
|
164
|
-
enhance?: boolean;
|
|
165
|
-
}) => Promise<void>;
|
|
166
|
-
set: (input: RealtimeSetInput) => Promise<void>;
|
|
167
|
-
setImage: (image: string | File | Blob, options?: RealtimeSetImageOptions) => Promise<void>;
|
|
168
|
-
restart: (options?: RealtimeRestartOptions) => Promise<void>;
|
|
169
|
-
/** @deprecated Use {@link XmaxRealtimeSession.restart} */
|
|
170
|
-
setMode: (options?: RealtimeRestartOptions) => Promise<void>;
|
|
171
|
-
setRefImage: (input: File | string) => Promise<string>;
|
|
172
|
-
sendTracks: (tracks: Array<[number, number]>) => Promise<void>;
|
|
173
|
-
/** Re-bind the remote output container (call after output should be visible). */
|
|
174
|
-
refreshRemoteOutput: (options?: {
|
|
175
|
-
force?: boolean;
|
|
176
|
-
}) => Promise<void>;
|
|
177
|
-
/** Re-bind local preview (call after PiP container is visible). */
|
|
178
|
-
refreshLocalPreview: () => void;
|
|
179
|
-
/** Processed canvas stream for local PiP (camera pipeline); null for file input. */
|
|
180
|
-
getInputPreviewStream: () => MediaStream | null;
|
|
181
|
-
/** Detach remote output from the RTC player. */
|
|
182
|
-
detachRemoteOutput: () => void;
|
|
183
|
-
/** Active server session uid, if connected. */
|
|
184
|
-
getSessionUid: () => string | null;
|
|
185
|
-
stop: () => Promise<void>;
|
|
186
|
-
disconnect: (options?: RealtimeDisconnectOptions) => Promise<void>;
|
|
187
|
-
};
|
|
188
|
-
type XmaxClientFiles = {
|
|
189
|
-
uploadImage: (file: File) => Promise<UploadImageResult>;
|
|
190
|
-
uploadVideo: (file: File) => Promise<UploadVideoResult>;
|
|
191
|
-
/** Decart-style alias for {@link XmaxClientFiles.uploadImage}. */
|
|
192
|
-
upload: (file: File) => Promise<UploadImageResult>;
|
|
193
|
-
};
|
|
194
|
-
type XmaxClient = {
|
|
195
|
-
files: XmaxClientFiles;
|
|
196
|
-
realtime: {
|
|
197
|
-
/** Join RTC room before camera input — call on explicit user action to avoid idle billing. */
|
|
198
|
-
prewarm: (options: {
|
|
199
|
-
model: RealtimeModel;
|
|
200
|
-
}) => Promise<RealtimePrewarmHandle>;
|
|
201
|
-
connect: (stream: MediaStream, options: RealtimeConnectOptions) => Promise<XmaxRealtimeSession>;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
declare const models: {
|
|
206
|
-
realtime(name: string, options?: {
|
|
207
|
-
width?: number;
|
|
208
|
-
height?: number;
|
|
209
|
-
fps?: number;
|
|
210
|
-
}): RealtimeModel;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
declare class RealtimeSession implements XmaxRealtimeSession {
|
|
214
|
-
private readonly client;
|
|
215
|
-
private readonly rtc;
|
|
216
|
-
private readonly reportError;
|
|
217
|
-
private readonly remoteElement;
|
|
218
|
-
private readonly onRemoteStream?;
|
|
219
|
-
private readonly onPublishPipelineWaitChange?;
|
|
220
|
-
private sessionUid;
|
|
221
|
-
private taskUid;
|
|
222
|
-
private localVideoSize;
|
|
223
|
-
private currentPrompt;
|
|
224
|
-
private currentGenerationModel;
|
|
225
|
-
private disconnected;
|
|
226
|
-
private remoteViewHost;
|
|
227
|
-
private dragController;
|
|
228
|
-
private dragTrackFitMode;
|
|
229
|
-
private sessionTargetSize;
|
|
230
|
-
private sessionSizeOverride;
|
|
231
|
-
private mirroredInputStream;
|
|
232
|
-
private hiddenRemoteElement;
|
|
233
|
-
private remoteStreamNotifyTimer;
|
|
234
|
-
private lastNotifiedRemoteStream;
|
|
235
|
-
private dragOption;
|
|
236
|
-
constructor(client: XmaxOpenClient, rtc: RtcManager, reportError: (error: unknown, fallbackMessage?: string) => never, options: Pick<RealtimeConnectOptions, 'remoteElement' | 'onRemoteStream' | 'drag'>, clientOptions?: Pick<XmaxClientOptions, 'onPublishPipelineWaitChange'>);
|
|
237
|
-
private get remoteVideoContainer();
|
|
238
|
-
static connect(stream: MediaStream, options: RealtimeConnectOptions, clientOptions: XmaxClientOptions): Promise<RealtimeSession>;
|
|
239
|
-
private bootstrap;
|
|
240
|
-
setPrompt(prompt: string | RealtimePromptState, _options?: {
|
|
241
|
-
enhance?: boolean;
|
|
242
|
-
}): Promise<void>;
|
|
243
|
-
set(input: RealtimeSetInput): Promise<void>;
|
|
244
|
-
setImage(image: string | File | Blob, options?: RealtimeSetImageOptions): Promise<void>;
|
|
245
|
-
setRefImage(input: File | string): Promise<string>;
|
|
246
|
-
restart(options?: RealtimeRestartOptions): Promise<void>;
|
|
247
|
-
setMode(options?: RealtimeRestartOptions): Promise<void>;
|
|
248
|
-
refreshRemoteOutput(options?: {
|
|
249
|
-
force?: boolean;
|
|
250
|
-
}): Promise<void>;
|
|
251
|
-
refreshLocalPreview(): void;
|
|
252
|
-
getInputPreviewStream(): MediaStream | null;
|
|
253
|
-
detachRemoteOutput(): void;
|
|
254
|
-
sendTracks(tracks: Array<[number, number]>): Promise<void>;
|
|
255
|
-
stop(options?: {
|
|
256
|
-
preserveRemoteDom?: boolean;
|
|
257
|
-
}): Promise<void>;
|
|
258
|
-
disconnect(options?: RealtimeDisconnectOptions): Promise<void>;
|
|
259
|
-
getSessionUid(): string | null;
|
|
260
|
-
private runStart;
|
|
261
|
-
private isDragEnabled;
|
|
262
|
-
private updateDragController;
|
|
263
|
-
private scheduleNotifyRemoteStream;
|
|
264
|
-
private notifyRemoteStreamOnce;
|
|
265
|
-
private clearRemoteStreamNotifyTimer;
|
|
266
|
-
private safeDisconnect;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
declare function createXmaxClient(options: XmaxClientOptions): XmaxClient;
|
|
270
|
-
|
|
271
|
-
type DragTrackControllerOptions = {
|
|
272
|
-
targetSize: [number, number];
|
|
273
|
-
fitMode?: 'contain' | 'cover';
|
|
274
|
-
mirrored?: boolean;
|
|
275
|
-
enabled?: boolean;
|
|
276
|
-
onTracks: (tracks: Array<[number, number]>) => void | Promise<void>;
|
|
277
|
-
/** Fired once when a real drag stroke begins (first pointer down). */
|
|
278
|
-
onStrokeStart?: () => void | Promise<void>;
|
|
279
|
-
/** Fired once when a real drag stroke ends (pointer up/cancel), not on disable/destroy. */
|
|
280
|
-
onStrokeEnd?: () => void | Promise<void>;
|
|
281
|
-
};
|
|
282
|
-
declare class DragTrackController {
|
|
283
|
-
private readonly container;
|
|
284
|
-
private readonly canvas;
|
|
285
|
-
private readonly onTracks;
|
|
286
|
-
private readonly onStrokeStart;
|
|
287
|
-
private readonly onStrokeEnd;
|
|
288
|
-
private strokeActive;
|
|
289
|
-
private targetSize;
|
|
290
|
-
private fitMode;
|
|
291
|
-
private mirrored;
|
|
292
|
-
private enabled;
|
|
293
|
-
private readonly activePointers;
|
|
294
|
-
private readonly lastTargetPoints;
|
|
295
|
-
private readonly segQueue;
|
|
296
|
-
private sampleTimer;
|
|
297
|
-
private sampleInFlight;
|
|
298
|
-
private rafId;
|
|
299
|
-
private resizeObserver;
|
|
300
|
-
private readonly onWindowResize;
|
|
301
|
-
private readonly onPointerDown;
|
|
302
|
-
private readonly onPointerMove;
|
|
303
|
-
private readonly onPointerUp;
|
|
304
|
-
private readonly onPointerCancel;
|
|
305
|
-
constructor(container: HTMLElement, options: DragTrackControllerOptions);
|
|
306
|
-
setEnabled(enabled: boolean): void;
|
|
307
|
-
setTargetSize(targetSize: [number, number]): void;
|
|
308
|
-
setFitMode(fitMode: 'contain' | 'cover'): void;
|
|
309
|
-
setMirrored(mirrored: boolean): void;
|
|
310
|
-
destroy(): void;
|
|
311
|
-
private applyInteractionStyle;
|
|
312
|
-
private bindResizeObserver;
|
|
313
|
-
private unbindResizeObserver;
|
|
314
|
-
private bindPointerEvents;
|
|
315
|
-
private unbindPointerEvents;
|
|
316
|
-
private clearCanvas;
|
|
317
|
-
private resizeCanvas;
|
|
318
|
-
private toTargetPoint;
|
|
319
|
-
private stopDrawLoop;
|
|
320
|
-
private startDrawLoop;
|
|
321
|
-
private stopSampling;
|
|
322
|
-
private collectCurrentTracks;
|
|
323
|
-
private flushTracks;
|
|
324
|
-
private startSampling;
|
|
325
|
-
private finishStroke;
|
|
326
|
-
private handlePointerDown;
|
|
327
|
-
private handlePointerMove;
|
|
328
|
-
private handlePointerUp;
|
|
329
|
-
private handlePointerCancel;
|
|
330
|
-
}
|
|
331
|
-
declare function createDragTrackController(container: HTMLElement, options: DragTrackControllerOptions): DragTrackController;
|
|
332
|
-
|
|
333
|
-
type ContentRect = {
|
|
334
|
-
left: number;
|
|
335
|
-
top: number;
|
|
336
|
-
width: number;
|
|
337
|
-
height: number;
|
|
338
|
-
};
|
|
339
|
-
type MapViewportOptions = {
|
|
340
|
-
fitMode?: 'contain' | 'cover';
|
|
341
|
-
/** Flip X when the output video is horizontally mirrored in CSS (xmax-open-sdk remote overlay). */
|
|
342
|
-
mirrored?: boolean;
|
|
343
|
-
};
|
|
344
|
-
/** @deprecated Use {@link getFitContentRect} with fitMode `contain`. */
|
|
345
|
-
declare function getContentRect(rect: Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>, targetSize: [number, number]): ContentRect;
|
|
346
|
-
declare function mapViewportPointToCoordinateSpace(e: Pick<PointerEvent, 'clientX' | 'clientY'>, container: HTMLElement, targetSize: [number, number], options?: MapViewportOptions): [number, number] | null;
|
|
347
|
-
/** Inverse of mapViewportPointToCoordinateSpace — target coords to canvas pixels (CSS space × dpr). */
|
|
348
|
-
declare function mapTargetPointToCanvas(point: [number, number], container: HTMLElement, targetSize: [number, number], dpr: number, options?: MapViewportOptions): [number, number] | null;
|
|
349
|
-
|
|
350
|
-
type RemoteViewHost = {
|
|
351
|
-
wrapper: HTMLElement;
|
|
352
|
-
videoHost: HTMLElement;
|
|
353
|
-
dragHost: HTMLElement;
|
|
354
|
-
};
|
|
355
|
-
declare function createRemoteViewHost(wrapper: HTMLElement): RemoteViewHost;
|
|
356
|
-
|
|
357
|
-
type DragVideoSyncOptions = {
|
|
358
|
-
getTargetSize: () => [number, number];
|
|
359
|
-
getFitMode: () => 'contain' | 'cover';
|
|
360
|
-
onSync?: () => void;
|
|
361
|
-
};
|
|
362
|
-
/** Align app-layer drag overlay to the painted RTC media region (xmax-open-sdk track surface). */
|
|
363
|
-
declare function syncDragSurfaceToVideo(dragSurface: HTMLElement, targetSize: [number, number], fitMode: 'contain' | 'cover'): boolean;
|
|
364
|
-
/** Keep an app-layer drag surface aligned with remote output video layout. */
|
|
365
|
-
declare function observeDragSurfaceVideoSync(dragSurface: HTMLElement, options: DragVideoSyncOptions): () => void;
|
|
366
|
-
|
|
367
|
-
export { DragTrackController as D, type NativeCameraStream as N, type OpenNativeCameraStreamOptions as O, type RealtimeConnectOptions as R, type XmaxClient as X, type DragTrackControllerOptions as a, type RealtimeInitialState as b, type RealtimeModel as c, RealtimePrewarmHandle as d, type RealtimePromptState as e, type RealtimeRestartOptions as f, RealtimeSession as g, type RealtimeSetImageOptions as h, type RealtimeSetInput as i, type RealtimeSetModeOptions as j, type RemoteViewHost as k, type XmaxClientFiles as l, type XmaxClientOptions as m, type XmaxRealtimeSession as n, createDragTrackController as o, createNativeCameraStream as p, createRemoteViewHost as q, createXmaxClient as r, getContentRect as s, mapTargetPointToCanvas as t, mapViewportPointToCoordinateSpace as u, models as v, observeDragSurfaceVideoSync as w, openNativeCameraStream as x, syncDragSurfaceToVideo as y };
|