dino-core
Version:
A dependency injection framework for NodeJS applications
24 lines (23 loc) • 1.56 kB
TypeScript
import 'reflect-metadata';
import { type CacheOptions } from './../cache/cache.manager';
export declare const InjectFromConstructor: <T extends new (...args: any[]) => object>(dependencies: string[]) => (target: T) => void;
export declare const InjectFromParameter: () => (target: object, propertyName: string) => void;
export declare const getInjectableDependencies: (target: any) => string[];
export type TypeName = 'Injectable' | 'Component' | 'Service' | 'Repository' | 'Configuration' | 'ErrorHandler';
export declare const As: <T extends new (...args: any[]) => object>(typeName?: TypeName, lazy?: boolean, dependencies?: string[], profile?: string, cacheConfig?: CacheConfig) => (target: T) => T;
export interface CacheConfig {
key: string;
excludedMethods?: string[];
opts?: CacheOptions;
}
export interface InjectConfig {
lazy?: boolean;
dependencies?: string[];
profile?: string;
cacheConfig?: CacheConfig;
}
export declare const AsInjectable: <T extends new (...args: any[]) => object>(config?: InjectConfig) => (target: T) => T;
export declare const AsComponent: <T extends new (...args: any[]) => object>(config?: InjectConfig) => (target: T) => T;
export declare const AsService: <T extends new (...args: any[]) => object>(config?: InjectConfig) => (target: T) => T;
export declare const AsRepository: <T extends new (...args: any[]) => object>(config?: InjectConfig) => (target: T) => T;
export declare const AsConfiguration: <T extends new (...args: any[]) => object>(config?: InjectConfig) => (target: T) => T;