import type { AVPixelFormat, AVSampleFormat } from '../constants/constants.js';
/**
 * Screen bounds rectangle
 */
export interface ScreenBounds {
    x: number;
    y: number;
    width: number;
    height: number;
}
/**
 * Base device information
 */
export interface BaseDeviceInfo {
    name: string;
    description: string;
    isDefault: boolean;
}
/**
 * Device information for video capture devices
 */
export interface VideoDeviceInfo extends BaseDeviceInfo {
    type: 'video';
}
/**
 * Device information for audio capture devices
 */
export interface AudioDeviceInfo extends BaseDeviceInfo {
    type: 'audio';
}
/**
 * Device information for screen capture devices
 */
export interface ScreenDeviceInfo extends BaseDeviceInfo {
    type: 'screen';
    bounds: ScreenBounds;
}
/**
 * Device information for capture devices
 */
export type DeviceInfo = VideoDeviceInfo | AudioDeviceInfo | ScreenDeviceInfo;
/**
 * Device capture mode
 */
export interface DeviceMode {
    width: number;
    height: number;
    minFrameRate: number;
    maxFrameRate: number;
    pixelFormat: AVPixelFormat;
}
/**
 * Audio device capture mode
 */
export interface AudioDeviceMode {
    sampleRate: number;
    channels: number;
    sampleFormat: AVSampleFormat;
}
/**
 * Low-level device enumeration and format detection.
 *
 * Provides direct access to system capture devices (cameras, microphones)
 * and platform-specific input format names for FFmpeg.
 *
 * Direct mapping to platform-specific APIs:
 * - macOS: AVFoundation
 * - Linux: V4L2/ALSA
 * - Windows: DirectShow
 *
 * @example
 * ```typescript
 * import { Device } from 'node-av/lib';
 *
 * // List all capture devices
 * const devices = await Device.list();
 * for (const device of devices) {
 *   console.log(`[${device.type}] ${device.name}: ${device.description}`);
 * }
 *
 * // Get platform-specific format names
 * console.log(`Video format: ${Device.getVideoFormat()}`);
 * console.log(`Audio format: ${Device.getAudioFormat()}`);
 * console.log(`Screen format: ${Device.getScreenFormat()}`);
 * ```
 *
 * @see {@link DeviceInfo} For device structure
 */
