UNPKG

@sberdevices/plasma-temple

Version:

SberDevices CanvasApp Templates.

45 lines 1.88 kB
import { CharacterId, AssistantInsetsCommand, AssistantSmartAppData } from '@sberdevices/assistant-client'; import { Action as StateAction } from '../utils/createAction'; export declare type AssistantInsets = AssistantInsetsCommand['insets']; export interface UIState { character: CharacterId; insets: AssistantInsets; } export interface History<N extends string = string, T = unknown> { name: N; data: T; } export interface AppState { history: History[]; ui: UIState; } export declare enum AppStateActionType { CHARACTER = "character", INSETS = "insets", PUSH_HISTORY = "pushHistory", REPLACE_PREVIOUS_HISTORY = "replacePreviousHistory", POP_HISTORY = "popHistory", CHANGE_ACTIVE_SCREEN_STATE = "changeActiveScreenState" } export interface Action<A extends Record<string, unknown>> extends AssistantSmartAppData { smart_app_data: A; } export declare type CharacterAction = StateAction<AppStateActionType.CHARACTER, { character: CharacterId; }>; export declare type InsetsAction = StateAction<AppStateActionType.INSETS, { insets: AssistantInsets; }>; export declare type PushHistoryAction = StateAction<AppStateActionType.PUSH_HISTORY, { history: History; }>; export declare type ReplacePreviousHistoryAction = StateAction<AppStateActionType.REPLACE_PREVIOUS_HISTORY, { history: History[]; }>; export declare type PopHistoryAction = StateAction<AppStateActionType.POP_HISTORY, { delta?: number; }>; export declare type ChangeStateAction = StateAction<AppStateActionType.CHANGE_ACTIVE_SCREEN_STATE, History>; export declare type PlasmaAction = Action<PushHistoryAction> | Action<ReplacePreviousHistoryAction> | Action<ChangeStateAction> | Action<PopHistoryAction>; export declare type PlasmaActionData = CharacterAction | InsetsAction | PlasmaAction['smart_app_data']; //# sourceMappingURL=types.d.ts.map