import * as Tp from 'thingpedia'; import { EntityMap } from '../../utils/entity-utils'; import { MessageType, SubprotocolType } from './message_type'; export interface ConversationIDMessage { type: MessageType.ID; id: string; } export interface PingMessage { type: MessageType.PING; } export interface AskSpecialMessage { type: MessageType.ASK_SPECIAL; ask: string | null; context: { code: string[]; entities: EntityMap; }; } export interface HypothesisMessage { type: MessageType.HYPOTHESIS; hypothesis: string; } export interface NewDeviceMessage { type: MessageType.NEW_DEVICE; uniqueId: string; state: Tp.BaseDevice.DeviceState; } export interface ErrorMessage { type: MessageType.ERROR; message: string; code?: string; } /** * Enable a subprotocol on this connection */ export interface ClientRequestSubprotocolCommand { type: MessageType.REQUEST_SUBPROTOCOL; proto: SubprotocolType; caps: string[]; }