export declare class Device {
    /**
     * List all available capture devices.
     *
     * Enumerates video and audio capture devices on the system.
     * Uses platform-specific APIs for device discovery.
     *
     * @returns Array of device information
     *
     * @example
     * ```typescript
     * const devices = await Device.list();
     * const cameras = devices.filter(d => d.type === 'video');
     * const microphones = devices.filter(d => d.type === 'audio');
     * ```
     */
    static list(): Promise<DeviceInfo[]>;
    /**
     * List all available capture devices synchronously.
     *
     * @returns Array of device information
     *
     * @example
     * ```typescript
     * const devices = Device.listSync();
     * ```
     *
     * @see {@link list} For async version
     */
    static listSync(): DeviceInfo[];
    /**
     * Query supported capture modes for a video device.
     *
     * Returns supported resolutions and frame rate ranges for the specified device.
     * Modes are sorted descending by resolution (area), then by max frame rate.
     *
     * @param deviceName - Device name as returned by `list()` (e.g. uniqueID on macOS, /dev/video0 on Linux)
     *
     * @returns Array of supported device modes
     *
     * @example
     * ```typescript
     * const devices = await Device.list();
     * const camera = devices.find(d => d.type === 'video');
     * if (camera) {
     *   const modes = await Device.modes(camera.name);
     *   console.log('Supported modes:', modes);
     * }
     * ```
     */
    static modes(deviceName: string): Promise<DeviceMode[]>;
    /**
     * Query supported capture modes for a video device synchronously.
     *
     * @param deviceName - Device name as returned by `listSync()`
     *
     * @returns Array of supported device modes
     *
     * @example
     * ```typescript
     * const devices = Device.listSync();
     * const camera = devices.find(d => d.type === 'video');
     * if (camera) {
     *   const modes = Device.modesSync(camera.name);
     *   console.log('Supported modes:', modes);
     * }
     * ```
     *
     * @see {@link modes} For async version
     */
    static modesSync(deviceName: string): DeviceMode[];
    /**
     * Query supported audio capture modes for an audio device.
     *
     * Returns supported sample rates, channel counts and sample formats for the specified device.
     * Modes are sorted descending by sample rate, then by channel count.
     *
     * @param deviceName - Device name as returned by `list()` (e.g. uniqueID on macOS, hw:0 on Linux)
     *
     * @returns Array of supported audio device modes
     *
     * @example
     * ```typescript
     * const devices = await Device.list();
     * const mic = devices.find(d => d.type === 'audio');
     * if (mic) {
     *   const modes = await Device.audioModes(mic.name);
     *   console.log('Supported audio modes:', modes);
     * }
     * ```
     */
    static audioModes(deviceName: string): Promise<AudioDeviceMode[]>;
    /**
     * Query supported audio capture modes for an audio device synchronously.
     *
     * @param deviceName - Device name as returned by `listSync()`
     *
     * @returns Array of supported audio device modes
     *
     * @example
     * ```typescript
     * const devices = Device.listSync();
     * const mic = devices.find(d => d.type === 'audio');
     * if (mic) {
     *   const modes = Device.audioModesSync(mic.name);
     *   console.log('Supported audio modes:', modes);
     * }
     * ```
     *
     * @see {@link audioModes} For async version
     */
    static audioModesSync(deviceName: string): AudioDeviceMode[];
    /**
     * Get platform-specific video input format name.
     *
     * @returns Format name for FFmpeg input
     *
     * | Platform | Format |
     * |----------|--------|
     * | macOS    | avfoundation |
     * | Linux    | v4l2 |
     * | Windows  | dshow |
     *
     * @example
     * ```typescript
     * const format = Device.getVideoFormat();
     * // Use with Demuxer.open(deviceName, { format })
     * ```
     */
    static getVideoFormat(): string;
    /**
     * Get platform-specific audio input format name.
     *
     * @returns Format name for FFmpeg input
     *
     * | Platform | Format |
     * |----------|--------|
     * | macOS    | avfoundation |
     * | Linux    | alsa |
     * | Windows  | dshow |
     *
     * @example
     * ```typescript
     * const format = Device.getAudioFormat(); // 'avfoundation' on macOS
     * ```
     */
    static getAudioFormat(): string;
    /**
     * Get platform-specific screen capture format name.
     *
     * @returns Format name for FFmpeg input
     *
     * | Platform | Format |
     * |----------|--------|
     * | macOS    | avfoundation |
     * | Linux    | x11grab |
     * | Windows  | gdigrab |
     *
     * @example
     * ```typescript
     * const format = Device.getScreenFormat(); // 'avfoundation' on macOS
     * ```
     */
    static getScreenFormat(): string;
    /**
     * Check if the application has screen capture permission (macOS only).
     *
     * Uses `CGPreflightScreenCaptureAccess()` on macOS 11+.
     * Always returns `true` on Linux, Windows, and macOS < 11.
     *
     * @returns `true` if screen capture is permitted
     *
     * @example
     * ```typescript
     * if (Device.hasScreenCapturePermission()) {
     *   console.log('Screen capture is permitted');
     * } else {
     *   console.log('Screen capture permission not granted');
     * }
     * ```
     */
    static hasScreenCapturePermission(): boolean;
    /**
     * Request screen capture permission from the user (macOS only).
     *
     * Uses `CGRequestScreenCaptureAccess()` on macOS 11+.
     * This will trigger the system permission dialog if not already granted.
     * Always returns `true` on Linux, Windows, and macOS < 11.
     *
     * @returns `true` if permission was already granted (does not wait for dialog)
     *
     * @example
     * ```typescript
     * const granted = Device.requestScreenCaptureAccess();
     * if (granted) {
     *   console.log('Screen capture permission already granted');
     * } else {
     *   console.log('Screen capture permission dialog shown to user');
     * }
     * ```
     */
    static requestScreenCaptureAccess(): boolean;
}
