import 'reflect-metadata'; import { PropertyMetadata, MethodMetadata, ParameterMetadata, Metadate } from '../metadatas/index'; import { ArgsIterator } from './ArgsIterator'; import { Type, AbstractType, ObjectMap } from '../../types'; export declare const ParamerterName = "paramerter_names"; export interface MetadataAdapter { (args: ArgsIterator): any; } /** * extend metadata. * * @export * @interface MetadataExtends * @template T */ export interface MetadataExtends { (metadata: T): T; } export interface MetadataTarget { (target: Type | object): Type | object; } /** * decorator for all. * * @export * @interface IDecorator * @template T */ export interface IDecorator { (provider: string | Type, alias?: string): any; (metadata?: T): any; (target: Type): void; (target: object, propertyKey: string | symbol): void; (target: object, propertyKey: string | symbol, parameterIndex: number): void; (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor): void; } /** * create dectorator for class params props methods. * * @export * @template T * @param {string} name * @param {MetadataAdapter} [adapter] metadata adapter * @param {MetadataExtends} [metadataExtends] add extents for metadata. * @returns {*} */ export declare function createDecorator(name: string, adapter?: MetadataAdapter, metadataExtends?: MetadataExtends): any; /** * get all class metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns */ export declare function getTypeMetadata(decorator: string | Function, target: Type | AbstractType): T[]; /** * get own class metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns */ export declare function getOwnTypeMetadata(decorator: string | Function, target: Type | AbstractType): T[]; /** * has class decorator metadata. * * @export * @param {(string | Function)} decorator * @param {(Type | object)} target * @returns {boolean} */ export declare function hasClassMetadata(decorator: string | Function, target: Type | object): boolean; /** * has own class decorator metadata. * * @export * @param {(string | Function)} decorator * @param {(Type | object)} target * @returns {boolean} */ export declare function hasOwnClassMetadata(decorator: string | Function, target: Type | object): boolean; /** * get all method metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns {ObjectMap} */ export declare function getMethodMetadata(decorator: string | Function, target: Type): ObjectMap; /** * get own method metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns {ObjectMap} */ export declare function getOwnMethodMetadata(decorator: string | Function, target: Type): ObjectMap; /** * has own method decorator metadata. * * @export * @param {(string | Function)} decorator * @param {Type} target * @param {(string | symbol)} [propertyKey] * @returns {boolean} */ export declare function hasOwnMethodMetadata(decorator: string | Function, target: Type, propertyKey?: string | symbol): boolean; /** * has method decorator metadata. * * @export * @param {(string | Function)} decorator * @param {Type} target * @param {(string | symbol)} [propertyKey] * @returns {boolean} */ export declare function hasMethodMetadata(decorator: string | Function, target: Type, propertyKey?: string | symbol): boolean; /** * get all property metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns {ObjectMap} */ export declare function getPropertyMetadata(decorator: string | Function, target: Type): ObjectMap; /** * get own property metadata of one specail decorator in target type. * * @export * @template T * @param {(string | Function)} decorator * @param {Type} target * @returns {ObjectMap} */ export declare function getOwnPropertyMetadata(decorator: string | Function, target: Type): ObjectMap; /** * has property decorator metadata. * * @export * @param {(string | Function)} decorator * @param {Type} target * @param {(string | symbol)} [propertyKey] * @returns {boolean} */ export declare function hasPropertyMetadata(decorator: string | Function, target: Type, propertyKey?: string | symbol): boolean; /** * get paramerter metadata of one specail decorator in target method. * * @export * @template T * @param {(string | Function)} decorator * @param {(Type | object)} target * @param {(string | symbol)} propertyKey * @returns {T[][]} */ export declare function getParamMetadata(decorator: string | Function, target: Type | object, propertyKey?: string | symbol): T[][]; /** * get own paramerter metadata of one specail decorator in target method. * * @export * @template T * @param {(string | Function)} decorator * @param {(Type | object)} target * @param {(string | symbol)} propertyKey * @returns {T[][]} */ export declare function getOwnParamMetadata(decorator: string | Function, target: Type | object, propertyKey?: string | symbol): T[][]; /** * has param decorator metadata. * * @export * @param {(string | Function)} decorator * @param {(Type | object)} target * @param {(string | symbol)} propertyKey * @returns {boolean} */ export declare function hasParamMetadata(decorator: string | Function, target: Type | object, propertyKey?: string | symbol): boolean; /** * has param decorator metadata. * * @export * @param {(string | Function)} decorator * @param {(Type | object)} target * @param {(string | symbol)} propertyKey * @returns {boolean} */ export declare function hasOwnParamMetadata(decorator: string | Function, target: Type | object, propertyKey?: string | symbol): boolean; export declare function getParamerterNames(target: Type | AbstractType): ObjectMap; export declare function getOwnParamerterNames(target: Type | AbstractType): ObjectMap; export declare function setParamerterNames(target: Type | AbstractType): void;