import { StepOperations } from '@iotize/common/task-manager';
import { Observable } from 'rxjs';
import { SinglePacket as SinglePacketModel, SinglePacketPart } from '../all-models';
import { EncryptedSinglePacketConverter } from '../extra-converter/single-packet-converter';
import { Tap } from '../iotize-device';
import { SinglePacketProgress } from '../types';
import { SinglePacketSplitter } from './single-packet-splitter';
export interface SinglePacketStoreLoader extends StepOperations<SinglePacketProgress, Record<string, any>> {
}
export interface SinglePacketLoader {
    execute(packetOrModel: SinglePacketModel, crendials: SinglePacketLoader.Credentials): Observable<SinglePacketProgress>;
    execute(packetOrModel: SinglePacketModel | SinglePacketModel | Uint8Array): Observable<SinglePacketProgress>;
    loadInStore(packets: SinglePacketModel, crendials: SinglePacketLoader.Credentials): SinglePacketStoreLoader;
    loadInStore(packets: SinglePacketModel | SinglePacketPart[] | Uint8Array): SinglePacketStoreLoader;
    executeFromStore(expectedCrc: number): Promise<void>;
}
export declare namespace SinglePacketLoader {
    type Credentials = EncryptedSinglePacketConverter.EncryptionOptions;
}
export declare function senderIdToUserId(senderId: number): number;
export declare function userIdToSenderId(userId: number): number;
/**
 * TODO add option to change single packet encryption keys
 */
export declare class DefaultSinglePacketLoader implements SinglePacketLoader {
    tap: Tap;
    singlePacketConverter: EncryptedSinglePacketConverter;
    singlePacketSplitter: SinglePacketSplitter;
    constructor(tap: Tap, singlePacketConverter?: EncryptedSinglePacketConverter, singlePacketSplitter?: SinglePacketSplitter);
    executeFromStore(expectedCrc: number): Promise<void>;
    /**
     * Upload single packets to single packet store (one by one)
     * Unsubsribe from observable to cancel this operation
     *
     * @warning this is an experimental function. It may be modified in future releases
     * @experimental
     *
     * TODO use dependency injection instead
     */
    loadInStore(packetOrModel: SinglePacketModel | SinglePacketPart[] | Uint8Array, credentials?: SinglePacketLoader.Credentials): SinglePacketStoreLoader;
    /**
     * Send a single packet to the tap and execute
     *
     */
    execute(packetOrModel: SinglePacketModel | Uint8Array, credentials?: SinglePacketLoader.Credentials): Observable<SinglePacketProgress>;
    private _encodePacket;
    private createCredentialsFromCurrentSessionData;
}
