@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
138 lines (126 loc) • 6.4 kB
TypeScript
import * as i0 from '@angular/core';
import { EventEmitter, Injector, ElementRef, OnInit, OnDestroy } from '@angular/core';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { UpgradeComponent } from '@angular/upgrade/static';
import { ActivatedRouteSnapshot, ActivatedRoute } from '@angular/router';
import * as i1 from '@angular/common';
import * as i2 from '@c8y/ngx-components';
import { OptionsService, OperationRealtimeService, ManagedObjectRealtimeService, AlertService } from '@c8y/ngx-components';
import * as i3 from '@c8y/ngx-components/operations/operations-timeline';
import * as rxjs from 'rxjs';
import { Observable, BehaviorSubject } from 'rxjs';
import { OperationService, InventoryService, IResult, IOperation, IManagedObject, IResultList } from '@c8y/client';
declare function rootScopeCommandTemplateFactory($injector: Injector): any;
declare class CommandTemplatesComponent {
modalRef: BsModalRef;
onTemplateSelected: EventEmitter<object>;
constructor(modalRef: BsModalRef);
static ɵfac: i0.ɵɵFactoryDeclaration<CommandTemplatesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CommandTemplatesComponent, "c8y-command-templates", never, {}, {}, never, never, true, never>;
}
declare class CommandTemplates extends UpgradeComponent {
close: EventEmitter<void>;
dismiss: EventEmitter<void>;
constructor(elementRef: ElementRef, injector: Injector);
static ɵfac: i0.ɵɵFactoryDeclaration<CommandTemplates, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CommandTemplates, "c8y-command-templates-directive", never, {}, { "close": "close"; "dismiss": "dismiss"; }, never, never, true, never>;
}
declare class CommandTemplatesModule {
static ɵfac: i0.ɵɵFactoryDeclaration<CommandTemplatesModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<CommandTemplatesModule, never, [typeof CommandTemplates, typeof CommandTemplatesComponent], [typeof CommandTemplatesComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<CommandTemplatesModule>;
}
declare class DeviceShellGuard {
private readonly operation;
canActivate(route: ActivatedRouteSnapshot): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceShellGuard, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DeviceShellGuard>;
}
declare class DeviceShellSharedModule {
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceShellSharedModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<DeviceShellSharedModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<DeviceShellSharedModule>;
}
declare enum CommandDeliveryType {
DEFAULT = "Default",
SMS = "SMS"
}
interface DeliveryType {
name: string;
default?: boolean;
}
interface Command {
id: string;
name: string;
text: string;
deliveryTypes: string[];
command: string;
category: string;
}
interface DeviceShellTemplate {
name: string;
text: string;
category?: string;
syntax?: string;
deviceType?: string;
}
declare class DeviceShellService {
private optionsService;
private operationService;
private inventoryService;
private readonly MO_TYPE;
constructor(optionsService: OptionsService, operationService: OperationService, inventoryService: InventoryService);
getDeliveryTypes(): DeliveryType[];
canSendCommandsViaSMS(): Promise<boolean>;
createCommandOperation(deviceId: string, command: Command, deliveryType: CommandDeliveryType): Promise<IResult<IOperation>>;
getCommandTemplatesForDeviceType(deviceTypes: string[]): Promise<DeviceShellTemplate[]>;
private getStaticCommandTemplates;
private getCommandTemplatesForDeviceTypeInMemory;
private getDynamicCommandTemplates;
private extractCommandTemplatesFromData;
private getExtendedTemplates;
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceShellService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DeviceShellService>;
}
declare class DeviceShellComponent implements OnInit, OnDestroy {
service: DeviceShellService;
operationRealtime: OperationRealtimeService;
private moRealtime;
private operationService;
private route;
private modalService;
private alertService;
device: IManagedObject;
device$: Observable<IManagedObject>;
deliveryTypes: Array<DeliveryType & {
isSupportedByCommand?: boolean;
}>;
command: Command;
smsEnabled: boolean;
sendingCommand$: BehaviorSubject<boolean>;
operations: IResultList<IOperation>;
filterPipe: rxjs.UnaryFunction<Observable<IOperation[]>, Observable<IOperation[]>>;
executeViaLabel: "Execute via ({{deliveryType}})";
private destroyed$;
constructor(service: DeviceShellService, operationRealtime: OperationRealtimeService, moRealtime: ManagedObjectRealtimeService, operationService: OperationService, route: ActivatedRoute, modalService: BsModalService, alertService: AlertService);
ngOnInit(): Promise<void>;
getPredefinedCommand(): void;
resetSupportedDeliveryTypes(): void;
execute(commandDeliveryType: any): Promise<void>;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceShellComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DeviceShellComponent, "c8y-device-shell", never, {}, {}, never, never, true, never>;
}
declare class ShellModule {
static ɵfac: i0.ɵɵFactoryDeclaration<ShellModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<ShellModule, never, [typeof i1.CommonModule, typeof i2.CoreModule, typeof i3.OperationsTimelineModule, typeof CommandTemplatesModule, typeof DeviceShellSharedModule, typeof DeviceShellComponent], [typeof DeviceShellComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<ShellModule>;
}
declare class DeviceShellModule {
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceShellModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<DeviceShellModule, never, [typeof ShellModule], never>;
static ɵinj: i0.ɵɵInjectorDeclaration<DeviceShellModule>;
}
export { CommandDeliveryType, CommandTemplates, CommandTemplatesComponent, CommandTemplatesModule, DeviceShellComponent, DeviceShellGuard, DeviceShellModule, DeviceShellService, DeviceShellSharedModule, ShellModule, rootScopeCommandTemplateFactory };
export type { Command, DeliveryType, DeviceShellTemplate };
//# sourceMappingURL=index.d.ts.map