UNPKG

@salutejs/client

Version:

Модуль взаимодействия с виртуальным ассистентом

30 lines 1.41 kB
import { AssistantRecord, AssistantAppState, AssistantServerAction, AssistantClientCustomizedCommand, AssistantSmartAppData } from './typings'; export interface AssistantActionResult { action: AssistantServerAction; name?: string | null; requestId?: string; state: AssistantAppState; } export interface CommandParams { onRequest?: () => void; waitRequest?: boolean; } export declare const createAssistantHostMock: ({ context }?: { context?: Window | undefined; }) => { addActionHandler: <T extends AssistantServerAction>(actionType: string, handler: (action: T) => void) => void; removeActionHandler: (actionType: string) => void; receiveCommand: <T_1 extends AssistantSmartAppData<any>>(command: AssistantClientCustomizedCommand<T_1>) => Promise<unknown>; waitAction: (onAction?: (() => void) | undefined) => Promise<AssistantActionResult>; onReady: (cb: () => void) => void; }; export declare const createAssistantHostMockWithRecord: ({ context, record, }: { context?: (Window & typeof globalThis) | undefined; record: AssistantRecord; }) => { readonly hasNext: boolean; onReady: (cb: () => void) => void; next: ({ onRequest, waitRequest }?: CommandParams) => Promise<unknown>; receiveCommand: <T extends AssistantSmartAppData<any>>(command: AssistantClientCustomizedCommand<T>) => Promise<unknown>; }; //# sourceMappingURL=mock.d.ts.map