import Long from 'long';
import { Action, ActionCommand, BubbleCommand, CardCommand, Suggestions, Hints, AppInfo, Character, UUID, Meta as ScenarioMeta, SystemMessagePayload, VpsMessageReasonModel } from '@salutejs/scenario';
import { IDevice, ILegacyDevice, IMessage, ISettings, IGetHistoryRequest, IHistoryMessages, IOffset, IStatus, IText, IBytes, IInitialSettings, IVoice } from './proto';
export { IMessage, IDevice, ILegacyDevice, ISettings, InitialSettings, IBytes, IStatus, IText, IVoice } from './proto';
export { Suggestions, TextAction, DeepLinkAction, Action, ActionCommand, AppInfo, UUID, Bubble, Card, PermissionType, PermissionStatus, Character, Hints, ServerAction, VpsMessageReasonModel as SourceMeta, } from '@salutejs/scenario';
export declare type CharacterId = 'sber' | 'eva' | 'joy';
export declare type Surface = 'SBERBOX' | 'STARGATE' | 'SATELLITE' | 'COMPANION' | 'SBOL' | 'TV' | 'TV_HUAWEI' | 'TIME';
export declare type ThemeColorName = 'dark' | 'light';
export declare type Theme = {
    name: ThemeColorName;
};
export declare enum VpsVersion {
    '1.0' = 1,
    '2.0' = 2,
    '3.0' = 3,
    '4.0' = 4,
    '5.0' = 5
}
export declare const MessageNames: {
    ANSWER_TO_USER: string;
    STT: string;
    MTT: string;
    DO_NOTHING: string;
};
export interface DPMessage extends IMessage {
    sessionId: string;
    uuid: UUID;
}
export interface AssistantAppStateBase<T> {
    [key: string]: unknown;
    item_selector?: {
        ignored_words?: string[];
        items: AssistantViewItemBase<T>[];
    };
}
export declare type AssistantAppState = AssistantAppStateBase<Action>;
export interface AssistantViewItemBase<T> {
    number?: number;
    id?: string;
    title?: string;
    aliases?: string[];
    server_action?: AssistantServerAction;
    action?: T;
    [key: string]: unknown;
}
export declare type AssistantViewItem = AssistantViewItemBase<Action>;
export interface AssistantEvents<A extends AssistantSmartAppData> {
    start: () => void;
    data: (command: AssistantClientCustomizedCommand<A>) => void;
    command: <T extends AssistantSmartAppCommand['smart_app_data'] = AssistantSmartAppCommand['smart_app_data']>(data: T) => void;
    error: <T extends AssistantSmartAppError['smart_app_error'] = AssistantSmartAppError['smart_app_error']>(error: T) => void;
    tts: (state: Pick<AssistantTtsStateUpdate, 'state' | 'owner'>) => void;
}
export interface SendDataParams {
    action: AssistantServerAction;
    name?: string;
    requestId?: string;
    /**
     * опциональное поле, считаем "foreground" по умолчанию
     */
    mode?: AssistantServerActionMode;
}
export declare type AssistantClientCommandEvents<C extends AssistantClientCommand = AssistantClientCommand> = {
    [event in C['type']]: (command: C) => void;
};
export interface Assistant<A extends AssistantSmartAppData = AssistantSmartAppData> {
    cancelTts: (() => void) | undefined;
    close: () => void;
    getInitialData: () => AssistantClientCommand[];
    findInInitialData: <T>(args: {
        type?: string;
        command?: string;
    }) => T | undefined;
    getGeo: (() => void) | undefined;
    getRecoveryState: () => unknown;
    on: <K extends keyof AssistantEvents<A>>(event: K, cb: AssistantEvents<A>[K]) => () => void;
    sendAction: <D extends A['smart_app_data'], E extends AssistantSmartAppError['smart_app_error']>(action: SendDataParams['action'], onData?: (data: D) => void, onError?: (error: E) => void, params?: Omit<SendDataParams, 'action'>) => () => void;
    sendData: (params: SendDataParams, onData?: (data: A | AssistantSmartAppError) => void) => () => void;
    sendActionPromisified: (action: SendDataParams['action'], params?: Omit<SendDataParams, 'action'>) => Promise<A['smart_app_data'] | AssistantSmartAppError['smart_app_error']>;
    sendDataPromisified: (params: SendDataParams) => Promise<A | AssistantSmartAppError>;
    sendText: (message: string) => void;
    setHints: (hints: Hints) => void;
    setGetRecoveryState: (next: () => unknown) => void;
    setGetState: (next: () => AssistantAppState) => void;
    setHeaderButtons: (headerButtons: SystemMessageHeaderByttonsType) => void;
    setSuggests: (suggestions: Suggestions['buttons']) => void;
    subscribeToCommand: <K extends keyof AssistantClientCommandEvents>(event: K, cb: AssistantClientCommandEvents[K]) => () => void;
    ready: () => void;
}
export declare type AssistantDev<A extends AssistantSmartAppData> = Assistant<A> & {
    nativePanel: {
        show: () => void;
        hide: () => void;
    };
};
export interface AssistantServerActionAppInfo {
    projectId: string;
    applicationId?: string;
    appversionId?: string;
}
export declare type AssistantServerAction = {
    action_id: string;
    parameters?: any;
} | {
    type: string;
    payload?: any;
};
export declare type AssistantServerActionMode = 'background' | 'foreground';
export declare type AssistantCommands = ActionCommand | AssistantThemeCommand | AssistantCharacterCommand | AssistantCloseAppCommand | AssistantNavigationCommand | AssistantSmartAppCommand | AssistantVisibilityCommand | AssistantPlayerCommand | AssistantSystemCommand;
export interface SdkMeta {
    mid?: string;
    requestId?: string;
}
export interface AssistantThemeCommand {
    type: 'theme';
    theme: Theme;
    sdk_meta?: SdkMeta;
}
export interface AssistantCharacterCommand {
    type: 'character';
    character: Character;
    sdk_meta: SdkMeta;
}
export interface Insets {
    left: number;
    top: number;
    right: number;
    bottom: number;
}
export interface AssistantInsetsCommand {
    type: 'insets' | 'dynamic_insets' | 'minimum_static_insets' | 'maximum_static_insets';
    insets: Insets;
    sdk_meta: SdkMeta;
}
export interface AssistantCloseAppCommand {
    type: 'close_app';
}
export interface AssistantNavigationCommand {
    type: 'navigation';
    navigation: {
        command: 'UP' | 'DOWN' | 'LEFT' | 'RIGHT' | 'FORWARD';
    };
    sdk_meta?: SdkMeta;
}
export interface AssistantActionCommand {
    type: 'action';
    action: {
        type: string;
        [key: string]: unknown;
    };
}
export interface AssistantSmartAppData<P = any> {
    type: 'smart_app_data';
    smart_app_data: P;
    sdk_meta?: SdkMeta;
}
export interface AssistantSmartAppError {
    type: 'smart_app_error';
    smart_app_error: {
        code: number;
        description: string;
    };
    sdk_meta?: SdkMeta;
}
export interface AssistantSmartAppCommand<T = string, P = any> extends AssistantSmartAppData {
    smart_app_data: {
        type: T;
        payload?: P;
    };
    sdk_meta?: SdkMeta;
}
export interface AssistantStartSmartSearch {
    type: 'start_smart_search';
    start_smart_search: {
        query: string;
        timeoutMS: string;
    };
    sdk_meta?: SdkMeta;
}
export interface AssistantGeoLocationCommand {
    type: 'geo_location';
    geo: {
        /** разрешение клиента на передачу данных */
        geo_permission: 'granted' | 'denied_once' | 'denied_permanently';
        /** признак работы служб геолокации на устройстве, передается только для Android */
        is_geo_available?: boolean;
        locations: Array<{
            /** тип подключения для передачи данных */
            source: string;
            /** широта десятичной дробью */
            lat: string;
            /** долгота десятичной дробью */
            lon: string;
            /** точность в метрах */
            accuracy: string;
            /** время получения координат в миллисекундах (UTC) */
            timestamp: string;
            /** скорость движения в м/с */
            speed?: string;
            /** высота в метрах */
            altitude?: string;
        }>;
    };
}
export interface AppContext {
    app_info: AppInfo;
    device_id: string;
    user_id: string;
    platform: string;
    sdk_version: string;
    surface: Surface | string;
    surface_version: string;
    stand: string;
    locale: 'ru_RU' | string;
    features: {
        [key: string]: unknown;
    };
}
export interface AssistantAppContext {
    type: 'app_context';
    app_context: AppContext;
    sdk_meta?: SdkMeta;
}
export interface AssistantPlayerCommand {
    type: 'player_command';
    player_command: {
        [key: string]: unknown;
    };
}
export interface AssistantVisibilityCommand {
    type: 'visibility';
    visibility: 'visible' | 'hidden';
    sdk_meta?: SdkMeta;
}
export interface AssistantSystemCommand {
    type: 'system';
    system: {
        command: string;
        [key: string]: unknown;
    };
}
export interface AssistantTtsStateUpdate {
    type: 'tts_state_update';
    state: 'start' | 'stop';
    owner: boolean;
}
export interface AssistantFeatureLauncherCommand {
    type: 'feature_launcher';
    feature_launcher: Record<string, unknown>;
}
export declare type AssistantClientCustomizedCommand<T extends AssistantSmartAppData> = AssistantAppContext | AssistantThemeCommand | AssistantCharacterCommand | AssistantNavigationCommand | AssistantVisibilityCommand | AssistantInsetsCommand | AssistantSmartAppError | AssistantTtsStateUpdate | AssistantGeoLocationCommand | AssistantFeatureLauncherCommand | T;
export declare type AssistantClientCommand = AssistantClientCustomizedCommand<AssistantSmartAppCommand>;
export interface AssistantClient {
    onStart?: () => void;
    onRequestState?: () => Record<string, unknown>;
    onRequestRecoveryState?: () => unknown;
    onData?: (command: AssistantClientCommand) => void;
}
export interface AssistantHost {
    cancelTts?: (options: string) => void;
    close: () => void;
    getGeo?: () => void;
    ready: () => void;
    sendData: (action: string, message: string | null) => void;
    sendDataContainer: (container: string) => void;
    sendText: (message: string) => void;
    setSuggests: (suggest: string) => void;
    setHints: (hints: string) => void;
    setHeaderButtons?: (headerButtons: string) => void;
}
export interface AssistantWindow {
    AssistantHost: AssistantHost;
    AssistantClient?: AssistantClient;
    appInitialData: Array<AssistantClientCommand>;
    appRecoveryState: unknown;
    __dangerouslySendDataMessage?: (data: {}, name: string) => void;
    __dangerouslySendVoiceMessage?: (message: string) => void;
    __dangerouslyGetAssistantAppState?: () => AssistantAppState;
    __dangerouslySendTextMessage?: (text: string) => void;
    __ASSISTANT_CLIENT__: {
        version: string;
        firstSmartAppDataMid?: string;
    };
}
export interface AssistantBackgroundApp {
    appInfo: AppInfo;
    getState?: () => Promise<Record<string, unknown>>;
}
export declare type EventsType = {
    connecting: () => void;
    ready: () => void;
    close: () => void;
    message: (message: OriginalMessageType) => void;
    systemMessage: (systemMessageData: SystemMessageDataType, originalMessage: OriginalMessageType) => void;
    outcoming: (message: OriginalMessageType) => void;
    connectionError: (error: Event) => void;
};
export declare type ItemType = Partial<BubbleCommand> & Partial<CardCommand> & Partial<ActionCommand> & {
    command?: AssistantCommand;
};
export declare type AssistantCommand = Omit<AssistantSmartAppData, 'sdk_meta'> | Omit<AssistantStartSmartSearch, 'sdk_meta'> | Omit<AssistantSystemCommand, 'sdk_meta'> | Omit<AssistantNavigationCommand, 'sdk_meta'> | {
    type: string;
    [k: string]: unknown;
};
export declare type EmotionId = 'bespokoistvo' | 'idle' | 'igrivost' | 'laugh' | 'listen' | 'load' | 'neznayu' | 'ok_prinyato' | 'oups' | 'podavleniye_gneva' | 'predvkusheniye' | 'simpatiya' | 'smushchennaya_ulibka' | 'talk' | 'udovolstvie' | 'vinovatiy' | 'zadumalsa' | 'zhdu_otvet';
export interface AssistantMeta {
    theme: ThemeColorName;
    [key: string]: unknown;
}
export interface AssistantBackgroundAppInfo {
    app_info: AppInfo;
    state: Record<string, unknown>;
}
export interface Meta extends ScenarioMeta, AssistantMeta {
    source?: VpsMessageReasonModel;
    [key: string]: unknown;
}
export interface AdditionalMeta extends Pick<Meta, 'source'> {
    [key: string]: unknown;
}
export declare type SystemMessageHeaderByttonsType = SystemMessagePayload['header_buttons'];
export declare type SystemMessageDataType = {
    activate_app_info?: boolean;
    app_info?: AppInfo;
    auto_listening: boolean;
    answerId?: number;
    items?: Array<ItemType>;
    suggestions?: Suggestions;
    hints?: Hints;
    character?: Character;
    emotion?: {
        emotionId: EmotionId;
    };
    feature_launcher?: Record<string, unknown>;
    server_action?: AssistantServerAction;
    sdk_meta?: SdkMeta;
    header_buttons?: SystemMessageHeaderByttonsType;
};
export interface OriginalMessageType {
    messageId: Mid;
    last: number;
    messageName: string;
    token?: string | null;
    userId?: string | null;
    vpsToken?: string | null;
    version?: number;
    bytes?: IBytes | null;
    voice?: IVoice | null;
    text?: IText | null;
    status?: IStatus | null;
    initialSettings?: IInitialSettings | null;
    cancel?: {} | null;
    device?: IDevice | null;
    legacyDevice?: ILegacyDevice | null;
    settings?: ISettings | null;
    systemMessage?: {
        data?: string | null;
    } | null;
    timestamp?: number | Long | null;
    meta?: {
        [k: string]: string;
    } | null;
}
export declare type NonNullableProperties<T> = {
    [P in keyof T]: NonNullable<T[P]>;
};
export declare type Status = Required<NonNullableProperties<IStatus>>;
export interface WSCreator {
    (url: string): WebSocket;
}
export interface FakeVpsParams {
    createFakeWS: WSCreator;
}
export declare type VpsConfiguration = {
    url: string;
    userId: string;
    userChannel: string;
    locale?: string;
    device?: IDevice;
    settings: ISettings;
    fakeVps?: FakeVpsParams;
    legacyDevice?: ILegacyDevice;
    version: VpsVersion;
    messageName?: string;
    vpsToken?: string;
    logger?: ClientLogger;
    getToken?: () => Promise<string>;
};
export interface IncomingMessage {
    type: 'incoming';
    text?: {
        data?: string | null;
    };
    message?: {
        data: SystemMessageDataType;
        name: string;
        sdk_meta?: SdkMeta;
    };
}
export interface OutcomingMessage {
    type: 'outcoming';
    text?: {
        data?: string | null;
    };
    message?: {
        data: {
            server_action?: any;
            [key: string]: any;
        };
        name: string;
        sdk_meta?: SdkMeta;
    };
}
export declare type ClientLoggerInitEntryData = Omit<VpsConfiguration, 'getToken' | 'logger'> & {
    token: string;
};
export declare type ClientLoggerInitEntry = {
    type: 'init';
    params: ClientLoggerInitEntryData;
};
export declare type ClientLoggerIncomingEntry = {
    type: 'incoming';
    message: IMessage;
};
export declare type ClientLoggerOutcomingEntry = {
    type: 'outcoming';
    message: IMessage;
};
export declare type ClientLoggerEntry = ClientLoggerInitEntry | ClientLoggerIncomingEntry | ClientLoggerOutcomingEntry;
export interface ClientLogger {
    (entry: ClientLoggerEntry): void;
}
export interface AssistantRecord {
    parameters?: ClientLoggerInitEntryData;
    entries: Array<IncomingMessage | OutcomingMessage>;
    version: string;
}
export interface RecordSaver {
    save: (record: object) => void;
}
export interface AssistantSettings {
    dubbing?: boolean;
    echo?: number | null;
    ttsEngine?: string | null;
    asrEngine?: string | null;
    asrAutoStop?: number | null;
    devMode?: number | null;
    authConnector?: string | null;
    surface?: string | null;
}
export declare type AssistantPostMessage = {
    type: 'sendDataContainer';
    payload: string;
} | {
    type: 'close';
} | {
    type: 'sendData';
    payload: string;
} | {
    type: 'setSuggests';
    payload: string;
} | {
    type: 'setHints';
    payload: string;
} | {
    type: 'sendText';
    payload: string;
} | {
    type: 'ready';
} | {
    type: 'onStart';
} | {
    type: 'onData';
    payload: AssistantClientCommand;
} | {
    type: 'onRequestState';
    requestId: string;
} | {
    type: 'onRequestRecoveryState';
} | {
    type: 'state';
    payload: Record<string, unknown> | undefined;
    requestId: string;
} | {
    type: 'recoveryState';
    payload: unknown;
} | {
    type: 'onBack';
} | {
    type: 'setHeaderButtons';
    payload: string;
};
export declare type GetHistoryRequestProto = IGetHistoryRequest;
export declare type GetHistoryRequestClient = Omit<IGetHistoryRequest, 'app' | 'offset'> & {
    app?: Partial<Pick<AppInfo, 'systemName' | 'projectId'> & {
        type: AppInfo['frontendType'];
    }> | null;
    offset?: IOffset & {
        limit?: number;
        contentId?: string;
    };
};
export declare type HistoryMessages = Omit<IHistoryMessages, 'content'> & {
    content: {
        additional_info: string;
        messageId: number;
        type: string;
        system: {
            app_info?: AppInfo;
            items: ItemType[];
            time: Meta['time'];
        };
    };
};
export declare type Mid = number | Long;
//# sourceMappingURL=typings.d.ts.map