import lodash from 'lodash'; import { connect } from 'react-redux'; import { Debugger } from 'debug'; import { ReactNode, Context, FC, FunctionComponent } from 'react'; import { formatMessage, FormattedMessage, setLocale } from './locale'; import { IRoute } from './'; declare namespace IUI { export enum LOCALES { 'zh-CN' = '中文', 'en-US' = 'English', } export enum THEME { 'dark' = 'dark', 'light' = 'light', } export enum CONFIG_TYPES { 'string' = 'string', 'string[]' = 'string[]', 'boolean' = 'boolean', 'object' = 'object', 'object[]' = 'object[]', 'list' = 'list', 'textarea' = 'textarea', 'any' = 'any', } type ILang = keyof typeof LOCALES; type ITheme = keyof typeof THEME; interface IContext { theme: ITheme; locale: ILang; currentProject?: ICurrentProject; formatMessage: typeof formatMessage; FormattedMessage: typeof FormattedMessage; setLocale: typeof setLocale; setTheme: (theme: ITheme) => void; showLogPanel: () => void; hideLogPanel: () => void; } type Locale = { [key in string]: string }; type ILocale = { [x in ILang]: Locale }; interface IconType { type: string; theme?: 'filled' | 'outlined' | 'twoTone'; rotate?: number; twoToneColor?: string; } interface IPanelAction { title: string; type?: 'default' | 'primary'; action?: IAction; onClick?: () => void; } interface IPanel extends IRoute { path: string; component: ReactNode; icon: IconType | string; actions?: IPanelAction[]; } interface IService { panels: IPanel[]; locales: ILocale[]; } interface IAction { type: string; payload?: T; onProgress?: (data: K) => void; onMessage?: (data: any) => void; keep?: boolean; } type IValue = string | object | boolean | string[] | object[]; interface IFieldLabel { /** label title */ title: string; /** label description */ description: string; /** description detail link */ link: string; } export interface IFieldProps { /** formItem type */ type: IConfigTypes; /** form field name */ name: string; /** defaultValue(only using in `object` field type) */ defaultValue?: IValue; /** Array Select options */ options?: string[]; /** antd form ins */ form: object; /** antd label, if object using