UNPKG

1.52 kBTypeScriptView Raw
1/**
2 * Simple pass thru to define metadata
3 *
4 * @param metadataKey
5 * @param metadata
6 * @param target
7 * @param targetKey
8 */
9export declare function setMetadata(metadataKey: string, metadata: any, target: any, targetKey?: string): void;
10/**
11 * Get metadata
12 *
13 * @param metadataKey
14 * @param target
15 * @param targetKey
16 * @returns {any}
17 */
18export declare function getMetadata(metadataKey: string, target: any, targetKey?: string): any;
19export declare function makeMetadataGetter(metadataKey: string): (target: any, targetKey: string) => any;
20export declare const getMetadataReturnType: (target: any, targetKey: string) => any;
21export declare const getMetadataType: (target: any, targetKey: string) => any;
22/**
23 * Property decorator types for the decorator and the
24 * factories used with simple metadata
25 */
26export declare type MetadataPropertyDecorator = (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => any;
27export declare type MetadataPropertyDecoratorFactory<T> = (opts?: T) => MetadataPropertyDecorator;
28/**
29 * Create a simple options decorator for things like finders
30 *
31 * @param metadataKey
32 * @param includeTargetKey
33 * @param customizerFn
34 * @returns {function(T=): function(any, string, TypedPropertyDescriptor<any>): undefined}
35 * - in the customizer, opts is mutable
36 */
37export declare function makeOptionsDecorator<T>(metadataKey: string, includeTargetKey?: boolean, customizerFn?: (opts: T, target: any, targetKey: string) => any): MetadataPropertyDecoratorFactory<T>;