import type { NobjcObject } from "objc-js";
import type { _PGDisplay } from "./PGDisplay.js";
import type { _PGDisplayDescriptor } from "./PGDisplayDescriptor.js";
import type { _NSData } from "../Foundation/NSData.js";
export interface _PGDevice {
    /**
     * Perform an MMIO read from the device. The offset into the MMIO BAR to read from. The 32-bit value for the read.
     */
    mmioReadAtOffset$?(offset: number): number;
    /**
     * Perform an MMIO write to the device. The offset into the MMIO bar to write to. The 32-bit value to write to the device.
     */
    mmioWriteAtOffset$value$?(offset: number, value: number): void;
    /**
     * Create a display based on the given descriptor and uniquifying parameters. Description of desired display object. Port number that display will plug into (one display per port - and it must be less than the displayPortCount that PGDevice was created with). Serial Number of display (should be unique so Guest compositor can maintain persistent layout of displays on desktop across boots). New display won't hot-plug until first modeList is established. Releasing this object emulates a hot-unplug.
     */
    newDisplayWithDescriptor$port$serialNum$?(descriptor: _PGDisplayDescriptor, port: number, serialNum: number): _PGDisplay | null;
    /**
     * Notify the device that it will suspend. This will quiesce the device but not begin resource serialization. Upon return from this method, no new interrupts will be generated by the device. The device will stop accepting commands from the guest. Mac guests have several wall-clock time limits on command buffer completion so the guest CPUs need to be halted within a short interval after this method is called.
     */
    willSuspend?(): void;
    /**
     * Finish the suspend. This method may take an arbitrary amount of time as the device needs to complete any GPU work that is in flight. The suspend state data. This data should be serialized and returned to the device on resume. Returns nil on suspend failure. It is not legal to perform any further operations on this device after finishSuspend is called, the device must be released.
     */
    finishSuspend?(): _NSData | null;
    /**
     * Begin the resume. This method will set up the device to appear in the same state as it was in before the suspend. At this point, the guest CPUs should not yet be running and no guest memory accesses will be attempted. The suspend state recorded during the finishSuspend:. An error out parameter, will be populated on resume failure. Error will be in PGResumeErrorDomain and will have an error code from the PGResumeErrorCode enum. Returns YES on success. On failure will return NO and populate error. Suspended displays should be reattached after this method has been called, but before -[PGDevice didResume:] is invoked. For resume, this method must be invoked before any calls to `-[PGDevice mmioWriteAtOffset:value:]` or `-[PGDevice mmioReadAtOffset:]` are made.
     */
    willResumeWithSuspendState$error$?(suspendState: _NSData, error: NobjcObject | null): boolean;
    /**
     * Complete the resume. After this method is invoked, new interrupts may be generated by the device. Guest memory must be accessible at the time this method is invoked. An initial interrupt may be generated during the duration of this call.
     */
    didResume?(): void;
    /**
     * Pause the device, completing all pending operations and writes to guest memory. This is a lighter weight operation than suspend. Guest CPUs should be suspended while the device is paused.
     */
    pause?(): void;
    /**
     * Resume the device from pause state, allowing operations to continue. An initial interrupt may be generated during the duration of this call.
     */
    unpause?(): void;
    /**
     * Stop the device entirely, releasing all the guest memory. Guest CPUs should be suspended or stopped when this method is called.
     */
    stop?(): void;
    /** Reset the device to a clean state. This will block until work is quiesced. */
    reset?(): void;
}
