UNPKG

@openreplay/tracker-assist

Version:

Tracker plugin for screen assistance through the WebRTC

71 lines (70 loc) 2.35 kB
import type { Properties } from "csstype"; import { App } from "@openreplay/tracker"; import CallWindow from "./CallWindow.js"; import AnnotationCanvas from "./AnnotationCanvas.js"; import type { Options as ConfirmOptions } from "./ConfirmWindow/defaults.js"; type StartEndCallback = (agentInfo?: Record<string, any>) => (() => any) | void; export interface Options { onAgentConnect: StartEndCallback; onCallStart: StartEndCallback; onRemoteControlStart: StartEndCallback; onRecordingRequest?: (agentInfo: Record<string, any>) => any; onCallDeny?: () => any; onRemoteControlDeny?: (agentInfo: Record<string, any>) => any; onRecordingDeny?: (agentInfo: Record<string, any>) => any; onDragCamera?: (dx: number, dy: number) => void; session_calling_peer_key: string; session_control_peer_key: string; callConfirm: ConfirmOptions; controlConfirm: ConfirmOptions; recordingConfirm: ConfirmOptions; socketHost?: string; confirmText?: string; confirmStyle?: Properties; serverURL: string; callUITemplate?: string; compressionEnabled: boolean; /** * Minimum amount of messages in a batch to trigger compression run * @default 5000 */ compressionMinBatchSize: number; } export default class Assist { private readonly app; private readonly noSecureMode; readonly version = "11.0.12"; private socket; private calls; private canvasPeers; private canvasNodeCheckers; private assistDemandedRestart; private callingState; private remoteControl; private peerReconnectTimeout; private agents; private config; private readonly options; private readonly canvasMap; private iceCandidatesBuffer; private tabBus; private tabState; constructor(app: App, options?: Partial<Options>, noSecureMode?: boolean); private emit; private get agentsConnected(); private readonly setCallingState; private getHost; private getBasePrefixUrl; callUI: CallWindow | null; annot: AnnotationCanvas | null; private onStart; private setupPeerListeners; private playNotificationSound; private clean; private cleanCanvasConnections; private stopCanvasStream; private applyBufferedIceCandidates; private publishState; private handleTabStateMessage; } export {};