@sberdevices/assistant-client
Version:
Модуль взаимодействия с виртуальным ассистентом
97 lines • 5.54 kB
TypeScript
import { AssistantSettings, AssistantSmartAppData } from './typings';
import { InitializeAssistantSDKParams } from './dev';
import { CreateAssistantParams } from './createAssistant';
export declare type Surface = 'SBERBOX' | 'STARGATE' | 'SATELLITE' | 'COMPANION' | 'SBOL' | 'TV' | 'TV_HUAWEI' | 'TIME';
export declare type Channel = 'B2C' | 'COMPANION_B2C' | 'SBOL';
export declare type CreateAssistantDevParams = CreateAssistantParams & {
surface?: Surface | string;
userChannel?: Channel | string;
} & Pick<InitializeAssistantSDKParams, 'initPhrase' | 'url' | 'userId' | 'token' | 'surfaceVersion' | 'nativePanel' | 'sdkVersion' | 'enableRecord' | 'recordParams' | 'fakeVps' | 'settings' | 'getMeta' | 'features'>;
export declare const createAssistantDev: <A extends AssistantSmartAppData>({ getState, getRecoveryState, ready, surface, userChannel, ...sdkParams }: CreateAssistantDevParams) => {
nativePanel: {
hide: () => void;
show: () => void;
};
cancelTts: (() => void) | undefined;
close: () => void;
getInitialData: () => import("./typings").AssistantClientCustomizedCommand<import("./typings").AssistantSmartAppCommand>[];
findInInitialData: <T>({ type, command }: {
type?: string | undefined;
command?: string | undefined;
}) => T | undefined;
getRecoveryState: () => unknown;
on: <K extends "command" | "error" | "data" | "start">(event: K, cb: import("./createAssistant").AssistantEvents<A>[K]) => () => void;
sendAction: <D extends {
type: string;
payload?: Record<string, unknown> | undefined;
} = {
type: string;
payload?: Record<string, unknown> | undefined;
}, E extends {
code: number;
description: string;
} = {
code: number;
description: string;
}>(action: {
type: string;
payload: Record<string, unknown>;
}, onData?: import("./nanoobservable").ObserverFunc<D> | undefined, onError?: import("./nanoobservable").ObserverFunc<E> | undefined, { name, requestId }?: Pick<import("./createAssistant").SendDataParams, "name" | "requestId">) => () => void;
sendData: ({ action, name, requestId }: import("./createAssistant").SendDataParams, onData?: import("./nanoobservable").ObserverFunc<import("./typings").AssistantSmartAppError | A> | undefined) => () => void;
setGetState: (nextGetState: () => {}) => void;
setGetRecoveryState: (nextGetRecoveryState?: (() => unknown) | undefined) => void;
setSuggests: (suggestions: import("@salutejs/scenario").Button[]) => void;
setHints: (hints: import("@salutejs/scenario/dist/lib/types/systemMessage").Hints) => void;
sendText: (message: string) => void;
ready: () => void;
};
export declare const createSmartappDebugger: <A extends AssistantSmartAppData>({ token, getState, getRecoveryState, ready, settings, nativePanel, ...sdkParams }: {
token: string;
settings?: Pick<AssistantSettings, "dubbing"> | undefined;
} & CreateAssistantParams & Pick<CreateAssistantDevParams, "userChannel" | "surface" | "getMeta" | "initPhrase" | "nativePanel" | "enableRecord" | "recordParams">) => {
nativePanel: {
hide: () => void;
show: () => void;
};
cancelTts: (() => void) | undefined;
close: () => void;
getInitialData: () => import("./typings").AssistantClientCustomizedCommand<import("./typings").AssistantSmartAppCommand>[];
findInInitialData: <T>({ type, command }: {
type?: string | undefined;
command?: string | undefined;
}) => T | undefined;
getRecoveryState: () => unknown;
on: <K extends "command" | "error" | "data" | "start">(event: K, cb: import("./createAssistant").AssistantEvents<A>[K]) => () => void;
sendAction: <D extends {
type: string;
payload?: Record<string, unknown> | undefined;
} = {
type: string;
payload?: Record<string, unknown> | undefined;
}, E extends {
code: number;
description: string;
} = {
code: number;
description: string;
}>(action: {
type: string;
payload: Record<string, unknown>;
}, onData?: import("./nanoobservable").ObserverFunc<D> | undefined, onError?: import("./nanoobservable").ObserverFunc<E> | undefined, { name, requestId }?: Pick<import("./createAssistant").SendDataParams, "name" | "requestId">) => () => void;
sendData: ({ action, name, requestId }: import("./createAssistant").SendDataParams, onData?: import("./nanoobservable").ObserverFunc<import("./typings").AssistantSmartAppError | A> | undefined) => () => void;
setGetState: (nextGetState: () => {}) => void;
setGetRecoveryState: (nextGetRecoveryState?: (() => unknown) | undefined) => void;
setSuggests: (suggestions: import("@salutejs/scenario").Button[]) => void;
setHints: (hints: import("@salutejs/scenario/dist/lib/types/systemMessage").Hints) => void;
sendText: (message: string) => void;
ready: () => void;
};
export { createRecordOfflinePlayer as createRecordPlayer } from './record/offline-player';
export { createOnlineRecordPlayer } from './record/online-player';
export { NativePanelParams } from './NativePanel/NativePanel';
export * from './dev';
export { initializeDebugging } from './debug';
export * from './record/mock-recorder';
export * from './record/createMockWsCreator';
export { createAssistantHostMock, createAssistantHostMockWithRecord, AssistantActionResult, CommandParams, } from './mock';
//# sourceMappingURL=createAssistantDev.d.ts.map