UNPKG

@ima/react-page-renderer

Version:

IMA.js React page renderer.

40 lines 1.57 kB
import type { Utils } from '@ima/core'; import { type MemoizedFn } from 'memoize-one'; import { Component, ComponentType } from 'react'; import { ErrorBoundary } from './ErrorBoundary'; import { PageContextType } from '../PageContext'; export interface ViewAdapterProps { $Utils: Utils; managedRootView: ComponentType; pageView?: ComponentType; refCallback?: () => void; state: State; } interface State { [key: string]: any; } /** * An adapter component providing the current page controller's state to the * page view component through its properties. */ export declare class ViewAdapter extends Component<ViewAdapterProps, State> { private _managedRootView; private _getContextValue; createContext: MemoizedFn<(...args: any[]) => PageContextType>; contextSelectors: Array<(props: ViewAdapterProps, state: State) => any>; /** * Initializes the adapter component. * * @param props Component properties, containing the actual page view * and the initial page state to pass to the view. */ constructor(props: ViewAdapterProps); static getDerivedStateFromProps(props: ViewAdapterProps, state: ViewAdapterProps['state']): State; getContextValue(props: ViewAdapterProps, state: State): PageContextType; /** * @inheritDoc */ render(): import("react").FunctionComponentElement<import("react").ProviderProps<PageContextType>> | import("react").CElement<import("./ErrorBoundary").ErrorBoundaryProps, ErrorBoundary>; } export {}; //# sourceMappingURL=ViewAdapter.d.ts.map