UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

58 lines 2.17 kB
import { InjectionToken } from '@angular/core'; import { GenericHookType, GenericHookOptions } from '@c8y/ngx-components'; import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons'; /** * Extension hook allowing to register custom service statuses and configure their visual presentation. * @deprecated Consider using the `hookServiceStatus` function instead. */ export declare const HOOK_SERVICE_STATUS: InjectionToken<StatusOption | StatusOption[]>; /** * Extension hook allowing to register custom service statuses and configure their visual presentation. * * You can either provide a single `StatusOption` as parameter: * ```typescript * hookServiceStatus(...) * ``` * * Or an array to directly register multiple: * ```typescript * hookServiceStatus([...]) * ``` * * Or you provide an Service that implements `ExtensionFactory<StatusOption>` * ```typescript * export class MyServiceStatusFactory implements ExtensionFactory<StatusOption> {...} * ... * hookServiceStatus(MyServiceStatusFactory) * ``` * A typed alternative to `HOOK_SERVICE_STATUS`. * @param status The `StatusOption`'s or `ExtensionFactory` to be provided. * @returns An `Provider` to be provided in your module. */ export declare function hookServiceStatus(status: GenericHookType<StatusOption>, options?: Partial<GenericHookOptions>): import("@angular/core").ValueProvider | import("@angular/core").ClassProvider | import("@angular/core").ExistingProvider; /** * Defines the visual presentation of a service status option. */ export interface StatusOption { /** * Key used for this status in the c8y_Service object. */ key: string; /** * Human readable name of the status used to be translated. */ label: string; /** * An icon to use to display the status. */ icon: SupportedIconsSuggestions; /** * CSS class(es) used to e.g. accent the status (contextual color, etc.) */ class?: string; } /** * Standard status options supported by the platform. */ export declare const SERVICE_STATUS_OPTIONS: StatusOption[]; //# sourceMappingURL=status-options.model.d.ts.map