UNPKG

@getexcited/chompers

Version:

High-performance native Node.js addon for Windows screen recording and window enumeration

92 lines (89 loc) 2.59 kB
/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ export interface AudioInputDevice { id: string name: string } export interface VideoEncoder { name: string encoderType: string } export const enum VideoEncoderType { H264 = 'H264', HEVC = 'HEVC' } export const enum AudioSource { Desktop = 'Desktop', ActiveWindow = 'ActiveWindow' } export interface RecorderConfig { fpsNumerator: number fpsDenominator: number inputWidth?: number inputHeight?: number outputWidth: number outputHeight: number captureAudio: boolean captureMicrophone: boolean audioSource: AudioSource microphoneVolume?: number systemVolume?: number microphoneDevice?: string videoEncoderType?: VideoEncoderType videoEncoderName?: string captureCursor: boolean outputPath: string debugMode: boolean enableReplayBuffer: boolean replayBufferSeconds?: number } export declare function enumerateAudioInputDevices(): Array<AudioInputDevice> export declare function enumerateVideoEncoders(): Array<VideoEncoder> export declare function getPreferredVideoEncoderByType(encoderType: VideoEncoderType): VideoEncoder | null export interface MonitorDimensions { width: number height: number index: number } export interface WindowInfo { className: string executable: string title: string pid: number productName?: string hwnd: number fullExe: string monitorDimensions: MonitorDimensions intersectsMultiple: boolean focused: boolean arguments: Array<string> } export declare function getAllWindows(): Array<WindowInfo> export declare class Recorder { constructor(config: RecorderConfig) withProcessName(processName: string): Recorder startRecording(): void stopRecording(): void saveReplay(path: string): void } export declare class RecorderConfigBuilder { constructor() fps(numerator: number, denominator: number): this inputDimensions(width: number, height: number): this outputDimensions(width: number, height: number): this captureAudio(capture: boolean): this captureMicrophone(capture: boolean): this audioSource(source: AudioSource): this microphoneVolume(volume: number): this systemVolume(volume: number): this microphoneDevice(deviceName?: string | undefined | null): this videoEncoder(encoderType: VideoEncoderType): this videoEncoderName(name: string): this captureCursor(capture: boolean): this outputPath(path: string): this debugMode(debug: boolean): this enableReplayBuffer(enable: boolean): this replayBufferSeconds(seconds: number): this build(): RecorderConfig }