import { Tap } from '@iotize/tap';
import { EncryptionOptions } from '@iotize/tap/auth';
import { Observable } from 'rxjs';
import { CurrentDeviceService } from './current-device.service';
import { ProtocolMeta } from './extensions/protocol-info';
import { ProtocolFactoryService } from './protocol-factory.service';
export declare const TAP_CONNECTION_OPTIONS_PROVIDER = "TapConnectionOptions";
export declare enum TapRegisterProtocolsMethod {
    /**
     * Only register altertive protocol when connecting with nfc using ndef
     */
    NDEF_ONLY = "NDEF_ONLY",
    /**
     * Register alternative protocols using NDEF if present or service if not
     */
    NDEF_OR_SERVICE = "NDEF_OR_SERVICE",
    /**
     * Register alternative protocols using service (even if ndef is available)
     */
    SERVICE_ONLY = "SERVICE_ONLY"
}
export interface TapConnectionOptions {
    /**
     * Set to true if you want to automatically connect with a long range protocol when connecting with NFC
     */
    switchProtocol?: boolean;
    /**
     * Configure register alternative protocol method when we are connection to the tap
     * This will performs additional requests leading to a slower connection
     */
    registerProtocolsMethod?: TapRegisterProtocolsMethod | false;
    /**
     * Set to true to refresh session state after connection
     */
    refreshSessionState?: boolean;
    /**
     * True to perform NFC pairing on connection
     */
    nfcPairing?: boolean;
    /**
     * Encryption keys for tap initialization
     */
    encryption?: EncryptionOptions;
}
export interface ConnectionEvent {
    message: string;
    tap: Tap;
}
/**
 * User can the replace with its own service
 */
export declare class TapConnectionService {
    private tapService;
    private protocolFactory;
    private tapFactory;
    constructor(tapService: CurrentDeviceService, protocolFactory: ProtocolFactoryService);
    /**
     * Create a Tap connection Observable shared stream
     */
    connect(meta: ProtocolMeta, config: TapConnectionOptions): Observable<ConnectionEvent>;
    private _connect;
    registerAlternativeProtocols(registerAlternativeProtocolMethod: TapRegisterProtocolsMethod | false | undefined, initialProtocolMeta: ProtocolMeta): Promise<void>;
}
