/** * @file 用来创建一个域,在这个域里面会把里面的运行时实例注册进来,方便组件之间的通信。 * @author fex */ import React from 'react'; import { RendererEnv, RendererProps } from './factory'; import { RendererData, Action } from './types'; export interface ScopedComponentType extends React.Component { focus?: () => void; doAction?: (action: Action, data: RendererData, throwErrors?: boolean) => void; receive?: (values: RendererData, subPath?: string) => void; reload?: (subPath?: string, query?: RendererData | null, ctx?: RendererData) => void; context: any; } export interface IScopedContext { parent?: AliasIScopedContext; registerComponent: (component: ScopedComponentType) => void; unRegisterComponent: (component: ScopedComponentType) => void; getComponentByName: (name: string) => ScopedComponentType; getComponents: () => Array; reload: (target: string, ctx: RendererData) => void; send: (target: string, ctx: RendererData) => void; close: (target: string) => void; } declare type AliasIScopedContext = IScopedContext; export declare const ScopedContext: React.Context; export declare function HocScoped(ComposedComponent: React.ComponentType): React.ComponentType void; }> & { ComposedComponent: React.ComponentType; }; export default HocScoped;