UNPKG

@blynx/inject

Version:
26 lines (25 loc) 789 B
import "reflect-metadata"; /** * Decorate an object as Injectable into classes that are also decorated as Injectable * * @export * @param {IInjectableOptions} [options={}] Options * @returns Decorator */ export declare function Injectable(options?: IInjectableOptions): (constructor: Function) => any; /** * Injectable options * * @export * @interface IInjectableOptions * @property {string} namespace Namespace of the Injectable * @property {{[type: string]: boolean}} exclude Excluded namespaced types for injection, true to exclude * @property {boolean} inject Whether or not the class should have injectables injected into it */ export interface IInjectableOptions { namespace?: string; exclude?: { [type: string]: boolean; }; inject?: boolean; }