tsioc
Version:
tsioc is AOP, Ioc container, via typescript decorator
58 lines (57 loc) • 1.28 kB
TypeScript
import { AdviceMetadata } from './metadatas/index';
import { MapSet } from '../utils/index';
import { Type, ObjectMap } from '../types';
import { Advices } from './advices/index';
/**
* aspect set.
*
* @export
* @interface IAdvisor
*/
export interface IAdvisor {
/**
* aspects
*
* @type {MapSet<Type<any>, ObjectMap<AdviceMetadata[]>>}
* @memberof IAdvisor
*/
aspects: MapSet<Type<any>, ObjectMap<AdviceMetadata[]>>;
/**
* advices
*
* @type {MapSet<string, Advices>}
* @memberof IAdvisor
*/
advices: MapSet<string, Advices>;
/**
* has register advices or not.
*
* @param {Type<any>} targetType
* @returns {boolean}
* @memberof IAdvisor
*/
hasRegisterAdvices(targetType: Type<any>): boolean;
/**
* set advices.
*
* @param {string} key
* @param {Advices} advices
* @memberof IAdvisor
*/
setAdvices(key: string, advices: Advices): any;
/**
* get advices.
*
* @param {string} key
* @returns {Advices}
* @memberof IAdvisor
*/
getAdvices(key: string): Advices;
/**
* add aspect.
*
* @param {Type<any>} aspect
* @memberof IAdvisor
*/
add(aspect: Type<any>): any;
}