/**
 * Copyright (c) 2024 Opal Kelly Incorporated
 *
 * This source code is licensed under the FrontPanel license.
 * See the LICENSE file found in the root directory of this project.
 */

import IDeviceInfo from "./IDeviceInfo";

import IDeviceFPGA from "./IDeviceFPGA";

/**
 * Interface that provides the methods that may be used to interact
 * with the device.
 */
interface IDevice {
    /**
     * Determines if the Device is currently open.
     * @returns {Promise<boolean>} - Promise that resolves to true if the Device
     * is open, otherwise false.
     */
    isOpen(): Promise<boolean>;

    /**
     * Retrieves the device information.
     * @returns {Promise<IDeviceInfo>} - Promise that resolves to a Device
     * information interface.
     */
    getInfo(): Promise<IDeviceInfo>;

    /**
     * The FPGA interface for the device.
     * @returns {IDeviceFPGA} - The FPGA interface for the Device.
     */
    getFPGA(): IDeviceFPGA;

    /**
     * Closes the Device.
     * @returns {boolean} - True if the Device was successfully closed, otherwise false.
     */
    close(): boolean;
}

export default IDevice;
