import * as React from 'react' import { NonReactStatics } from 'hoist-non-react-statics' import type Database from '../Database' type WithDatabaseProps = T & { database: Database } type GetProps = C extends React.ComponentType ? P : never // HoC to inject the database into the props of consumers export default function withDatabase< C extends React.ComponentType, P = GetProps, R = Omit, >(Component: C): React.FunctionComponent & NonReactStatics