@redhare/lowcode-types
Version:
Types for Ali lowCode engine
78 lines (77 loc) • 2.68 kB
TypeScript
import { ReactElement, ComponentType } from 'react';
import { IPublicTypeI18nData, IPublicTypeIconType, IPublicTypeTitleContent, IPublicTypeWidgetConfigArea, TipContent } from './';
export declare type IPublicTypeHelpTipConfig = string | {
url?: string;
content?: string | ReactElement;
};
export interface IPublicTypePanelConfigProps extends IPublicTypePanelDockPanelProps {
title?: IPublicTypeTitleContent;
icon?: any;
description?: string | IPublicTypeI18nData;
help?: IPublicTypeHelpTipConfig;
hiddenWhenInit?: boolean;
condition?: (widget: any) => any;
onInit?: (widget: any) => any;
onDestroy?: () => any;
shortcut?: string;
enableDrag?: boolean;
keepVisibleWhileDragging?: boolean;
}
export interface IPublicTypePanelConfig extends IPublicTypeWidgetBaseConfig {
type: 'Panel';
content?: string | ReactElement | ComponentType<any> | IPublicTypePanelConfig[];
props?: IPublicTypePanelConfigProps;
}
export interface IPublicTypeWidgetBaseConfig {
[extra: string]: any;
type: string;
name: string;
/**
* 停靠位置:
* - 当 type 为 'Panel' 时自动为 'leftFloatArea';
* - 当 type 为 'Widget' 时自动为 'mainArea';
* - 其他时候自动为 'leftArea';
*/
area?: IPublicTypeWidgetConfigArea;
props?: Record<string, any>;
content?: string | ReactElement | ComponentType<any> | IPublicTypePanelConfig[];
contentProps?: Record<string, any>;
/**
* 优先级,值越小,优先级越高,优先级高的会排在前面
*/
index?: number;
}
export interface IPublicTypePanelDockConfig extends IPublicTypeWidgetBaseConfig {
type: 'PanelDock';
panelProps?: IPublicTypePanelDockPanelProps;
props?: IPublicTypePanelDockProps;
/** 面板 name, 当没有 props.title 时, 会使用 name 作为标题 */
name: string;
}
export interface IPublicTypePanelDockProps {
[key: string]: any;
size?: 'small' | 'medium' | 'large';
className?: string;
/** 详细描述,hover 时在标题上方显示的 tips 内容 */
description?: TipContent;
onClick?: () => void;
/**
* 面板标题前的 icon
*/
icon?: IPublicTypeIconType;
/**
* 面板标题
*/
title?: IPublicTypeTitleContent;
}
export interface IPublicTypePanelDockPanelProps {
[key: string]: any;
/** 是否隐藏面板顶部条 */
hideTitleBar?: boolean;
width?: number;
height?: number;
maxWidth?: number;
maxHeight?: number;
area?: IPublicTypeWidgetConfigArea;
}
export declare type IPublicTypeSkeletonConfig = IPublicTypePanelDockConfig | IPublicTypeWidgetBaseConfig;