UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

36 lines (35 loc) 1.46 kB
import type { ReactNode } from 'react'; import React from 'react'; import type { ActionObject, IScopedContext, RendererProps } from 'jamis-core'; import { ScopedContext } from 'jamis-core'; import type { PanelSchema } from '../types'; import type { IPanelStore } from './PanelStore'; export interface PanelProps extends RendererProps, Omit<PanelSchema, 'type' | 'className' | 'panelClassName' | 'bodyClassName'> { store: IPanelStore; } interface PanelState { } export default class Panel extends React.Component<PanelProps, PanelState> { static propsList: Array<string>; static defaultProps: Partial<PanelProps>; bodyRendered: boolean; constructor(props: PanelProps); componentDidUpdate(prevProps: Readonly<PanelProps>): void; /** * 响应外部发出的动作 */ doAction: (action: ActionObject, data: Record<string, any>) => void; toggleCollapsed: (forceCollapsed?: boolean | any) => void; renderBody(): ReactNode | null; renderActions(): JSX.Element[] | null; render(): JSX.Element; } export declare class PanelRenderer extends Panel { context: React.ContextType<typeof ScopedContext>; static contextType: React.Context<IScopedContext<import("jamis-core").ScopedComponentType>>; constructor(props: PanelProps, context: IScopedContext); componentWillUnmount(): void; reloadTarget(target: string, data?: any): void; setData(values: Record<string, any>): void; } export {};