UNPKG

dt-common-device

Version:

A secure and robust device management library for IoT applications

56 lines (55 loc) 2.07 kB
import { AlertService } from "./Alert.service"; /** * Example usage of the updated AlertService with AlertBuilder integration * This file demonstrates various ways to use the AlertService with the new AlertBuilder */ export declare class AlertServiceExample { private readonly alertService; constructor(alertService: AlertService); /** * Example 1: Using the updated createAlert method with AlertBuilder */ createAlertWithBuilder(): Promise<import("./alert.types").AlertDocument>; /** * Example 2: Using convenience methods for specific alert types */ createSpecificAlerts(): Promise<{ readinessAlert: import("./alert.types").AlertDocument; operationsAlert: import("./alert.types").AlertDocument; securityAlert: import("./alert.types").AlertDocument; energyAlert: import("./alert.types").AlertDocument; }>; /** * Example 3: Using device-specific alert methods */ createDeviceAlerts(): Promise<{ deviceAlert1: import("./alert.types").AlertDocument; deviceAlert2: import("./alert.types").AlertDocument; }>; /** * Example 4: Using hub-specific alert methods */ createHubAlerts(): Promise<{ hubAlert1: import("./alert.types").AlertDocument; hubAlert2: import("./alert.types").AlertDocument; }>; /** * Example 5: Using static factory methods with AlertBuilder */ createAlertsWithStaticMethods(): Promise<{ alert1: import("./alert.types").AlertDocument; alert2: import("./alert.types").AlertDocument; }>; /** * Example 6: Creating multiple alerts efficiently */ createMultipleAlerts(): Promise<import("./alert.types").AlertDocument[]>; /** * Example 7: Creating alerts with snooze functionality */ createSnoozedAlert(): Promise<import("./alert.types").AlertDocument>; /** * Example 8: Backward compatibility - still works with CreateAlertData */ createAlertWithLegacyData(): Promise<import("./alert.types").AlertDocument>; }