import React, { RefObject } from 'react'; import { Canvas, CanvasProps as FCanvasProps } from '@antv/f-engine'; export interface CanvasProps { className?: string; pixelRatio?: number; width?: number | string; height?: number | string; padding?: (string | number)[]; animate?: boolean; canvasRef?: RefObject; ref?: RefObject; children?: React.ReactElement | React.ReactElement[] | null; fallback?: JSX.Element | null; onError?: (error: Error) => void; autoFit?: boolean; } export interface CanvasState { error: any; } declare const createCanvas: (CanvasClass: typeof Canvas) => { new (props: CanvasProps): { canvasRef: RefObject; canvas: Canvas; parentNode: { width: number; height: number; }; observer: ResizeObserver; catchError(error: any): void; getProps: () => FCanvasProps; componentDidMount(): void; observeElement(): void; resize(): void; componentDidUpdate(): void; render(): JSX.Element; componentWillUnmount(): void; destroy(): void; context: any; setState(state: CanvasState | ((prevState: Readonly, props: Readonly) => CanvasState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; contextType?: React.Context; }; export { createCanvas };