power-di
Version:
A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.
27 lines (26 loc) • 971 B
TypeScript
import * as React from 'react';
import { ContextSymbol as ContextInProps } from './context';
import type { IocContext } from '../IocContext';
export declare abstract class Component<P = {}, S = {}> extends React.Component<P, S> {
static contextType: React.Context<IocContext>;
context: IocContext;
constructor(props: P, context: IocContext);
}
export declare abstract class PureComponent<P = {}, S = {}> extends React.PureComponent<P, S> {
static contextType: React.Context<IocContext>;
context: IocContext;
constructor(props: P, context: IocContext);
}
interface IocProps {
[ContextInProps]?: IocContext;
}
export declare abstract class BaseConsumerComponent<P = {}, S = {}> extends React.Component<P & IocProps, S> {
constructor(props: IocProps, context: any);
}
export declare function createConsumerComponent(Comp: any): {
new (props: IocProps, context: any): {
[x: string]: any;
};
[x: string]: any;
};
export {};