import type { PureComponent, PropsWithoutRef, RefAttributes, ForwardRefExoticComponent, ComponentType} from "react"; import { forwardRef } from "react"; import { Consumer } from "./context"; export type CesiumProp = { cesium: C; }; export type CesiumInsideComponentType = { cesiumElement: E; } & PureComponent< WithContextProps > export type CesiumHOCComponentType = ForwardRefExoticComponent< PropsWithoutRef

& RefAttributes> >; export type WithContextProps = P & CesiumProp; export type WithContextType = ComponentType>; export const withCesium = (Component: WithContextType) => // supports both functional components and class components forwardRef, P>((props, ref) => ( {(value: any) => } ));