/**@format */ import React from "react"; import { IReactProperty, IReactState, ITianyuUIProperty } from "./model/React"; import { InstanceId, IStore, ITianyuStoreInterfaceImplementation } from "@aitianyu.cn/tianyu-store"; /** * Tianyu Shell React Element * * Abstract type with TianyuStore supporting. Element states will be managed by tianyu store automatically * * @template P element property type * @template S element store state type */ export declare abstract class ReactElement

extends React.Component

{ private selfLoaded; private selfId; private selfListener; constructor(props: P & { state: S; }); componentDidMount(): void; componentWillUnmount(): void; render(): React.ReactNode; forceUpdate(callback?: (() => void) | undefined): void; /** * Get current element store entity typ * * @returns return the type */ get storeType(): string; /** * Get current element object store instance id * * @returns return the instance id */ get instanceId(): InstanceId; /** * Get current element used tianyu store * * @returns return a interface of used store */ get store(): IStore; /** * Get current element is loaded on the DOM and prepared all data * * @returns return true if the element is rendered on the DOM and all data is ready, otherwise false */ get loaded(): boolean; /** Function to register the store interface into tianyu store */ protected registInterface(interfaceImpl: ITianyuStoreInterfaceImplementation): void; /** * To render the ui view * * @returns return the react node */ protected abstract renderUI(): React.ReactNode; /** * Get current element store entity typ * * @returns return the type */ protected abstract getStoreType(): string; /** * Function to called for rendering a template UI when the actual content is not ready. * * @returns return a React object or nothing to return */ protected renderBeforeLoaded(): React.ReactNode | void; /** Function to be called when the element is initialized on the DOM */ protected onAfterLoaded(): void; /** Function to be called when the element will be unloaded from DOM */ protected onBeforeUnloaded(): void; /** * Function to be called when the element state is changed, and this function should to check whether the state change should re-render the DOM * * @returns return true means DOM element will be updated, false will not. */ protected onWillUpdated(_oldState: S | undefined, _newState: S | undefined): boolean; private onStateChanged; }