UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

27 lines 1.47 kB
import { PipeTransform } from '@angular/core'; import { IAuditRecord } from '@c8y/client'; import { TranslateService } from '@ngx-translate/core'; import * as i0 from "@angular/core"; /** * A pipe for transforming audit record data into localized messages. * It specifically addresses changes in the audit records, with an emphasis on status changes. */ export declare class AuditChangesMessagePipe implements PipeTransform { private translateService; constructor(translateService: TranslateService); /** * Transforms an IAuditRecord into a localized string message. * If the record contains changes, and if the first change is related to the 'status' attribute, * it formats a message indicating the status change. Otherwise, it returns a general activity message. * Example when there is a status change: "Alarm status changed from ACKNOWLEDGED to ACTIVE". * Example when record does not have a status attribute: "Alarm updated". * * @param record - The audit record to be transformed. * @returns The localized message describing the audit record, * particularly focusing on status changes if applicable. */ transform(record: IAuditRecord): string; static ɵfac: i0.ɵɵFactoryDeclaration<AuditChangesMessagePipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<AuditChangesMessagePipe, "auditChangesMessage", true>; } //# sourceMappingURL=audit-changes-message.pipe.d.ts.map