UNPKG

olympus-r

Version:

一个力求简单易用的前端开发框架 #### 开发语言 TypeScript #### 核心架构 MVC #### 模块间通讯和解耦 采用事件机制,利用一个全局唯一的事件派发器进行模块间通讯,解耦模块间依赖 #### 表现层结构 使用桥接模式拆分接口与实现,达到一套核心驱动多套表现层的目的(目前支持DOM、Egret、PixiJS三种表现层),同时支持表现层的未来可扩展性 #### TypeScript装饰器注入 框架提供TypeScript装饰器注入功能,便捷获取托管对象。例如:

40 lines (39 loc) 1.03 kB
import IPanel from "./IPanel"; /** * @author Raykid * @email initial_r@qq.com * @create date 2017-09-21 * @modify date 2017-09-21 * * 通用弹窗的各种接口 */ export declare enum ButtonType { normal = 0, important = 1 } export interface IPromptParams { msg: string; style?: any; title?: string; handlers?: IPromptHandler[]; } export interface IPromptHandler { /** 与按钮绑定的数据 */ data: any; /** 按钮上显示的文本,不传递则默认使用data的字符串值 */ text?: string; /** 回调函数,当前按钮被点击时调用,参数为data对象 */ handler?: (data?: any) => void; /** 按钮类型,默认为normal */ buttonType?: ButtonType; } export interface IPromptPanelConstructor { new (): IPromptPanel; } export default interface IPromptPanel extends IPanel { /** * 更新通用提示窗显示 * @param params 弹窗数据 */ update(params: IPromptParams): void; }