UNPKG

@nestjs/common

Version:

Nest - modern, fast, powerful node.js web framework (@common)

25 lines (24 loc) 827 B
export declare type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator & { KEY: TKey; }; /** * Decorator that assigns metadata to the class/function using the * specified `key`. * * Requires two parameters: * - `key` - a value defining the key under which the metadata is stored * - `value[]` - array of metadata values to be associated with `key` * * This metadata can be reflected using the `Reflector` class. * * Example: `@SetMetadata('roles', ['admin'])` * * @see [Reflection](https://docs.nestjs.com/guards#reflection) * * @publicApi */ export declare const SetMetadata: <K = string, V = any>(metadataKey: K, metadataValue: V) => CustomDecorator<K>; /** * @deprecated */ export declare const ReflectMetadata: <K = any, V = any>(metadataKey: K, metadataValue: V) => CustomDecorator<K>;