UNPKG

672 BTypeScriptView Raw
1export declare type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator & {
2 KEY: TKey;
3};
4/**
5 * Decorator that assigns metadata to the class/function using the
6 * specified `key`.
7 *
8 * Requires two parameters:
9 * - `key` - a value defining the key under which the metadata is stored
10 * - `value` - metadata to be associated with `key`
11 *
12 * This metadata can be reflected using the `Reflector` class.
13 *
14 * Example: `@SetMetadata('roles', ['admin'])`
15 *
16 * @see [Reflection](https://docs.nestjs.com/guards#reflection)
17 *
18 * @publicApi
19 */
20export declare const SetMetadata: <K = string, V = any>(metadataKey: K, metadataValue: V) => CustomDecorator<K>;