import { ICtor } from '../ctor'; import { Token } from '../token'; declare type ProviderToken = Token | ICtor; export interface IPluginProvider { /** Key to use as provider if different than the decorated class itself */ token?: ProviderToken; /** use a factory to provide the plugin instantiation */ factory?: (...deps: any[]) => T; /** source dependencies to resolve for the factory or the constructor itself */ deps?: any[]; } /** * Plugin record once decorator factory is provided * @internal */ export interface IPluginRecord extends IPluginProvider { ctor: ICtor; } /** * Map of registered plugin objects * @internal */ export declare const PluginRegistry: Map>; /** * @Provide decorator factory * @param config plugin provider configuration */ export declare function Provide(config?: IPluginProvider): any; /** * Signature when prototype property decorator is used: * ```ts * class Foo { * @Bar() * public bar: any; * } * ``` */ export declare type PropertyDecorator = (target: T, propertyKey: string, descriptor: undefined) => void; /** * Signature when a ctor argument is decorated * class Foo { * constructor(@Bar() public bar: any) * } */ export declare type CtorArgDecorator = (target: ICtor, propertyKey: undefined, index: number) => void; /** * Injects a plugin into a class member or constructor argument * @param token a registered plugin token for injection * @param args any extra args to provide to the plugin factory */ export declare function Plugin(token: ProviderToken, ...args: any[]): any; export {};