import '@iotize/tap';
import '@iotize/tap/service/all';
import { BundleConfig, TapConfig, VariableConfig } from '@iotize/tap/config/schema/v1';
import { StepOperations } from '@iotize/common/task-manager';
import { ServiceCallType } from "@iotize/tap";
import { Tap, ServiceContainer } from "@iotize/tap";
import { TapConfiguratorConfig, TapConfiguratorOptions, VariableTypeDataConfig } from '@iotize/tap/config/schema/v1';
interface ConfigureContext {
    tap: Tap;
    options: TapConfiguratorOptions;
    tapConfig: TapConfig;
}
export declare function tapConfigToServiceCalls(config: TapConfig, options: {
    firmwareVersion: string;
    service: ServiceContainer;
    saltGenerator?: () => Uint8Array;
}): (Error | ServiceCallType<any, any>)[];
declare type VariableFlatConfig = {
    id: number;
    bundleId: number;
    length: number;
    value: Uint8Array;
    rawMeta?: Uint8Array;
    type: {
        domain: string;
        data: VariableTypeDataConfig;
    };
    modbusAddress?: any;
    address?: number;
};
export declare function encodeInitialVariableValue(variable: VariableConfig, bundle: BundleConfig): Uint8Array;
export declare function toVariableFlatConfig(variable: VariableConfig, bundle: BundleConfig): VariableFlatConfig;
export declare function toFlatTapConfig(config: TapConfig, options?: {
    saltGenerator?: () => Uint8Array;
}): any;
/**
 * Configure tap from a configuration file schema
 *
 */
export declare class TapConfiguratorWriter {
    options: TapConfiguratorWriter.Options;
    host?: TapConfiguratorWriter.Host | undefined;
    constructor(options?: TapConfiguratorWriter.Options, host?: TapConfiguratorWriter.Host | undefined);
    createConfiguratorForTap(tap: Tap, config: TapConfiguratorConfig, options?: TapConfiguratorWriter.ConfigureOptions): Promise<TapConfiguratorWriter.Runner>;
    configure(tap: Tap, firmwareVersion: string, config: TapConfiguratorConfig, options?: TapConfiguratorWriter.ConfigureOptions): TapConfiguratorWriter.Runner;
    setupConfigState(tap: Tap): Promise<void>;
    isConfigured(tap: Tap): Promise<boolean>;
    /***
     *
     */
    applyConfig(tap: Tap, newVersion?: string): Promise<void>;
    protected addConfigurCalls(configureContext: ConfigureContext, calls: (ServiceCallType<any, any> | Error)[], operations: TapConfiguratorWriter.StepOperationType[]): void;
    protected sleep(delayMs: number): Promise<void>;
}
export declare namespace TapConfiguratorWriter {
    interface Event {
        step: Step;
        [key: string]: any;
    }
    interface Options {
        delayMs: number;
    }
    interface ConfigureOptions {
        skipSchemaValidation?: boolean;
    }
    interface Host {
        /**
         * Load given URI
         * Throw error if URI is not found
         * @param uri
         */
        loadUri(uri: string): Promise<{
            buffer: Uint8Array;
        }>;
    }
    enum Step {
        validatesConfig = "TapConfiguratorStepValidatesConfig",
        enableSecureCom = "TapConfiguratorStepenableSecureCommunication",
        factoryReset = "TapConfiguratorStepFactoryReset",
        setupConfigurationState = "TapConfiguratorStepSetupConfigurationState",
        executeCall = "TapConfiguratorStepExecuteCall",
        logout = "TapConfiguratorSteplogout",
        applyConfig = "TapConfiguratorStepApplyConfig",
        writeSecurityOptions = "TapConfiguratorStepWriteSecurityOptions"
    }
    type StepOperationType = StepOperations.OperationType<Event, any>;
    type Runner = StepOperations<Event, any>;
}
export {};
