import {
  JazzSdkPlugin,
  JazzSdkElectronMain,
  LogLevel,
  LogEvent,
} from '@salutejs/jazz-sdk-electron/main';

type JazzSdkDesktopCapturerSourceType = 'screen' | 'window';
type JazzSdkDesktopCapturerSource = Readonly<{
  id: string;
  type: JazzSdkDesktopCapturerSourceType;
  name: string;
  displayId: string;
  image?: string;
}>;

declare function desktopCapturerPlugin(): JazzSdkPlugin;

type DesktopCapturerService = {
  getLastSelectedSources: () => JazzSdkDesktopCapturerSource[];
};

declare const getDesktopCapturerService: (
  sdkElectron: JazzSdkElectronMain,
) => DesktopCapturerService;

type LogsPluginOptions = Readonly<{
  /**
   * @default 'info'
   */
  logLevel?: LogLevel;
  /**
   * @default true
   */
  isEnableStdout?: boolean;
  subscribe?: (event: LogEvent) => void;
}>;
/**
 * Позволяет подписаться на события логов в JazzSDK
 */
declare function logsPlugin(options?: LogsPluginOptions): JazzSdkPlugin;

export {
  type DesktopCapturerService,
  type LogsPluginOptions,
  desktopCapturerPlugin,
  getDesktopCapturerService,
  logsPlugin,
};
