tsioc
Version:
tsioc is AOP, Ioc container, via typescript decorator
28 lines (27 loc) • 1.11 kB
TypeScript
import { Type } from '../../types';
import { TypeMetadata } from '../metadatas/index';
import { MetadataAdapter, MetadataExtends } from './DecoratorFactory';
export declare type ClassMethodDecorator = (target: Object | Type<any>, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<any>) => void;
/**
* class method decorator
*
* @export
* @interface IClassMethodDecorator
* @template T
*/
export interface IClassMethodDecorator<T extends TypeMetadata> {
(metadata?: T): ClassMethodDecorator;
(target: Type<any>): void;
(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>): void;
}
/**
* create decorator for class and method.
*
* @export
* @template T
* @param {string} name
* @param {MetadataAdapter} [adapter] metadata adapter
* @param {MetadataExtends<T>} [metadataExtends] add extents for metadata.
* @returns {IClassMethodDecorator<T>}
*/
export declare function createClassMethodDecorator<T extends TypeMetadata>(name: string, adapter?: MetadataAdapter, metadataExtends?: MetadataExtends<T>): IClassMethodDecorator<T>;