import type { ActivationState } from "@/types/activation";
import type { IosCommandResult, IosProfileListResult, LockdownInfo } from "@/types/ios";
import type { AppInfo, PortForwardResult } from "@/types/types";
import type { InstallAppMdmOptions } from "@mcesystems/mdm-client-g4";
/**
 * AppleDeviceKit - iOS device operations wrapper
 *
 * Uses idevice command-line tools for iOS device operations.
 * Each instance is associated with a specific device by UDID.
 *
 * Port forwarding is managed automatically - each logical port (USB hub position)
 * gets a dynamically allocated local port that is tracked and cleaned up on dispose.
 *
 * IMPORTANT: Call dispose() when the kit is no longer needed to clean up
 * any running proxy processes and release port allocations.
 */
export declare class AppleDeviceKit {
    private readonly logicalPort;
    private deviceId;
    private proxyProcess;
    private localDevicePort;
    private isDisposed;
    private readonly iosCli;
    constructor(udid: string, logicalPort: number);
    static setResourcesDir(dir: string): void;
    /**
     * Throws if the kit has been disposed
     */
    private ensureNotDisposed;
    info(): Promise<LockdownInfo>;
    /**
     * Check if device is paired/trusted with this computer
     */
    isPaired(): Promise<boolean>;
    /**
     * Wait for device to be paired
     * Polls the pairing status until successful or timeout
     *
     * @param timeout Timeout in milliseconds (default: 120000)
     * @param pollInterval Poll interval in milliseconds (default: 1000)
     */
    waitForPairing(timeout?: number, pollInterval?: number): Promise<boolean>;
    /**
     * Attempt to pair/trust the device
     * User must accept the trust dialog on the device
     */
    pair(): Promise<boolean>;
    /**
     * Trust/pair the device - initiates pairing and waits for user to accept
     *
     * This is the recommended method for establishing trust with a device.
     * It will:
     * 1. Check if already paired
     * 2. If not, initiate pairing (shows "Trust This Computer?" on device)
     * 3. Wait for user to accept the trust dialog
     *
     * @param timeout Timeout in milliseconds to wait for user acceptance (default: 60000)
     * @param onWaitingForTrust Callback when waiting for user to accept trust dialog
     * @returns true if device is now trusted
     */
    trustDevice(timeout?: number, onWaitingForTrust?: () => void): Promise<boolean>;
    /**
     * Unpair/untrust the device
     */
    unpair(): Promise<boolean>;
    /**
     * Install an IPA file on the device (install agent)
     *
     * @param ipaPath Path to the IPA file
     */
    installApp(ipaPath: string, options: InstallAppMdmOptions): Promise<IosCommandResult>;
    /**
     * Uninstall an app by bundle ID (uninstall agent)
     *
     * @param bundleId Application bundle identifier
     */
    uninstallApp(bundleId: string): Promise<void>;
    /**
     * Check if an app is installed on the device
     *
     * @param bundleId Application bundle identifier
     */
    isAppInstalled(bundleId: string): Promise<boolean>;
    /**
     * List all installed user applications
     */
    listApps(): Promise<AppInfo[]>;
    /**
     * Start port forwarding and wait for it to be ready.
     * The local port is automatically allocated based on the logical port.
     *
     * We need port forwarding to be able to connect to the device from the computer
     * and communicate with it using the local port.
     *
     * Note: Only one port forward can be active at a time per kit instance.
     * Starting a new port forward will kill any existing one.
     *
     * @param devicePort Device port to forward to
     * @param startupTimeout Time to wait for proxy to start (ms)
     * @returns The port forward result with the allocated local port
     */
    startPortForwardAsync(devicePort: number, startupTimeout?: number): Promise<PortForwardResult>;
    /**
     * Kill the current port forwarding process if running
     */
    private killProxyProcess;
    /**
     * Close the current port forwarding session and release the port
     */
    closePortForward(): void;
    /**
     * Get the activation state of the device
     */
    getActivationState(): Promise<ActivationState>;
    /**
     * Wipe the device
     */
    wipe(): Promise<void>;
    removeProfile(profileIdentifier: string): Promise<void>;
    listProfiles(): Promise<IosProfileListResult>;
    /**
     * Activate the device using the activation flow.
     *
     * This flow can install WiFi/MDM/trust profiles and skip setup steps.
     *
     * Note: This requires a valid activation record or Apple server access.
     *
     * Precondition: the device must be paired and trusted.
     */
    activate(): Promise<(() => Promise<void>) | undefined>;
    /**
     * Get the device UDID
     */
    getDeviceId(): string;
    /**
     * Get the logical port number (USB hub position)
     */
    getLogicalPort(): number;
    /**
     * Get the currently allocated local port for forwarding
     * Returns undefined if no port forward is active
     */
    getDevicePort(): number | null;
    /**
     * Check if this kit has been disposed
     */
    get disposed(): boolean;
    /**
     * Check if a port forward is currently active
     */
    get hasActivePortForward(): boolean;
    /**
     * Dispose of the kit and clean up all resources.
     * This will kill any running proxy processes and release port allocations.
     *
     * After calling dispose(), the kit instance should not be used.
     */
    dispose(): void;
    /**
     * Symbol.dispose implementation for using with `using` keyword (TypeScript 5.2+)
     */
    [Symbol.dispose](): void;
}
//# sourceMappingURL=appleDeviceKit.d.ts.map