UNPKG

power-di

Version:

A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.

16 lines (15 loc) 458 B
import { KeyType } from '../utils/types'; /** * inject */ export declare function inject({ type, lazy, always, optional, singleton, }?: { type?: KeyType; /** lazy inject @default true */ lazy?: boolean; /** single instance. @default true */ singleton?: boolean; /** always read from context. need lazy. @default false */ always?: boolean; /** allow notfound. @default false */ optional?: boolean; }): PropertyDecorator;