typed-reflector
Version:
Metadata reflector with typing support.
8 lines (7 loc) • 549 B
TypeScript
import 'reflect-metadata';
import { ArrayValue, GenericMap, Key, MapValue, StringDict } from './def';
export declare class Reflector<M extends StringDict, AM extends StringDict> {
get<K extends Key<GenericMap<M, AM>>>(metadataKey: K, instance: any, key?: string | symbol): MapValue<M, AM, K>;
getArray<K extends Key<AM>>(metadataKey: K, instance: any, key?: string | symbol): ArrayValue<AM, K>;
getProperty<K extends Key<AM>, I = any>(metadataKey: K, instance: I, key: keyof I & (string | symbol), alternate?: any): ArrayValue<AM, K>;
}