import { IMayHaveChannelId } from "./channel"; import { ACTION } from "./command/action"; import { baseParamsType } from "./command/baseparams"; import { ICOMMAND, IKeyMaybeValue, IRESPONSE, RESULT } from "./command/icommand"; import { EnumBooleanStringified, JSONString } from "../@types"; import { ComaSeparatedValues } from "./sessionstate"; export declare type toyType = { id: string; nickName?: string; name: string; status: number; connect: string; md5?: string; battery?: string; fVersion?: string; control?: string; mode?: string; version?: string; dateTime?: string; iid?: string; }; export declare type toyLocalAppResponseType = { type: string; code: number; data: Map; }; /** * update the toy state */ export declare class CMDP_TOYSTATE implements ICOMMAND { action: ACTION; params: baseParamsType & { /** * @deprecated old */ online?: boolean; } & { toyListJson?: JSONString>; localAppJson?: JSONString; selected?: ComaSeparatedValues; }; } /** * response for CMDP_TOYSTATE */ export declare class CMDP_TOYSTATE_RESPONSE extends CMDP_TOYSTATE implements IRESPONSE { result: RESULT; /** unused */ values: IKeyMaybeValue; /** unused */ commands: ICOMMAND[]; } /** the toy action parameters */ export declare type toyActionParams = { /** milliseconds */ duration: string; /** float value from 0.0 to 1.0 */ intensity: string; /** the messageKey - correlation to CMDP_MSG with gift */ messageKey?: string; /** the relationId of this Action */ relationId?: string; /** the text message from backend */ text?: string; /** language */ language?: string; }; /** * B2B only. command to send the toy action to channel */ export declare class CMDP_TOYACTION implements ICOMMAND { action: ACTION; params: baseParamsType & IMayHaveChannelId & toyActionParams; } /** response for CMDP_TOYACTION */ export declare class CMDP_TOYACTION_RESPONSE extends CMDP_TOYACTION implements IRESPONSE { result: RESULT; /** unused */ values: IKeyMaybeValue; /** unused */ commands: ICOMMAND[]; } /** * the toy action command */ export declare class CMDC_TOYACTION implements ICOMMAND { action: ACTION; params: IMayHaveChannelId & toyActionParams & IKeyMaybeValue; } export declare class CMDP_GETTOYQRCODE implements ICOMMAND { action: ACTION; params: baseParamsType & { forceNew?: EnumBooleanStringified; grBase64?: EnumBooleanStringified; }; } export declare class CMDP_GETTOYQRCODE_RESPONSE extends CMDP_GETTOYQRCODE implements IRESPONSE { result: RESULT; values: { code?: string; grBase64?: string; }; commands: ICOMMAND[]; } export declare class CMDP_GETTOYLIST implements ICOMMAND { action: ACTION; params: baseParamsType & ({ clientID?: string; } | { chatID?: string; }); } export declare class CMDP_GETTOYLIST_RESPONSE extends CMDP_GETTOYLIST implements IRESPONSE { result: RESULT; values: { toys?: JSONString>; selected?: ComaSeparatedValues; }; commands: ICOMMAND[]; } export declare class CMDC_TOYLIST implements ICOMMAND { action: ACTION; params: { sessionID?: string; toys?: JSONString>; selected?: ComaSeparatedValues; }; } export declare type toyCommandFunctionType = { command: "Function" | string; action: string; timeSec: string; loopRunningSec?: string; loopPauseSec?: string; toy: string; stopPrevious?: "1" | "0" | string; }; export declare type toyCommandPatternType = { command: "Pattern" | string; rule: string; strength: string; timeSec: string; toy: string; }; export declare type toyCommandPresetType = { command: "Preset" | string; name: string; timeSec: string; toy: string; }; export declare class CMDP_TOYCOMMAND implements ICOMMAND { action: ACTION; params: baseParamsType & ({ clientID?: string; } | { chatID?: string; }) & { toy: string; } & (toyCommandFunctionType | toyCommandPatternType | toyCommandPresetType); } export declare class CMDP_TOYCOMMAND_RESPONSE extends CMDP_TOYCOMMAND implements IRESPONSE { result: RESULT; values: IKeyMaybeValue; commands: ICOMMAND[]; } export declare class CMDC_TOYCOMMAND implements ICOMMAND { action: ACTION; params: { sessionID?: string; chatID?: string; } & { toy: string; } & (toyCommandFunctionType | toyCommandPatternType | toyCommandPresetType); }