import type { IRtcEngineEx } from 'shengwang-electron-sdk'; import { AgoraObservable } from '../../../../imports'; import { createLogger } from '../../../../core/utilities/logger'; import { AgoraRtcClientRecordingConfig, AgoraRtcClientRecordingObserver } from '../../../../core/rtc/type'; import { AgoraRtcSourceManager } from '../../../../core/rtc/source-manager'; export type { AgoraRtcClientRecordingConfig, AgoraRtcClientRecordingObserver, } from '../../../../core/rtc/type'; type ModuleRequire = (module: string) => any; export declare const buildDefaultRecordingFileName: (now?: Date) => string; export declare const resolveDefaultRecordingStoragePath: (moduleRequire: ModuleRequire, logger?: Pick, "info" | "warn">) => string; /** * MediaRecorder manager for Electron platform. * Handles client-side recording using shengwang-electron-sdk's IMediaRecorder. */ export declare class AgoraElectronMediaRecorderManager { private _rtcEngine; private _sourceManager; protected logger: import("agora-foundation/lib/logger/type").Logger; protected observable: AgoraObservable; private _mediaRecorder?; private _mediaRecorderObserver?; private _isRecordingStarted; private _clientRecordingSourceId?; private _clientRecordingCaptureType?; private _clientRecordingOwnsCapture; private _recorderGeneration; private _lastRecordingConfig?; private _channelId?; private _uid?; constructor(_rtcEngine: IRtcEngineEx, _sourceManager: AgoraRtcSourceManager); /** * Add an observer for client recording events. */ addObserver(observer: AgoraRtcClientRecordingObserver): void; /** * Remove an observer for client recording events. */ removeObserver(observer: AgoraRtcClientRecordingObserver): void; /** * Check whether client recording is currently active. */ isLocalClientRecordingActive(): boolean; /** * Check whether client recording owns its own screen capture. */ isClientRecordingOwnsCapture(): boolean; /** * Start client recording. * @param channelId The channel ID * @param uid The user ID * @param config Recording configuration * @param isScreenShareActive Whether screen sharing is currently active * @param currentScreenShareSourceId Current screen share source ID if active */ startClientRecording(channelId: string, uid: number, config?: AgoraRtcClientRecordingConfig, isScreenShareActive?: boolean, currentScreenShareSourceId?: string): Promise; /** * Stop client recording. */ stopClientRecording(): Promise; /** * Resume recording's own window capture after it was released. * Called when screen sharing stops but recording should continue. */ resumeOwnCapture(): Promise; /** * Release the recording's own screen/window capture without stopping the recording. * Called before starting screen share to free the capture resource. */ releaseOwnCapture(): void; /** * Release resources. Synchronously stops recording and cleans up. */ release(): void; private _createMediaRecorder; private _setupMediaRecorderObserver; private _startRecording; /** * 查找当前窗口的信息(包括 ID 和尺寸) * 优先通过 Electron API 直接获取当前窗口信息,避免调用 getScreenCaptureSources * 触发 macOS 的屏幕录制/辅助功能权限弹窗。 * 仅在直接获取失败时才 fallback 到枚举所有窗口。 */ private _findCurrentWindowInfo; /** * 直接通过 Electron 的 getCurrentWindow API 获取当前窗口信息。 * 不调用 getScreenCaptureSources,因此不会触发 macOS 权限弹窗。 */ private _getCurrentWindowInfoDirect; /** * 通过 electron 的 mediaSourceId 获取当前窗口信息 * @param windowList 窗口列表 */ private _pickCurrentWindowInfo; private _getDefaultStoragePath; }