import { ConverterProvider } from "./util/converter-provider";
import { Response } from "../client/api/response";
import { InterfaceLock, SinglePacketPart } from './model';
import { ComProtocol } from '../protocol/api';
import { VariableManager } from './target-variable';
import { ScramAuth } from './scram';
import { IoTizeDeviceService } from './iotize-device-services';
import { BundleManager } from "./target-variable/bundle-manager";
import { TapConfigurator } from "../client/api/tap-configurator";
import { TapInterface } from "../client/api/tap-device";
import { ApiConfig, Routes } from "./config/api-config";
import { ServiceCallType } from "./service";
import { IoTizeClient } from "../client/api";
import { SinglePacket as SinglePacketModel } from './all-models';
import '../core/extensions';
import { Observable, BehaviorSubject } from "rxjs";
import '../client/impl/frame/stream-generated';
import { SinglePacketProgress } from "./types";
export declare type ServiceClass = {
    new (client: IoTizeClient, converterProvider: ConverterProvider): any;
};
export interface Lwm2mCall {
    commandType: 'GET' | 'PUT' | 'POST';
    path: string;
    responseType?: string;
    params?: {
        [key: string]: string;
    };
}
export interface SessionState {
    groupId: number;
    startTime?: Date;
    lifeTime: number;
    name: string;
}
export declare type Tap = IoTizeDevice;
export declare namespace Tap {
    function create(): Tap;
    function fromProtocol(protocol: ComProtocol): Tap;
}
/**
 *
 * @deprecated Use Tap instead
 */
export declare class IoTizeDevice implements TapInterface {
    static TAG: string;
    static INITIAL_SESSION_STATE: SessionState;
    /**
     * Cache log info
     */
    protected _interfaceLockOptions?: InterfaceLock;
    protected _variableManager?: VariableManager;
    protected _bundleManager?: BundleManager;
    protected _services: IoTizeDeviceService;
    protected _client: IoTizeClient;
    protected _sessionState?: SessionState;
    protected _sessionState$: BehaviorSubject<SessionState>;
    /**
     * Current session key used for encryption
     */
    protected _sessionKey?: Uint8Array;
    protected _apiConfig: ApiConfig;
    protected _lwm2m: Lwm2mInterface;
    protected _scramAuth?: ScramAuth;
    lockOptions: InterfaceLock;
    /**
     * Setter for the session key
     * @param key if null, it will stop encryption and remove session key. If true it will update session key used for encryption
     */
    sessionKey: Uint8Array | undefined;
    client: IoTizeClient;
    /**
     * Listen to session state changed
     */
    readonly sessionState: Observable<SessionState>;
    constructor(client: IoTizeClient);
    /**
     * @deprecated
     */
    static create(): IoTizeDevice;
    /**
     * @deprecated
     * @param protocol
     */
    static fromProtocol(protocol: ComProtocol): IoTizeDevice;
    encryption(enable: boolean, resetSessionKey?: boolean): Promise<any>;
    /**
     * Enable/Disable encrytion when communicating with a device
     * @param enable true if requests must be encrypted
     * @param resetSessionKey true if you want to reset the the session key.
     *
     * @deprecated use {@link encryption()} instead
     */
    enableEncryption(enable: boolean, resetSessionKey?: boolean): Promise<any>;
    readonly protocol: ComProtocol;
    /**
     * Connect with the given communication protocol
     * TODO what if there is already a connected communication protocol
     * @param protocol
     */
    connect(protocol?: ComProtocol): Promise<void>;
    /**
     * Disconnect device
     * It will also clear session key
     */
    disconnect(): Promise<void>;
    isConnected(): boolean;
    readonly variables: VariableManager;
    readonly bundles: BundleManager;
    /**
     * Setter for hashPassword option
     * @deprecated this should not be used anymore as this configuration must be read from the tap
     */
    /**
     * Return true if password will be hashed
     * @deprecated
     */
    /**
     * Tap logout
     * Reject if logout failed
     */
    logout(): Promise<void>;
    /**
     * Change password for the groupId (If groupId is not specified, it will be changed for the current group id)
     * @param newPassword the new password
     * @param groupId default to the current group id
     */
    changePassword(newPassword: string, groupId?: number): Promise<Response<any>>;
    /**
     *
     * @warning this is an experimental function. It may be modified in future releases
     * @experimental
     */
    loadSinglePacketInStore(packets: SinglePacketPart[]): Observable<SinglePacketProgress>;
    /**
     * Send a single packet to the tap and execute
     *
     * @warning this is an experimental function. It may be modified in future releases
     * @experimental
     */
    sendSinglePacket(packetOrModel: SinglePacketModel | Uint8Array): Observable<SinglePacketProgress>;
    /**
     * Configure current tap instance thanks to a TapConfigurator
     * @param configurator
     */
    configure<DataType>(configurator: TapConfigurator<DataType>): Promise<DataType>;
    /**
     * Tap login
     *
     */
    login(username: string, password: string, refreshSessionState?: boolean): Promise<boolean>;
    readonly scramAuth: ScramAuth;
    readonly rooter: Routes;
    readonly apiConfig: ApiConfig;
    readonly service: IoTizeDeviceService;
    /**
     * @experimental
     */
    readonly lwm2m: Lwm2mInterface;
    /**
     * Initialize device cache
     */
    protected _initCache(): void;
    /**
     * Read session state from the device
     * This will perform a few tap requests
     */
    refreshSessionState(): Promise<SessionState>;
    /**
     * Get lock info
     */
    protected getLockInfo(): Promise<InterfaceLock>;
    private _log;
}
export declare class Lwm2mInterface {
    client: IoTizeClient;
    apiConfig: ApiConfig;
    constructor(client: IoTizeClient, apiConfig: ApiConfig);
    get(path: string, body?: any): Promise<Response<any>>;
    put(path: string, body: any): Promise<Response<any>>;
    post(path: string, body?: any): Promise<Response<any>>;
    call(...calls: ServiceCallType[]): Promise<Response<any>>;
}
