/// <reference types="node" />
/// <reference types="graceful-fs" />
import { EventEmitter } from 'events';
import * as stream from 'stream';
import { Peer, TypesafeRequestDispatcher } from '@fitbit/jsonrpc-ts';
import { BulkData, FDBTypes } from '@fitbit/fdb-protocol';
export interface HostInfo {
    device: string;
    hostKind: 'device' | 'companion';
    maxMessageSize?: number;
}
export interface InstallOptions {
    appBundle?: boolean;
    companionBundle?: boolean;
    appCompatibility?: FDBTypes.AppHostDescriptor[];
    companionCompatibility?: FDBTypes.CompanionHostDescriptor;
}
export declare type InstallHandlerReturn = FDBTypes.AppInstallResult | Promise<FDBTypes.AppInstallResult>;
export declare type InstallHandler = (appData: Buffer) => InstallHandlerReturn;
export declare class Host extends EventEmitter {
    capabilities: FDBTypes.HostCapabilities;
    dispatcher: TypesafeRequestDispatcher;
    rpc: Peer;
    info?: FDBTypes.InitializeParams;
    epoch: Date;
    timeout: number;
    private installHandler?;
    private hostInfo;
    protected bulkDataStreams: BulkData;
    private appInstallStream?;
    protected constructor(hostInfo: HostInfo, timeout: number);
    static create(debuggerStream: stream.Duplex, hostInfo: HostInfo, { timeout, }?: {
        timeout?: number | undefined;
    }): Host;
    setInstallHandler: (installHandler: InstallHandler, installOptions?: InstallOptions | undefined) => void;
    handleInitialize: (params: FDBTypes.InitializeParams) => {
        device: string;
        hostKind: "companion" | "device";
        capabilities: {
            protocol?: {
                batchRequest?: boolean | undefined;
                maxMessageSize?: number | undefined;
                additionalSerializations?: string[] | undefined;
            } | undefined;
            io?: {
                write?: boolean | undefined;
                additionalEncodings?: string[] | undefined;
            } | undefined;
            appHost?: {
                install?: {
                    sideloadStream?: boolean | undefined;
                    appBundle?: boolean | undefined;
                    companionBundle?: boolean | undefined;
                    appCompatibility?: ({
                        maxAPIVersion?: string | undefined;
                        exactAPIVersion?: string[] | undefined;
                    } & {
                        family: string;
                        version: string;
                    })[] | undefined;
                    companionCompatibility?: ({
                        maxAPIVersion: string;
                    } & {
                        exactAPIVersion?: string[] | undefined;
                    }) | undefined;
                    partialBundle?: boolean | undefined;
                } | undefined;
                launch?: {
                    appComponent?: {
                        canLaunch?: boolean | undefined;
                    } | undefined;
                } | undefined;
                screenshot?: ({
                    stream?: boolean | undefined;
                } & {
                    imageFormats: string[];
                }) | undefined;
                debug?: {
                    app?: {
                        heapSnapshot?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        } & {
                            formats?: string[] | undefined;
                        }) | undefined;
                        evalToString?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        }) | undefined;
                    } | undefined;
                    companion?: {
                        heapSnapshot?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        } & {
                            formats?: string[] | undefined;
                        }) | undefined;
                        evalToString?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        }) | undefined;
                    } | undefined;
                    settings?: {
                        heapSnapshot?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        } & {
                            formats?: string[] | undefined;
                        }) | undefined;
                        evalToString?: ({
                            supported: boolean;
                        } & {
                            requiresInstrumentedLaunch?: boolean | undefined;
                        }) | undefined;
                    } | undefined;
                } | undefined;
            } | undefined;
            experimental?: any;
        };
    };
    handleAppInstallBegin: (params: FDBTypes.AppInstallStreamBeginParams) => {
        stream: import("fs").Mode;
    };
    validateAppInstallStream(stream: FDBTypes.StreamToken): void;
    handleAppInstallFinalize: ({ stream }: FDBTypes.StreamCloseParams) => Promise<{
        app: {
            uuid: string;
            buildID: string;
        };
        components: ("app" | "companion" | "settings")[];
    } & {
        installType?: "full" | "partial" | undefined;
    }>;
    handleAppInstallAbort: ({ stream }: FDBTypes.StreamCloseParams) => void;
    ping: (timeout?: number) => Promise<void>;
    consoleMessage: (args: FDBTypes.ConsoleMessage) => boolean;
    consoleTrace: (args: FDBTypes.TraceMessage) => boolean;
}
//# sourceMappingURL=index.d.ts.map