dt-common-device
Version:
A secure and robust device management library for IoT applications
24 lines (23 loc) • 637 B
TypeScript
import { DeviceEvent } from "./DeviceEvent";
export interface IEventHandler {
/**
* Handle a single transformed event
*/
handleEvent(event: DeviceEvent): Promise<void>;
/**
* Handle multiple events
*/
handleEvents(events: DeviceEvent[]): Promise<void>;
/**
* Check if this handler can process the given event type
*/
canHandle(eventType: string): boolean;
/**
* Get the priority of this handler (lower numbers = higher priority)
*/
getPriority(): number;
/**
* Get the event types this handler can process
*/
getSupportedEventTypes(): string[];
}