@a11d/metadata
Version:
A set of behavior-less metadata decorators.
12 lines • 696 B
TypeScript
/**
* Creates a metadata decorator with the given key supporting both class and property metadata.
* It also provides a getter for retrieving metadata by key and key-path (e.g. 'property.subProperty').
* The key-path getter needs the property to be decorated with `@type(SubPropertyType)`
* for the generated decorator to be able to resolve the metadata.
*/
export declare function createMetadataDecorator(key: symbol): {
(value: unknown): (target: any, propertyKey?: string) => void;
get(constructor: Constructor<any>, propertyKey?: string): any;
getByKeyPath<T>(constructor: Constructor<T>, keyPath: KeyPath.Of<T>): any;
};
//# sourceMappingURL=createMetadataDecorator.d.ts.map