UNPKG

@farris/devkit-vue

Version:
64 lines (63 loc) 1.37 kB
import { Module } from '../../module/index'; import { Store } from '../store'; import { StateMachineConfig, StateMachineConfigManager } from './configs/index'; import { StateMachineWatcher } from './state-machine-watcher'; /** * 状态机状态定义 */ declare class StateMachineState { /** * 当前页面状态 */ currentPageState: string; /** * 其他可视化状态 */ [key: string]: boolean | string; } /** * 状态机定义 */ declare class StateMachine<S extends StateMachineState> extends Store<S> { /** * 状态渲染器 */ private renders; /** * 配置管理器 */ configManager: StateMachineConfigManager; /** * 外部状态监听器 */ stateWatcher: StateMachineWatcher; /** * 构造函数 */ constructor(module: Module); /** * 初始化 */ init(config: StateMachineConfig): void; /** * 获取状态值 */ getValue(name: string): any; /** * 迁移到初始状态 */ transitToInitState(): void; /** * 迁移状态 */ transitTo(nextPageState: string): void; /** * 注册渲染器 */ registerRender(name: string, render: any): void; /** * 刷新状态 */ refreshState(nextPageState?: string): void; } export { StateMachineState, StateMachine };