import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
import * as i0 from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { TenantUiService, OptionsService, AppStateService, C8yStepper, GainsightService } from '@c8y/ngx-components';
import { RegisterDeviceFactory, RegisterDeviceItem } from '@c8y/ngx-components/register-device';
import * as packages_client_lib from 'packages/client/lib';
import * as rxjs from 'rxjs';
import { BehaviorSubject, Subject } from 'rxjs';
import { CdkStep } from '@angular/cdk/stepper';
import { FormGroup } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';
import * as _c8y_client from '@c8y/client';
import { InventoryService, FetchClient, ApplicationService, IResultList, IManagedObject } from '@c8y/client';
import { TranslateService } from '@ngx-translate/core';

declare class ActilityDeviceRegistrationButtonComponent {
    private modalService;
    constructor(modalService: BsModalService);
    open(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ActilityDeviceRegistrationButtonComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ActilityDeviceRegistrationButtonComponent, "c8y-actility-registration-button", never, {}, {}, never, never, true, never>;
}

declare class ActilityDeviceRegistrationFactory implements RegisterDeviceFactory {
    private tenantService;
    constructor(tenantService: TenantUiService);
    get(): RegisterDeviceItem[];
    static ɵfac: i0.ɵɵFactoryDeclaration<ActilityDeviceRegistrationFactory, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ActilityDeviceRegistrationFactory>;
}

interface ConnectivityPlan {
    grantedConnections: string;
    id: string;
    name: string;
    ref: string;
    usedConnections: string;
    message?: string;
}
interface DeviceType {
    name: string;
    id: string;
}
interface ActilityDeviceProfile {
    id: string;
    name: string;
    typeMAC: string;
    message?: string;
}
interface ActilityDeviceRegistration {
    applicationEUI: string;
    applicationKey: string;
    devEUI: string;
    deviceProfile: ActilityDeviceProfile;
    connectivityPlan: ConnectivityPlan;
    deviceType: DeviceType;
    lnsConnectionName: string;
    connection: {
        name: string;
        description: string;
        baseUrl: string;
        profileId: string;
        username: string;
        password: string;
    };
}

declare class ActilityDeviceRegistrationService {
    private inventoryService;
    private client;
    private translateService;
    private applicationService;
    private optionsService;
    private appState;
    private baseUrl;
    private registrationUrl;
    private connectivityPlansUrl;
    private deviceProfilesUrl;
    private headers;
    constructor(inventoryService: InventoryService, client: FetchClient, translateService: TranslateService, applicationService: ApplicationService, optionsService: OptionsService, appState: AppStateService);
    getConnections(): Promise<{
        res: _c8y_client.IFetchResponse;
        data: any;
    }>;
    /**
     * Gets connectivity plans from LoRa platform.
     * @param connectionName The name of connection for which connectivity plans will be retrieved
     * @returns The result list with connectivity plans, or throws an error with exception.
     */
    getConnectivityPlans(connectionName: string): Promise<IResultList<ConnectivityPlan>>;
    /**
     * Gets the device profiles from LoRa platform.
     * @param connectionName The name of connection for which device profiles will be retrieved
     * @returns The result list with device profiles, or throws an error with exception.
     */
    getDeviceProfiles(connectionName: string): Promise<IResultList<ActilityDeviceProfile>>;
    /**
     * Gets the device protocols
     */
    getDeviceProtocols(filter?: object): Promise<IResultList<IManagedObject>>;
    /**
     * Creates device registration
     */
    register(registration: ActilityDeviceRegistration): Promise<{
        res: _c8y_client.IFetchResponse;
        data: any;
    }>;
    /**
     * checks if used connections is less then granted connections
     */
    private hasAvailableConnections;
    private throwNoConnectivitySettingsError;
    private throwConnectivitySettingsError;
    private throwNoConnectivityPlansError;
    private throwNoFreeSlotsInConnectivityPlansError;
    private throwDeviceProfilesFetchError;
    private throwNoDeviceProfilesError;
    private throwDeviceProtocolsFetchError;
    private throwNoDeviceProtocolsError;
    private throwRegistrationError;
    static ɵfac: i0.ɵɵFactoryDeclaration<ActilityDeviceRegistrationService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ActilityDeviceRegistrationService>;
}

type ActilityState = 'loadPending' | 'loadSuccess' | 'loadError' | 'registrationPending' | 'registrationSuccess' | 'registrationError';
declare class ActilityDeviceRegistrationComponent {
    bsModalRef: BsModalRef;
    private registrationService;
    private gainsightService;
    stepper: C8yStepper;
    registrationStepLabels: {
        next: "Register";
    };
    finalStepLabels: {
        custom: "Close";
    };
    state: ActilityState;
    errors$: BehaviorSubject<Error[]>;
    errorMessages$: rxjs.Observable<any>;
    connections$: rxjs.Observable<{
        res: packages_client_lib.IFetchResponse;
        data: any;
    }>;
    deviceProtocols$: rxjs.Observable<packages_client_lib.IResultList<packages_client_lib.IManagedObject>>;
    unsubscribe$: Subject<void>;
    load$: rxjs.Observable<any[]>;
    form: FormGroup<{}>;
    model: ActilityDeviceRegistration;
    fields: FormlyFieldConfig[];
    constructor(bsModalRef: BsModalRef, registrationService: ActilityDeviceRegistrationService, gainsightService: GainsightService);
    getConnectivityPlans$(name: any): rxjs.Observable<packages_client_lib.IResultList<ConnectivityPlan>>;
    getDeviceProfiles$(name: any): rxjs.Observable<packages_client_lib.IResultList<ActilityDeviceProfile>>;
    getDeviceProtocols$(): rxjs.Observable<packages_client_lib.IResultList<packages_client_lib.IManagedObject>>;
    getConnections$(): rxjs.Observable<{
        res: packages_client_lib.IFetchResponse;
        data: any;
    }>;
    register(event: {
        stepper: C8yStepper;
        step: CdkStep;
    }): Promise<void>;
    getActilityDeviceToSend(): ActilityDeviceRegistration;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ActilityDeviceRegistrationComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ActilityDeviceRegistrationComponent, "c8y-actility-registration", never, {}, {}, never, never, true, never>;
}

declare class ActilityDeviceRegistrationModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<ActilityDeviceRegistrationModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<ActilityDeviceRegistrationModule, never, [typeof i1.CoreModule, typeof i1.CommonModule, typeof ActilityDeviceRegistrationButtonComponent, typeof ActilityDeviceRegistrationComponent], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<ActilityDeviceRegistrationModule>;
}

export { ActilityDeviceRegistrationButtonComponent, ActilityDeviceRegistrationComponent, ActilityDeviceRegistrationFactory, ActilityDeviceRegistrationModule };
//# sourceMappingURL=index.d.ts.map
