// @flow /* eslint-disable no-redeclare, no-unused-vars */ import type { Node, AbstractComponent } from 'react'; export type Dependency = any; declare export class DiProvider extends React$Component< { children?: Node, global?: boolean, target?: AbstractComponent | AbstractComponent[], use: Dependency[], }, { getDependencies: ( deps: Dependency[], target: AbstractComponent | AbstractComponent[] ) => Dependency[], }, > {} declare export function withDi>( component: T, dependencies: Dependency[], target?: AbstractComponent | AbstractComponent[] ): T; declare export function injectable( from: T, implementation: T, options?: {| displayName?: string, target?: Function, global?: boolean, track?: boolean, module?: boolean, |} ): T; type ExtractReturn = $Call<((...Iterable) => T) => T, Fn>; declare export function runWithDi any>( thunk: T, dependencies: Dependency[] ): ExtractReturn; declare export var stats: { /** Returns unused injectables */ unused: () => Array<{ get: () => Dependency, error: () => Error }>, /** Resets stats */ reset: () => void, }; declare export function di(...dependencies: Dependency[]): void; declare export function debug(fn: Function): string;