/// <reference types="node" />
import { Readable } from "stream";
import { KeyType, KeyPolicy } from "./consts";
export declare type TeeDeviceInfoType = {
    cpus: Array<{
        vendorId: string;
        cpuFamily: number;
        model: number;
        modelName: string;
        physicalCores: number;
        logicalCores: number;
        baseFreq: number;
        maxFreq: number;
    }>;
    memSize: number;
    totalPhysicalCores: number;
    totalLogicalCores: number;
};
export declare type TeeRunCpuBenchmarkType = {
    cpuScore: number;
    cpuBenchmark: string;
    cpuCoresCount: number;
};
export declare type TeeRunMemoryBenchmarkType = {
    memBandwidth: number;
    memСonfirmedSize: number;
};
export declare class EnclaveService {
    private readonly tmpFolder;
    private readonly sgx;
    constructor(tmpFolder?: string);
    /**
     * Requests secret keys from cpu.
     * @param param0
     * @returns
     */
    getSecretKey({ type, policy }: {
        type: KeyType;
        policy: KeyPolicy;
    }): Promise<Buffer>;
    /**
     * Returns TEE device information.
     * @returns
     */
    getTeeDeviceInfo(): Promise<TeeDeviceInfoType>;
    /**
     * Returns TEE cpu benchmark.
     * @param deviceInfoMemSize
     * @returns
     */
    getTeeDeviceCpuBenchmark(deviceInfoMemSize: number): Promise<TeeRunCpuBenchmarkType>;
    /**
     * Returns TEE memory benchmark.
     * @param deviceInfoTotalPhysicalCores
     * @returns
     */
    getTeeDeviceMemoryBenchmark(deviceInfoTotalPhysicalCores: number): Promise<TeeRunMemoryBenchmarkType>;
    /**
     * Writes input stream to the protected file.
     * @param inputStream
     * @param outputStream
     * @param filepath
     * @param secretKey
     */
    writeGramineProtectedFile(filepath: string, inputStream: Readable, secretKey: Buffer): Promise<{
        writtenSize: number;
        filesize: number;
        filepath: string;
    }>;
    /**
     * Reads protected file and write to output stream.
     * @param filepath
     * @param inputStream
     * @param outputStream
     * @param secretKey
     */
    readGramineProtectedFile(filepath: string, inputStream: Readable, secretKey: Buffer): Promise<{
        fileStream: Readable;
        filesize: number;
        filepath: string;
    }>;
}
