import React from 'react'; import { Addon, Config, DataBinder, DataProvider, PropertyDef } from '../aop'; import { Dictionary, Type } from '../base'; import { DataSource } from '../data'; import { AsyncCallState, AsyncCallStateMachine, SimpleStateMachine, StateMachine } from '../state'; import { Style } from './style'; /** * 停靠类型 */ export declare const DockType: { left: string; right: string; top: string; bottom: string; fill: string; none: string; }; export declare type SizeProperty = number | string; export interface ReactControlArray extends Array> { } export declare type ReactControl = Config | T | Dictionary | React.ReactElement | ReactControlArray | React.ReactText | boolean | null | undefined; export declare function isReactControlDictionary(config: ReactControl): config is Dictionary>; export declare const defaultPadding = "10px"; export declare const deaultCheckStripSize = "10px"; export declare class HookDataProvider extends DataProvider { } export declare class HookBinder extends DataBinder { dataProviders?: Dictionary; } export declare class ReactAddon extends Addon { static $type: any; type?: any; key?: any; className?: string; children?: ReactControl; ref?: React.LegacyRef; value?: any; style?: Style; binders?: DataBinder[]; hookBinders?: HookBinder[]; onHook?: () => void; onEffect?: () => (() => void); onRender?: () => React.ReactNode; onRenderOuter?: (children: React.ReactNode) => React.ReactNode; getProps?: (() => Pick>) | undefined; } export declare function createComponentFunction(type?: Type): (initProps: T) => JSX.Element; export declare function createComponentClass(type?: Type): any; export declare function createControlType(type: Type): any; export declare const extendAddonLoadStateMachine: SimpleStateMachine; /** * 根据配置创建控件 * @param config 配置 */ export declare function createReactAddonByConfig(config: ReactControl, extendProps?: any, children?: React.ReactNode): React.ReactNode; /** * 根据键值从配置中创建控件 * @param config 配置 * @param key 键 */ export declare function createReactAddonByConfigKey(config: ReactControl, key?: any): React.ReactNode; /** * 刷新器 */ export declare function useRefresh(): () => void; export declare function useAsyncStateMachine(stateMachine: AsyncCallStateMachine, onStateChanged?: (state: AsyncCallState) => void, preJudgeState?: (state: AsyncCallState) => boolean): [AsyncCallState, (action: import("../state").ActionFunc, actionProps: any) => void]; export interface ValueStore { value: T; } /** * 使用值存储(本方法在setValue时一定会导致刷新) * 返回:value: 值, setValue: 设置值的方法 */ export declare function useValueStore(initValue: T): [T, (value: T) => void]; export declare function withAsyncStateMachine>(stateMachine: TSM, createNode: (stateMachine: TSM) => React.ReactNode): JSX.Element; export declare function withStateMachine>(stateMachine: TSM, createNode: () => React.ReactNode | React.ReactNode, onStateChanged?: (newState: any) => void): JSX.Element; export declare function withStateMachines(stateMachines: StateMachine[], createNode: () => React.ReactNode | React.ReactNode, onStateChanged?: (stateMachine: StateMachine, newState: any) => void): JSX.Element; export declare class PathPropertyDef extends PropertyDef { propertyPath?: string; } export declare const DataSourceConext: React.Context>; export declare const SelectionType: { none: string; single: string; multi: string; }; /** 权限上下文 */ export interface AuthorityContextData { /** 登录地址 */ loginRoutePath?: string; } export declare const AuthorityContext: React.Context;