@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
119 lines • 4.58 kB
TypeScript
import { IManagedObject } from '@c8y/client';
import { AssetTypesRealtimeService } from '../asset-types/asset-types.realtime.service';
import * as i0 from "@angular/core";
declare const MO_TYPES: readonly ["asset", "dynamicGroup", "brokerSource", "brokerSourceInactive", "group", "other"];
type MoTypes = (typeof MO_TYPES)[number];
type AssetTypes = Omit<MoTypes, 'brokerSource' | 'brokerSourceInactive'>;
/**
* Enumerates the supported asset paths.
*/
export declare enum ASSET_PATH {
/**
* The default asset path.
*/
DEFAULT = "group",
/**
* The asset path for devices.
*/
DEVICE = "device"
}
/**
* Asset paths.
*/
type AssetPath = `${ASSET_PATH}`;
export declare class GroupService {
private assetTypesRealtimeService;
readonly icons: {
readonly brokerSourceInactive: {
readonly icon: "c8y-group-remote-inactive";
readonly iconOpen: "c8y-group-remote-inactive";
};
readonly brokerSource: {
readonly icon: "c8y-group-remote";
readonly iconOpen: "c8y-group-remote-open";
};
readonly group: {
readonly icon: "c8y-group";
readonly iconOpen: "c8y-group-open";
};
readonly dynamicGroup: {
readonly icon: "c8y-group-smart";
readonly iconOpen: "c8y-group-smart-open";
};
readonly other: {
readonly icon: "exchange";
readonly iconClass: "statusUnknown";
};
};
/**
* A mapping of managed object types to their corresponding asset path.
*/
assetPaths: Map<AssetTypes, AssetPath>;
dataBrokerSourceFragmentInactive: string;
constructor(assetTypesRealtimeService: AssetTypesRealtimeService);
/**
* Finds an icon based on the contents of a managed object.
* It takes into account factors such as type, and specific fragments.
* @param mo Managed object to be checked.
* @param open Determines whether the method should return an alternative icon showing the open state.
* @param fallbackIcon If no icon is found, this icon is returned.
* @returns Returns an icon.
*/
getIcon(mo: IManagedObject, open?: boolean, fallbackIcon?: string): Promise<string>;
/**
* Checks whether a given managed object is a group.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is a group.
*/
isGroup(mo: IManagedObject): boolean;
/**
* Checks whether a given managed object is a dynamic group.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is a dynamic group.
*/
isDynamicGroup(mo: IManagedObject): boolean;
/**
* Checks whether a given managed object is a data broker.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is a data broker.
*/
isDataBroker(mo: IManagedObject): boolean;
/**
* Checks whether a given managed object is a data broker active.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is a data broker active.
*/
isDataBrokerActive(mo: IManagedObject): boolean;
/**
* Checks whether a given managed object is an asset.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is an asset.
*/
isAsset(mo: IManagedObject): boolean;
/**
* Checks whether the object belongs to any type of group.
* Types of groups: group, dynamic group, data broker, data broker active.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object belongs to the group category.
*/
isAnyGroup(mo: IManagedObject): boolean;
/**
* Checks whether a given managed object is a device.
* @param mo Managed object to be checked.
* @returns Returns true if the managed object is a device.
*/
isDevice(mo: IManagedObject): boolean;
/**
* Retrieves the path associated with a given managed object.
* @param mo The managed object for which the asset path is to be retrieved.
* @returns The path associated with the managed object's type.
*/
getAssetPath(mo: IManagedObject): AssetPath;
private getAssetCustomIcon;
private getDefaultIcon;
private determineMoType;
static ɵfac: i0.ɵɵFactoryDeclaration<GroupService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<GroupService>;
}
export {};
//# sourceMappingURL=group.service.d.ts.map