fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

394 lines
6.2 KiB

import { _OB } from "./ob";
export interface WidgetConstructor {
new(config: any): _Widget;
(config: any): _Widget;
readonly prototype: _Widget;
/**
*
* @param engine
*/
registerRenderEngine: (engine: RenderEngine) => void;
}
export interface _Widget extends _OB {
/**
* loading的锁
*/
__asking: boolean;
/**
*
*/
__async: boolean;
/**
* widget类标识符
*/
widgetName: string | null;
/**
*
*/
_isRoot: boolean;
/**
*
*/
_parent: _Widget | null;
// TODO: 完成jquery文件夹后把这块改了
/**
* dom的类jQuery对象
*/
element: any;
/**
*
*/
_children: {
[key: string]: _Widget;
};
/**
*
*/
_isMounted: boolean;
/**
* enable
*/
_manualSetEnable: boolean;
/**
* valid
*/
_manualSetValid: boolean;
/**
*
*/
_renderEngine: RenderEngine;
_store: () => any;
model: any;
// 生命周期函数
/**
*
*/
beforeInit: Function | null;
/**
*
*/
beforeCreate: Function | null;
/**
*
*/
created: Function | null;
/**
*
*/
render: Function | null;
/**
*
*/
beforeMount: Function | null;
/**
*
*/
mounted: Function | null;
/**
*
*/
shouldUpdate: Function | null;
/**
*
*/
update: Function;
/**
*
*/
beforeDestroy: Function | null;
/**
*
*/
destroyed: Function | null;
/**
* render函数
*/
_initRender: () => void;
/**
* render函数
*/
_render: () => void;
/**
*
*/
_initRoot: () => void;
/**
*
*/
_initElementWidth: () => void;
/**
*
*/
_initElementHeight: () => void;
/**
*
*/
_initVisual: () => void;
/**
*
*/
_initEffects: () => void;
/**
* mounted锁
*/
_initState: () => void;
/**
* dom
*/
_initElement: () => void;
/**
*
*/
_setParent: () => void;
/**
* @param force
* @param deep force处理
* @param lifeHook
* @param predicate widget的回调
*/
_mount: (force?: boolean, deep?: boolean, lifeHook?: boolean, predicate?: Function) => boolean;
/**
*
*/
_mountChildren: Function | null;
/**
*
*/
isMounted: () => boolean;
/**
*
*/
setWidth: (w: number) => void;
/**
*
*/
setHeight: (h: number) => void;
/**
*
*/
_setEnable: (enable: boolean) => void;
/**
*
*/
_setValid: (valid: boolean) => void;
/**
*
*/
_setVisible: (visible: boolean) => void;
/**
*
*/
setEnable: (enable: boolean) => void;
/**
*
*/
setVisible: (visible: boolean) => void;
/**
*
*/
setValid: (valid: boolean) => void;
/**
*
* @param args arguments参数
*/
doBehavior: (...args: any[]) => void;
/**
*
*/
getWidth: () => number;
/**
*
*/
getHeight: () => number;
/**
*
*/
isValid: () => boolean;
/**
*
*/
addWidget: (_name: any, _widget: _Widget) => _Widget;
/**
* wigetname获取子元素实例
*/
getWidgetByName: (_name: string) => _Widget;
/**
*
* @param nameOrWidget widgetName或widget实例
*/
removeWidget: (nameOrWidget: string | _Widget) => void;
/**
*
*/
hasWidget: (name: string) => boolean;
/**
* widgetName
*/
getName: () => string;
/**
* tag
* @param tag html tag
*/
setTag: (tag: string) => void;
/**
* tag
*/
getTag: () => string;
/**
*
* @param key
* @param value
*/
attr: (key: string | { [key: string]: any }, value: any) => any;
/**
* text
*/
getText: () => string;
/**
* text
*/
setText: () => void;
/**
*
*/
getValue: () => any;
/**
*
*/
setValue: (...args: any[]) => void;
/**
* enable
*/
isEnabled: () => boolean;
/**
*
*/
isVisible: () => boolean;
/**
* disable元素
*/
disable: ()=> void;
/**
* enable元素
*/
enable: () => void;
/**
* widget合法
*/
valid: () => void;
/**
* 使
*/
invalid: () => void;
/**
* 使
*/
invisible: () => void;
/**
*
*/
visible: () => void;
/**
*
*/
__d: () => void;
/**
*
*/
_unMount: () => void;
/**
* hang元素
*/
isolate: () => void;
/**
*
*/
empty: () => void;
/**
* destory方法
*/
_destroy: () => void;
/**
* destory元素
*/
destroy: () => void;
}
interface RenderEngine {
// TODO: 完成jquery文件夹后把这块改了
/**
* jQuery对象
* @param widget widget对象
*/
createElement: (widget: any) => any;
/**
* DocumentFragment对象
*/
createFragment: () => DocumentFragment;
}