// The messages the bridge publishes, as message-guide.html and alexa-response.html draw them. /** * Why a property changed or an event was raised (message-guide.html, "Cause object"). RULE_TRIGGER is not in that * table; the ChangeReport examples of alexa-securitypanelcontroller.html and alexa-thermostatcontroller.html use it. */ export type ChangeCause = "APP_INTERACTION" | "PERIODIC_POLL" | "PHYSICAL_INTERACTION" | "RULE_TRIGGER" | "VOICE_INTERACTION"; export interface Header { namespace: string; name: string; /** Alexa.SimpleEventSource: the instance that raised the event. */ instance?: string; messageId: string; /** The token of the directive that is answered. An event nobody asked for has none. */ correlationToken?: string; payloadVersion: string; } export interface Endpoint { endpointId: string; } /** One reported property (message-guide.html, "Property object"). */ export interface Property { namespace: string; /** The instance of a generic controller. */ instance?: string; name: string; value: unknown; /** When the value was sampled or last changed, ISO 8601 in UTC. */ timeOfSample: string; uncertaintyInMilliseconds: number; } export interface Event

> { header: Header; endpoint: Endpoint; payload: P; } export interface Context { properties: Property[]; } /** A Response, a StateReport or the response of an interface that has its own (Arm.Response). */ export interface ResponseMessage { event: Event; context: Context; } export interface DeferredResponseMessage { event: Event<{ estimatedDeferralInSeconds?: number }>; } export interface ErrorResponseMessage { event: Event<{ type: string; message: string } & Record>; } export interface ChangeReportMessage { event: Event<{ change: { cause: { type: ChangeCause }; properties: Property[] } }>; context: Context; } /** ActivationStarted or DeactivationStarted of a scene. */ export interface SceneEventMessage { event: Event<{ cause: { type: ChangeCause }; timestamp: string }>; context: {}; } /** An event a device raises by itself: DoorbellPress, the Event of Alexa.SimpleEventSource. */ export interface ProactiveEventMessage { event: Event; }