import type { ChangeCause, ChangeReportMessage, DeferredResponseMessage, ErrorResponseMessage, ProactiveEventMessage, Property, ResponseMessage, SceneEventMessage } from "./types.js"; /** A message that would be dropped on its way to Alexa, refused where it is built. */ export declare class MessageError extends Error { readonly endpointId: string; readonly problem: string; constructor(endpointId: string, problem: string); } interface Envelope { endpointId: string; /** Default: a new version 4 UUID, which is what Alexa recommends (message-guide.html, "Header object"). */ messageId?: string; } interface Answer extends Envelope { /** The correlationToken of the directive that is answered. */ correlationToken: string; } export interface ResponseFields extends Answer { /** Default: "Response". */ name?: string; /** Default: "Alexa". An interface with a response of its own names it: Alexa.SecurityPanelController, Arm.Response. */ namespace?: string; payload?: Record; /** The state of the endpoint after the directive. */ context?: readonly Property[]; } /** * The answer to a directive (alexa-response.html, "Synchronous response"). An endpoint with nothing to report * answers with an empty list of properties, not without a context (state-reporting-for-smart-home-addons.html, * "Directive response example for a property that isn't retrievable"). */ export declare function response(fields: ResponseFields): ResponseMessage; /** The answer to ReportState: every retrievable property of the endpoint. */ export declare function stateReport(fields: Answer & { context?: readonly Property[]; }): ResponseMessage; /** * "The directive arrived, the answer follows": no context, the state is in the Response that follows * (alexa-response.html, "Deferred response example"). */ export declare function deferredResponse(fields: Answer & { estimatedDeferralInSeconds?: number; }): DeferredResponseMessage; export interface ErrorResponseFields extends Answer { /** "ENDPOINT_UNREACHABLE" */ type: string; /** For the log of the skill. */ message: string; /** The fields a type adds to the payload: validRange, currentDeviceMode. */ extra?: Record; /** Default: the namespace the type is documented under, see errorNamespace(). */ namespace?: string; } /** The answer to a directive the endpoint could not follow (alexa-errorresponse.html). */ export declare function errorResponse(fields: ErrorResponseFields): ErrorResponseMessage; export interface ChangeReportFields extends Envelope { /** Default: "PHYSICAL_INTERACTION". */ cause?: ChangeCause; /** The properties that changed, at least one. */ changed: readonly Property[]; /** The other properties of the endpoint, as they are now. */ context?: readonly Property[]; } /** The same property of the same instance, whatever its value. */ export declare const sameProperty: (a: Property, b: Property) => boolean; /** * A change of state nobody asked for. The header has no correlationToken (message-guide.html, "Header object"). * A property that changed is left out of the context: it is reported in one of the two (same page, "Context * object"). Throws MessageError when nothing changed: Alex2MQTT drops such a report without a word. */ export declare function changeReport(fields: ChangeReportFields): ChangeReportMessage; export interface SceneEventFields extends Answer { /** true: ActivationStarted. false: DeactivationStarted. */ activated: boolean; /** Default: "VOICE_INTERACTION", a scene is started by a directive. */ cause?: ChangeCause; /** When the scene started. Default: now. */ timestamp?: string | Date; } /** The answer to Activate and Deactivate of a scene (alexa-scenecontroller.html). */ export declare function sceneEvent(fields: SceneEventFields): SceneEventMessage; export interface DoorbellPressFields extends Envelope { /** Default: "PHYSICAL_INTERACTION", somebody pressed the button. */ cause?: ChangeCause; /** When the button was pressed. Default: now. */ timestamp?: string | Date; } /** Somebody rang (alexa-doorbelleventsource.html). */ export declare function doorbellPress(fields: DoorbellPressFields): ProactiveEventMessage; export interface SimpleEventFields extends Envelope { /** The instance of Alexa.SimpleEventSource that raises the event. */ instance: string; /** The id of the event as discovery listed it: "Button.SinglePush.1". */ id: string; /** When the event happened. Default: now. */ timestamp?: string | Date; } /** An event of a button or a sensor that routines start on (alexa-simpleeventsource.html). */ export declare function simpleEvent(fields: SimpleEventFields): ProactiveEventMessage; export {};